Available for cloud, desktop and mobile
Specify colors by their color components.
Run the code to make the color red:
RGBColor makes colors from red, green and blue color component values. The component values range from 0 (none) to 1 (full). This gives red, because only the red component is nonzero:
When all of the components are 0, you get black:
When all of the components are 1, you get white:
Make a shade of blue. Try other color component values:
Mix different amounts of red, green and blue to get different colors:
Make a color in a different color space. Try other color component values:
There are “color spaces” other than RGBColor that specify colors in different ways.
Hue makes colors from a hue value (the color), a saturation value (how intense the color is) and a brightness value (how dark or light the color is).
Here is red in the Hue color space (also called “HSB”):
Use a smaller saturation value to get pink:
Make red text. Try other colors:
Use colors to style text or color graphical elements. This makes red text:
This makes a blue disk: