Next / Previous / Contents / Shipman's homepage

4.2. The color wheel and the RGB color model

Considering only pure colors, we can arrange them in a circle called the color wheel.

In this view, we can characterize any pure color as a mixture of red, green, and blue light. This way of viewing colors is called the RGB model after the three component colors.

If you start with red light, as you add some green light, the color shifts toward yellow. From yellow, if you reduce the amount of red light, the color shifts toward green, and so forth around the circle.

This view of light will be familiar to anyone who has done theater lighting. Most theater lighting systems allow you to mix various amounts of red, green, and blue light to achieve a given color. For example, if you want a scene to look like it is taking place outdoors on a clear day, you would use a cyclorama (a large, featureless white sheet) in the background, and project blue light onto it, to resemble the sky.

The RGB color model is also the standard way of specifying colors on a Web page. In general, any color may be specified as a color name of the form “#RRGGBB”. Within this color name, the RR part is a hexadecimal (base 16) number between 00 and FF that specifies the amount of red in the color, where 00 means no red and FF means the maximum amount of red.

Similarly, the GG and BB parts of this color name specify the relative amount of green and blue.

For example, color #FFFF00 means full intensity of red and green, but no blue, and gives you yellow. Any number of intermediate values are possible. For example, #ff8000 is an orange hue: it specifies the maximum amount of red and half intensity of green, which puts it halfway between red and yellow on the color wheel.

Red, green and blue are referred to as the additive primary colors: starting with black, you can add various amounts of these colors of light to move toward all the lighter colors.