Color: Values

HTML colors are combinations of RED, GREEN, and BLUE light. There are just over 16 million colors, but only about 140 are standard colors, supported by all major browsers. These colors are charted on the previous page with color names, and HEX numbers. There are three ways colors can be specified in HTML documents:

Hexadecimal Color Values

Specified as #RRGGBB, where the RR (red), GG (green) and BB (blue) hexadecimal integers specify the components of the color. All values must be between 00 and FF.

For example, the #0000FF value is rendered as blue, because the blue component is set to its highest value (FF) and the others are set to the lowest value (00).

RGB Color Values

Specified by numbers representing red, green, and blue. Each parameter (red, green, blue) defines the intensity of the color and can be an integer between 0 and 255.

For example, the RGB (0,0,255) value is rendered as blue, because the blue parameter is set to its highest value (255) and the others are set to 0.


Color Color HEX Color RGB Color Name
#FF0000 (255,0,0) Red
#00FF00 (0,255,0) Green
#0000FF (0,0,255) Blue
  #000000 (0,0,0) Black
  #808080 (128,128,128) Gray
  #FFFFFF (255,255,255) White
Shades of grey are often defined using equal values for all the 3 light sources.

There are plenty of webpages online to help find specific HEX and RGB numbers. Even most paint programs will specify HEX and RGB details.

Back button Table of Contents Next button