HTML Color Codes
Colors are basically produced by a combination of red, green and blue. When you want to specify a color in your HTML document, what you do is to specify the values for these three basic colors and these values are between 0 and 255 (0 and FF in hex). Once you know the value of the hex code for these three individual colors (use windows Hex calculator to convert the decimal value to hex), combine the three values and use in COLOR attribute. For example, you want a combination of 150 red, 78 green and 227 blue. The hex values for these three are 96, 4E and E3 respectively. So, you will code the color attribute as COLOR=#964EE3. Remember that the order is RGB (Red, Green, Blue).
There are three other color values : hue, saturation and luminance. Each is related to how a color looks on screen, but they do not account for the contributions of individual colors like RGB values do.
Hue is a measure of which of the three primary colors is dominant in the image. Lower hue values are associated with oranges and yellows and higher values are associated with purples and reds.
Saturation refers to how much color is in the image. A saturation of zero means no color or gray.
Luminance measures an image's tendency toward white. A maximum luminance value makes the color white and a zero value makes the color black.
These values are normally given in a color pallette like Netscape Color Wizard, Photoshop or other similar packages. The values for hue, saturation and luminance set the appropriate RGB values.
Instead of giving the RGB code, you can also code the color name directly in COLOR attribute (HTML 3.2 specification). The allowable color names are : Aqua, Black, Blue, Fuchsia, Gray, Green, Lime, Maroon, Navy, Olive, Purple, Red, Silver, Teal, White and Yellow.
The following table gives the color codes for some popular colors.
| Color Name | RGB code |
| Bright Gold | #D9D919 |
| Copper | #B87333 |
| Coral | #FF7F00 |
| Dusty Rose | #856363 |
| Forest Green | #238E23 |
| Khaki | #9F9F5F |
| Midnight Blue | #2F2F4F |
| Neon Pink | #FF6EC7 |
| Salmon | #6F4242 |
| Tan | #DB9370 |
In spite of the uniform values for RGB, the rendering of the colors by the browsers may not be the same. Each browser uses it's own internal algorithm to render the colors and so the final color may not exactly be the same as you intended.