Color Names

Determining the RGB-triple value for anything other than the simplest colors (you try figuring out esoteric colors like “papaya whip” or “navajo white”) is not easy. You can go crazy trying to adjust the RGB triple for a color to get the shade just right, especially when each adjustment requires loading a document into your browser to view the result.

To make life easier, the standards define 16 standard color names that you can use anywhere you can use a numeric color value. For example, you can make all visited links in the display magenta with the following attribute and value for the body tag:

<body vlink="magenta">

The color names and RGB values defined in the HTML/XHTML standards are:

aqua (#00FFFF)

gray (#808080)

navy (#000080)

silver (#C0C0C0)

black (#000000)

green (#008000)

olive (#808000)

teal (#008080)

blue (#0000FF)

lime (#00FF00)

purple (#800080)

yellow (#FFFF00)

fuchsia (#FF00FF)

maroon (#800000)

red (#FF0000)

white (#FFFFFF)

The popular browsers go well beyond the standard and support the several hundred color names defined for use in the X Window System. Note that these color names may contain no spaces; also, the word gray may be spelled grey in any color name.

Those colors marked with an asterisk (*) actually 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 ...

Get HTML & XHTML: The Definitive Guide, 6th Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.