Color Names and Values
You may specify the color value as a six-digit hexadecimal number that represents the red, green and blu (RGB) components of the color. The first two digits correspond to th red component of color, the next two are the green component and the last two are the blu component. A value of 00 corresponds to the component being completely off and a value of FF (255) corresponds to the component being completely on. Thus, bright red is FF0000, bright green is 00FF00 and bright blue is 0000FF. Other primary colors are mixtures of ot two components, such as yellow (FFFF00), magenta (FF00FF) and cyan (00FFFF). White (FFFFFF) and black (000000) are also easy to figure out.
You use the values in a tag by replacing the color with the RGB triple, preceeded by a hash (#) symbol. Thus to make all visited links display as magenta, use this body tag:
A chart depicting some popular hex codes is located here.
To make life easier, the HTML 4.0 standard defines 16 standard color names that can be used anywhere a numeric color value can be used. For example, you can make all the visted links in the display magenta with the following attribute for the body tag:
The color names and RGB values defined in the HTML standard are:
The popular browsers go well beyond the HTML 4.0 standard and support the several hundred color names defined for use in the X Window System. Not the color names may contain no spaces; also, the word gray may be spelled grey in any color names.
Color marked with an asterisk(*) represent a family of colors numbered one through four. Thus, there are actually four variants of blue, named blue1, blue2, blue3 and blue4, along with plain old blue. Blue1 is the lightest of the four, blue4 is the darkest. The unnumbered color name is the same color as the first; thus, blue and blue1 are identical.
Finally, if all that isn't enough, there are 100 variants of gray (and grey) numbered 1 through 100. Gray1 is the darkest, gray100 is the lightest, and gray is very close to gray75.
The extended color names are: