The Hex triplet reference article from the English Wikipedia on 24-Apr-2004
(provided by Fixed Reference: snapshots of Wikipedia from wikipedia.org)

Hex triplet

Sponsorship the way you would do it
A hex triplet is a 3 byte number used in html and css to represent colors, represented in hexadecimal (hex for short). Since a byte is 8 bits, values of each element can go from 00 to FF (which is 0 to 255 in decimal), and you can create 1 number by just running the bits together, to form 000000 (black) till FFFFFF (white)
  1. byte: red value
  2. byte: green value
  3. byte : blue value

Table of contents
1 Construction
2 examples
3 See also

Construction

If you want to construct a hex triplet,
  1. try to figure out the RGB coordinates of your color (for instance, red) :
  2. (255, 0, 0)

    Convert the numbers to hexadecimal values:
  3. (FF, 00, 00)

    then just run them together:
#FF0000

examples

(your browser must support style sheets to be able to see this)

Blue : #0000FF


Red : #FF0000


Dark Red : #A00000

Grey : #A0A0A0 (note that any hex triplet whose three bytes are identical will result in a shade of grey)

Dark Yellow : #A0A000

See also

And for further examples: Hex triplets for each color are listed under:
Colors

White | Gray | Black 
Red | Orange | Yellow | Green | Blue | Indigo | Violet
Aquamarine | Brown | Gold | Coral | Crimson | Cyan | Magenta | Maroon | Ochre | Pink | Purple