|
Color codes
In monitors, colors are composed and displayed by a combination of 3 basic colors: Red, Green and Blue.
Colors are therefore expressed by there RGB values. Each value ranges from 0 (darkest) to 255 (lightest).
Thus, 255 x 255 x 255 = 16 million color possibilities called 32 bit color. Example: a pure red is 255,0,0; a pure green is 0,255,0 and a pure blue is 0,0,255.
A pure black is 0,0,0 where a pure white is 255,255,255. When there is the same value for all tree color components, the result will be a
shade of gray. Example: 120, 120, 120 is a medium shade of gray.
Since Web browsers cannot interpret the RGB color code values, a
different way of expressing the color value was devised called HEX value. HEX values are expressed in the same sequence as the RGB
values,
meaning the first 2 digit expresses the Red value, the second 2 digits, the Green value and the last 2 digits the Blue value. This signifies that for
each of the 255 color shades there exists an equivalent HEX value expressed in a combination of 2 digits. RGB 0 = Hex 00, RGB 255 = Hex FF. Example
: a pure red is FF0000; a pure green is 00FF00 and a pure blue is 0000FF. A pure black is 000000 where a pure white is FFFFFF. When
there is the same value for all tree color components, the result will be a shade of gray.
Example: 808080 is a medium shade of gray. See table below for RGB to HEX equivalencies.
But not all Web browsers support all colors. Depending on the version, they will either support
216, 4096 or 65,336 colors. |
| 216 Web safe colors
text
4096 Web colors
In this color combination, the hex components for Red, Green & Blue use the following values: 00, 11, 22, 33, 44, 55, 66, 77, 88, 99, AA, BB, CC, DD, EE, FF.
The total number of color combinations, 16 x 16 x 16 = 4096, includes the 216 colors in the web palette. Digit pairs are used.
CSS style sheets allow each pair to be abbreviated to a single digit.
16-bit - 65,536 colors
By end of 2003, less than 2% of the internet population were using 256 color mode, but a significant proportion are still using 16 bit color
mode ( High Color ). There is a range of pale colors which change dramatically in 256 color mode, but outside that range the color shift is not
too bad. Sixteen bit values are divided into Red, Green & Blue components
On Microsoft Windows systems, the first increment from zero is a double step. Red & Blue increment in steps of 8, and Green increments in steps of 4 ( hex: 16,
08, 16 ). The final value is set to FF. |
| How to use the color selector
In the table below, the horizontal value in red represents the first HEX code: for red,
the vertical value in green represents the second HEX code: for green and the bottom value represents the last HEX code: for blue. |
Color mode detected as:
|
|
F0 |
C0 |
90 |
60 |
30 |
00 |
00 |
30 |
60 |
90 |
C0 |
F0 |
F0 |
C0 |
90 |
60 |
30 |
00 |
00 |
30 |
60 |
90 |
C0 |
F0 |
F0 |
C0 |
90 |
60 |
30 |
00 |
00 |
30 |
60 |
90 |
C0 |
F0 |
|
| 00 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
00 |
| 30 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
30 |
| 60 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
60 |
| 90 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
90 |
| C0 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
C0 |
| F0 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
F0 |
|
F0 |
C0 |
90 |
60 |
30 |
00 |
|
|
| Safe pale colors If all three RGB values are "F9", or higher, most browsers will use white in 256 color mode. Internet Explorer for Windows also uses pale gray ( F8 F8 F8 ) in 256 color mode. |
|
|
Unsafe pale colors
In 16 bit mode ( High Color ) colors can be approximated with a 'dither' pattern. In 256 color mode most of the colors will change to the nearest
Web safe color, but the 56 lightest colors are unsafe.
There are 256 possible alternative colors, not just the 216 colors in the web palette.
Microsoft Windows has 32 grayscale shades in its 256 color palette.
The table shows 64 color combinations using only hex components CC, DD, EE, FF.
The eight colors marked with circles are web palette colors.
Each browser uses a different selection of substitute colors for the remaining 56.
If all three RGB components are above "DC" hex ( 220 decimal ) the color will be "unsafe" in 256 color mode. In this range each browser uses different substitute colors. |
|
FF |
EE |
DD |
CC |
CC |
DD |
EE |
FF |
FF |
EE |
DD |
CC |
CC |
DD |
EE |
FF |
|
CC |
O |
|
|
O |
|
|
|
|
|
|
|
|
O |
|
|
O |
CC |
DD |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
DD |
| EE |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
EE |
| FF |
O |
| |
O |
| |
| |
| |
| |
O |
| |
O |
FF |
|
FF |
EE |
DD |
CC |
|
|
|
RGB to HEX equivalents
|