HTML Color Codes

Colors

With the form on this page you can look up Netscape's names for a number of color codes.  Netscape's color names are supported by most newer browsers.


Implementation

The codes are used in HTML documents when specifying colors for a number of different elements:

  Background: <BODY BGCOLOR="#rgb">
Text: <BODY TEXT="#rgb">
<BASEFONT COLOR="#rgb">
<FONT COLOR="#rgb">
Links: <BODY LINK="#rgb" VLINK="#rgb" ALINK="#rgb">
Tables: <TABLE BGCOLOR="#rgb">
<TH BGCOLOR="#rgb">
<TR BGCOLOR="#rgb">
<TD BGCOLOR="#rgb">
Stylesheets:  Element { color: #rgb }
 Element { background-color: #rgb }
 Element { background: #rgb }
Inline Styles: <Element STYLE="color: #rgb">
<Element STYLE="background-color: #rgb">
<Element STYLE="background: #rgb">

where rgb is the color's composition of of red (r), green (g) and blue (b) stated with hexadecimal values from 00 (0) to FF (255) for each of the three colors.


Decimal Color Code

Because most graphic computer applications uses decimal and not hexadecimal values for colors, the form here below provides the possibility to enter the decimal codes of the colors.  When looking up by the decimal color codes the corresponding hexadecimal codes are calculated and vice versa.


Safe Colors

As each of the three colors can be stated with 256 different values this gives 256*256*256 = 16,777,216 different combinations.  On computer systems that can not display more than 256 colors this leads to "dithering" of some of the colors, meaning that the color is contructed of two or more colors arranged in a dot pattern.

To avoid dithering one of the 216 "Safe Colors" can be used.  These Safe Colors are all composed of combinations of the values 00, 33, 66, 99, CC and FF for red, green and blue, and should not be changed by browsers under Windows or MacIntosh operating systems.

In the form here below the nearest Safe Color will be shown at lookup on a color code or a color name.


If the box labeled  Show window  is checked, then the stated color and nearest Safe Color will be displayed in a small pop-up window. If a stated color is invalid, the default background color of the browser will be used.

If the box labeled  Focus window  is checked, then the pop-up window is put into focus each time one of the OK-buttons is pressed.  If this box is not checked, it is possible to scroll up and down in the Color Name selection field by means of the arrow-up and arrow-dows keys on the keyboard, hence intantly changing the colors in the pop-up window at each keypress.  To benefit from this, the browser window and the pop-up window of course has to be arranged so that both windows are visible at the same time.  (This doesn't work in Microsoft Internet Explorer).
 

Color Code (hexadecimal): Fill out the desired
field and press the
OK-button to the right
of the field to have the
other fields filled out.
Color Code (decimal):
Safe Color (hex. / dec.): /
Color Name:
Pop-up Window: Show window     Focus window

 
In browsers with slow JavaScript execution it may take a few seconds before Color Code or Color Name is found.

 

Show:
List with all Color Names
Table with all Safe Colors

 
At slow JavaScript execution it may take quite some time before the list / table is displayed.
 

Last updated January 15th 2002. Download this page without graphics (6,988 bytes).