Computer monitors (and television screens) display colors using the RGB color space. Red, green, and blue are the primary colors, and all other colors are created by combining the primaries.
Colors are specified with three values, one each for red, green, and blue. The values specify the intensity of the colors, from 0 (none) to 255 (full intensity). In RGB decimal notation, red is 255,0,0 (red at full intensity, no green or blue); green is 0,255,0 (green at full intensity, no red or blue); and blue is 0,0,255 (blue at full intensity, no red or green).
| R | G | B | ||
|---|---|---|---|---|
| Red | 255 | 0 | 0 | |
| Green | 0 | 255 | 0 | |
| Blue | 0 | 0 | 255 |
| Decimal | 0 | 17 | 34 | 51 | 68 | 85 | 102 | 119 | 136 | 153 | 170 | 187 | 204 | 221 | 238 | 255 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Red | ||||||||||||||||
| Green | ||||||||||||||||
| Blue |
RGB is an additive color system; white is the result of adding red, green, and blue at full intensity, and black is the absence of all three colors.
Bit depth, or color depth, refers to the number of colors a monitor can display. Full RGB combines three 8-bit channels, resulting in a 24-bit color depth that adds up to over 16 million colors. 24-bit color is sometimes referred to as True Color.
| Windows | Bit depth | Number of colors | Macintosh |
|---|---|---|---|
| True color | 24-bit | 16,777,216 | Millions of colors |
| High color | 16-bit | 65,536 | Thousands of colors |
| Indexed color | 8-bit | 256 | 256 colors |
Web colors are usually specified using hexadecimal notation. The hexadecimal system is an alphanumeric base-16 system. The following chart shows the relation of the color values used in the web-smart palette expressed as percentages, decimal values, and hexadecimal values:
| Percent | 0 | 7 | 13 | 20 | 27 | 33 | 40 | 47 | 53 | 60 | 67 | 73 | 80 | 87 | 93 | 100 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Decimal | 0 | 17 | 34 | 51 | 68 | 85 | 102 | 119 | 136 | 153 | 170 | 187 | 204 | 221 | 238 | 255 |
| Hex | 00 | 11 | 22 | 33 | 44 | 55 | 66 | 77 | 88 | 99 | aa | bb | cc | dd | ee | ff |
Note: Browser-safe colors are shaded in gray and are exact percentages. Percentages for the other web-smart colors are rounded to the nearest percent.