Set the fill color to RGB (255, 0, 0) for a red circle.
Write a program that lets the user change RGB sliders and displays the resulting color.
// Creating a circle object var circle = new Circle(50); circle.setPosition(200, 200); // Method 1: Using a Hex/String representation circle.setColor("#FF5733"); // Method 2: Using CodeHS built-in color constants circle.setColor(Color.RED); // Method 3: Custom RGB syntax using standard web strings circle.setColor("rgb(255, 87, 51)"); add(circle); Use code with caution. 3. Random Color Generation Exercise
function updateColor() var r = redSlider.getValue(); var g = greenSlider.getValue(); var b = blueSlider.getValue(); colorRect.setColor(Color.rgb(r, g, b));