Answers Best - Exploring Rgb Color Codes Codehs

Prompt: What happens when you set the Red value to 255, Green to 0, and Blue to 255? Best Answer: Purple (Magenta) .

CodeHS often uses a rubric. To get the "Best" score, you need to go beyond the minimum. exploring rgb color codes codehs answers best

  • Variable Mapping: Use variables for the best code structure.
    var redAmount = 100;
    var blueAmount = 200;
    rect.setColor("rgb(" + redAmount + ", 0, " + blueAmount + ")");
    
  • The Problem: "Write the RGB for a medium gray that is exactly 40% white." The Calculation: 40% of 255 = 102. The Answer: rgb(102, 102, 102) Prompt: What happens when you set the Red