In the world of HTML we express colours as hexadecimal values. Colours are made up of three components; Red, Blue and Green (RGB) and we express a given colour as the amount of saturation each of the RGB values has. We can chose 255 different values for each one. Thus, giving us the ability to express any one of the 16 million colours (255 x 255 x 255).
To minimize the number of digits we use to express the colour, we use the hexadecimal numbering system. Unlike the familiar decimal system that uses 10 digits, the hexadecimal uses 16. For example we would count from 0 to 15 in hexadecimal:
Where A = 10, B = 11 and so on until F = 15. We define colours as a 6 digit string, prefixed with the # symbol in the format: #RRGGBB, where each pair represents the saturation of each colour. For example:
Any tag that can take a color attribute, the value is expressed as this hexadecimal number.
Color | Hex Code | Color | Hex Code | Color | Hex Code |
|---|---|---|---|---|---|
Alice blue | #F0F8FF | Antique white | #FAEBD7 | Aqua | #00FFFF |
Aquamarine | #7FFFD4 | Azure | #F0FFFF | Beige | #F5F5DC |
Bisque | #FFE4C4 | Black | #000000 | Blanche dalmond | #FFEBCD |
Blue | #0000FF | Blue violet | #8A2BE2 | Brown | #A52A2A |
Burlywood | #DEB887 | Cadet blue | #5F9EA0 | Chartreuse | #7FFF00 |
Chocolate | #D2691E | Coral | #FF7F50 | Cornflower blue | #6495ED |
Cornsilk | #FFF8DC | Crimson | #DC143C | Cyan | #00FFFF |
Dark blue | #00008B | Dark cyan | #008B8B | Dark goldenrod | #B8860B |
Dark gray | #A9A9A9 | Dark green | #006400 | Dark khaki | #BDB76B |
Dark magenta | #8B008B | Dark olive green | #556B2F | Dark orange | #FF8C00 |
Dark orchid | #9932CC | Dark red | #8B0000 | Dark salmon | #E9967A |
Dark seagreen | #8DBC8F | Dark slate blue | #483D8B | Dark slate gray | #2F4F4F |
Dark turquoise | #00DED1 | Dark violet | #9400D3 | Deep pink | #FF1493 |
Deep sky blue | #00BFFF | Dim gray | #696969 | Dodger blue | #1E90FF |
Firebrick | #B22222 | Floral white | #FFFAF0 | Forest green | #228B22 |
Fuchsia | #FF00FF | Gainsboro | #DCDCDC | Ghost white | #F8F8FF |
Gold | #FFD700 | Goldenrod | #DAA520 | Gray | #808080 |
Green | #008000 | Green yellow | #ADFF2F | Honeydew | #F0FFF0 |
Hot pink | #FF69B4 | Indian red | #CD5C5C | Indigo | #4B0082 |
Ivory | #FFFFF0 | Khaki | #F0E68C | Lavender | #E6E6FA |
Lavender blush | #FFF0F5 | Lawngreen | #7CFC00 | Lemon chiffon | #FFFACD |
Light blue | #ADD8E6 | Light coral | #F08080 | Light cyan | #E0FFFF |
Light goldenrod yellow | #FAFAD2 | Light green | #90EE90 | Light grey | #D3D3D3 |
Light pink | #FFB6C1 | Light salmon | #FFA07A | Light seagreen | #20B2AA |
Light sky blue | #87CEFA | Light slate gray | #778899 | Light steel blue | #B0C4DE |
Light yellow | #FFFFE0 | Lime | #00FF00 | Lime green | #32CD32 |
Linen | #FAF0E6 | Magenta | #FF00FF | Maroon | #800000 |
Medium aquamarine | #66CDAA | Medium blue | #0000CD | Medium orchid | #BA55D3 |
Medium purple | #9370DB | Medium sea green | #3CB371 | Medium slate blue | #7B68EE |
Medium spring green | #00FA9A | Medium turquoise | #48D1CC | Medium violet red | #C71585 |
Midnight blue | #191970 | Mint cream | #F5FFFA | Misty rose | #FFE4E1 |
Moccasin | #FFE4B5 | Navajo white | #FFDEAD | Navy | #000080 |
Old lace | #FDF5E6 | Olive drab | #6B8E23 | Orange | #FFA500 |
Orange red | #FF4500 | Orchid | #DA70D6 | Pale goldenrod | #EEE8AA |
Pale green | #98FB98 | Pale turquoise | #AFEEEE | Pale violet red | #DB7093 |
Papaya whip | #FFEFD5 | Peach puff | #FFDAB9 | Peru | #CD853F |
Pink | #FFC8CB | Plum | #DDA0DD | Powder blue | #B0E0E6 |
Purple | #800080 | Red | #FF0000 | Rosy brown | #BC8F8F |
Royal blue | #4169E1 | Saddle brown | #8B4513 | Salmon | #FA8072 |
Sandy brown | #F4A460 |