| HTML Colors |
|
Contents
The application of colors in strict HTML is severely limited; the foreground color (i.e. text) can be set using the (deprecated) attribute color in the elements <font> and <basefont>, and the background color through the attribute bgcolor in the elements <body>, <table>, <tr> and <td> & <th>.
By using CSS style sheets the possible applications are greatly expanded.
The straightforward way to indicate colors are nearly identical in HTML and in CSS (style sheets). You may specify a color using:
In style sheets you may also indicate colors using the so-called RBG notation:
Apart from the RGB indication of colors, CSS3 also allows the Hue-Saturation-Luminosity (HSL) notation for colors (HSL is more common in other color applications).
HSL indications can be converted to RGB, and vice versa (see Testbox).
In CSS3 (HTML5) you can also indicate the transparency of the color with an extra parameter called 'alpha' or 'opacity'. The value of this parameter varies from 0.0 (completely transparent) to 1.0 (fully opaque).
This leads to the so called RGBA color values, where the 3 parameter RGB color values are extended by a fourth value: the Alpha. Or to the HSLA variant. Examples:
By default, the 3 parameter RGB or HSL values use an Alpha of 1.0 (i.e. no transparancy).
Note that there is no hexadecimal notation for RGBA or HSL(A).
The usefulness of transparency for normal web pages is limited; it may only serve a purpose when you use layers (CSS: z-index).
Transparent¹: not an actual color, but the lack of any (opaque) color: full transparency | |||||
Black¹ | = #000000 | ||||
Gray¹ / Grey | = #808080 | Silver¹ | = #C0C0C0 | ||
LightGray/LightGrey | = #D3D3D3 | DarkGray/DarkGrey | = #A9A9A9 | ||
SlateGray/SlateGrey | = #708090 | DimGray/DimGrey | = #696969 | ||
LightSlategray/LightSlategrey | = #778899 | DarkSlategray/DarkSlategrey | = #2F4F4F | ||
White¹ | = #FFFFFF | FloralWhite | = #FFFAF0 | ||
Snow | = #FFFAFA | Whitesmoke | = #F5F5F5 | ||
GhostWhite | = #F8F8FF | Ivory | = #FFFFF0 | ||
AliceBlue | = #F0F8FF | Azure | = #F0FFFF | ||
BlanchedAlmond | = #FFEBCD | AntiqueWhite | = #FAEBD7 | ||
Beige | = #F5F5DC | Cornsilk | = #FFF8DC | ||
Lavender | = #E6E6FA | Lavenderblush | = #FFF0F5 | ||
Linen | = #FAF0E6 | Honeydew | = #F0FFF0 | ||
LemonChiffon | = #FFFACD | Mintcream | = #F5FFFA | ||
Seashell | = #FFF5EE | LightgoldenrodYellow | = #FAFAD2 | ||
MistyRose | = #FFE4E1 | Moccasin | = #FFE4B5 | ||
NavajoWhite | = #FFDEAD | Palegoldenrod | = #EEE8AA | ||
Papayawhip | = #FFEFD5 | Peachpuff | = #FFDAB9 | ||
Thistle | = #D8BFD8 | Wheat | = #F5DEB3 | ||
Tan | = #D2B48C | Gainsboro | = #DCDCDC | ||
Brown | = #A52A2A | Bisque | = #FFE4C4 | ||
Burlywood | = #DEB887 | Chocolate | = #D2691E | ||
Khaki | = #F0E68C | DarkKhaki | = #BDB76B | ||
RosyBrown | = #BC8F8F | SaddleBrown | = #8B4513 | ||
Peru | = #CD853F | Sienna | = #A0522D | ||
Goldenrod | = #DAA520 | Darkgoldenrod | = #B8860B | ||
SandyBrown | = #F4A460 | Maroon¹ | = #800000 | ||
Pink | = #FFC0CB | DeepPink | = #FF1493 | ||
HotPink | = #FF69B4 | LightPink | = #FFB6C1 | ||
Plum | = #DDA0DD | Oldlace | = #FDF5E6 | ||
Red¹ | = #FF0000 | DarkRed | = #8B0000 | ||
IndianRed | = #CD5C5C | Firebrick | = #B22222 | ||
Crimson | = #DC143C | Tomato | = #FF6347 | ||
Salmon | = #FA8072 | DarkSalmon | = #E9967A | ||
LightSalmon | = #FFA07A | LightCoral | = #F08080 | ||
Orange² | = #FFA500 | DarkOrange | = #FF8C00 | ||
OrangeRed | = #FF4500 | Coral | = #FF7F50 | ||
Yellow¹ | = #FFFF00 | Gold | = #FFD700 | ||
LightYellow | = #FFFFE0 | GreenYellow | = #ADFF2F | ||
Green¹ | = #008000 | ||||
LightGreen | = #90EE90 | DarkGreen | = #006400 | ||
Chartreuse | = #7FFF00 | LawnGreen | = #7CFC00 | ||
DarkOlivegreen | = #556B2F | DarkSeagreen | = #8FBC8F | ||
PaleGreen | = #98FB98 | YellowGreen | = #9ACD32 | ||
SeaGreen | = #2E8B57 | LightSeagreen | = #20B2AA | ||
ForestGreen | = #228B22 | MediumSeagreen | = #3CB371 | ||
Lime¹ | = #00FF00 | LimeGreen | = #32CD32 | ||
SpringGreen | = #00FF7F | MediumSpringgreen | = #00FA9A | ||
Olive¹ | = #808000 | Olivedrab | = #6B8E23 | ||
Teal¹ | = #008080 | ||||
Aquamarine | = #7FFFD4 | MediumAquamarine | = #66CDAA | ||
Blue¹ | = #0000FF | Aqua¹ | = #00FFFF | ||
RoyalBlue | = #4169E1 | Navy¹ | = #000080 | ||
LightBlue | = #ADD8E6 | DarkBlue | = #00008B | ||
DarkSlateblue | = #483D8B | DodgerBlue | = #1E90FF | ||
SkyBlue | = #87CEEB | DeepSkyblue | = #00BFFF | ||
CadetBlue | = #5F9EA0 | CornflowerBlue | = #6495ED | ||
SteelBlue | = #4682B4 | LightSteelblue | = #B0C4DE | ||
PowderBlue | = #B0E0E6 | LightSkyblue | = #87CEFA | ||
MediumBlue | = #0000CD | MidnightBlue | = #191970 | ||
Cyan | = #00FFFF | ||||
LightCyan | = #E0FFFF | DarkCyan | = #008B8B | ||
Turquoise | = #40E0D0 | PaleTurquoise | = #AFEEEE | ||
MediumTurquoise | = #48D1CC | DarkTurquoise | = #00CED1 | ||
Purple¹ | = #800080 | Orchid | = #DA70D6 | ||
DarkOrchid | = #9932CC | MediumOrchid | = #BA55D3 | ||
Violet | = #EE82EE | PaleVioletred | = #DB7093 | ||
BlueViolet | = #8A2BE2 | Slateblue | = #6A5ACD | ||
Indigo | = #4B0082 | MediumSlateblue | = #7B68EE | ||
MediumVioletred | = #C71585 | DarkViolet | = #9400D3 | ||
Magenta | = #FF00FF | DarkMagenta | = #8B008B | ||
Fuchsia¹ | = #FF00FF | MediumPurple | = #9370DB |
Foreground & background colors using the (CSS2) predefined color names.
black | gray | silver | white | maroon | red | orange | yellow | lime | green | teal | olive | aqua | blue | navy | fuchsia | purple | ||
black | black | gray | silver | white | maroon | red | orange | yellow | lime | green | teal | olive | aqua | blue | navy | fuchsia | purple | black |
gray | black | gray | silver | white | maroon | red | orange | yellow | lime | green | teal | olive | aqua | blue | navy | fuchsia | purple | gray |
silver | black | gray | silver | white | maroon | red | orange | yellow | lime | green | teal | olive | aqua | blue | navy | fuchsia | purple | silver |
white | black | gray | silver | white | maroon | red | orange | yellow | lime | green | teal | olive | aqua | blue | navy | fuchsia | purple | white |
maroon | black | gray | silver | white | maroon | red | orange | yellow | lime | green | teal | olive | aqua | blue | navy | fuchsia | purple | maroon |
red | black | gray | silver | white | maroon | red | orange | yellow | lime | green | teal | olive | aqua | blue | navy | fuchsia | purple | red |
orange | black | gray | silver | white | maroon | red | orange | yellow | lime | green | teal | olive | aqua | blue | navy | fuchsia | purple | orange |
yellow | black | gray | silver | white | maroon | red | orange | yellow | lime | green | teal | olive | aqua | blue | navy | fuchsia | purple | yellow |
lime | black | gray | silver | white | maroon | red | orange | yellow | lime | green | teal | olive | aqua | blue | navy | fuchsia | purple | lime |
green | black | gray | silver | white | maroon | red | orange | yellow | lime | green | teal | olive | aqua | blue | navy | fuchsia | purple | green |
teal | black | gray | silver | white | maroon | red | orange | yellow | lime | green | teal | olive | aqua | blue | navy | fuchsia | purple | teal |
olive | black | gray | silver | white | maroon | red | orange | yellow | lime | green | teal | olive | aqua | blue | navy | fuchsia | purple | olive |
aqua | black | gray | silver | white | maroon | red | orange | yellow | lime | green | teal | olive | aqua | blue | navy | fuchsia | purple | aqua |
blue | black | gray | silver | white | maroon | red | orange | yellow | lime | green | teal | olive | aqua | blue | navy | fuchsia | purple | blue |
navy | black | gray | silver | white | maroon | red | orange | yellow | lime | green | teal | olive | aqua | blue | navy | fuchsia | purple | navy |
fuchsia | black | gray | silver | white | maroon | red | orange | yellow | lime | green | teal | olive | aqua | blue | navy | fuchsia | purple | fuchsia |
purple | black | gray | silver | white | maroon | red | orange | yellow | lime | green | teal | olive | aqua | blue | navy | fuchsia | purple | purple |
black | gray | silver | white | maroon | red | orange | yellow | lime | green | teal | olive | aqua | blue | navy | fuchsia | purple |
For 'normal' use you may want to modify the foreground & background colors to increase contrast: dark colors a tad darker and light colors a tad lighter.
The table below provides a selection of the color palette. Note that the table covers only a small portion of the possible combinations: the light colors are stepped with an interval of x20, and only a minor part of the dark colors are presented (they are less common).
000000 | 002020 | 004040 | 006060 | 008080 | 00a0a0 | 00c0c0 | 00e0e0 | 00ffff | 00e0e0 | 00c0c0 | 00a0a0 | 008080 | 006060 | 004040 | 002020 | 000000 |
002000 | 004020 | 006040 | 008060 | 00a080 | 00c0a0 | 00e0c0 | 00ffe0 | 20ffff | 00e0ff | 00c0e0 | 00a0e0 | 0080a0 | 006080 | 004060 | 002040 | 000020 |
004000 | 006020 | 008040 | 00a060 | 00c080 | 00e0a0 | 00ffc0 | 20ffe0 | 40ffff | 20e0ff | 00c0ff | 00a0e0 | 0080c0 | 0060a0 | 004080 | 002060 | 000040 |
006000 | 008020 | 00a040 | 00c060 | 00e080 | 00ffa0 | 20ffc0 | 40ffe0 | 60ffff | 40e0ff | 20c0ff | 00a0ff | 0080e0 | 0060c0 | 0040a0 | 002080 | 000060 |
008000 | 00a020 | 00c040 | 00e060 | 00ff80 | 20ffa0 | 40ffc0 | 60ffe0 | 80ffff | 60e0ff | 40c0ff | 20a0ff | 0080ff | 0060e0 | 0040c0 | 0020a0 | 000080 |
00a000 | 00c020 | 00e040 | 00ff60 | 20ff80 | 40ffa0 | 60ffc0 | 80ffe0 | a0ffff | 80e0ff | 60c0ff | 40a0ff | 2080ff | 0060ff | 0040e0 | 0020c0 | 0000a0 |
00c000 | 00e020 | 00ff40 | 20ff60 | 40ff80 | 60ffa0 | 80ffc0 | a0ffe0 | c0ffff | a0e0ff | 80c0ff | 60a0ff | 4080ff | 2040ff | 0040ff | 0020e0 | 0000c0 |
00e000 | 00ff20 | 20ff40 | 40ff60 | 60ff80 | 80ffa0 | a0ffc0 | c0ffe0 | e0ffff | c0e0ff | a0c0ff | 80a0ff | 6080ff | 4060ff | 2040ff | 0020ff | 0000e0 |
00ff00 | 20ff20 | 40ff40 | 60ff60 | 80ff80 | a0ffa0 | c0ffc0 | e0ffe0 | ffffff | e0e0ff | c0c0ff | a0a0ff | 8080ff | 6060ff | 4040ff | 2020ff | 0000ff |
20ff00 | 40ff20 | 60ff40 | 80ff60 | a0ff80 | c0ffa0 | e0ffc0 | ffffe0 | ffe0e0 | ffe0ff | e0c0ff | c0a0ff | a080ff | 8060ff | 6040ff | 4020ff | 2000ff |
40ff00 | 60ff20 | 80ff40 | a0ff60 | c0ff80 | e0ffa0 | ffffc0 | ffe0c0 | ffc0c0 | ffc0e0 | ffc0ff | e0a0ff | c080ff | a060ff | 8040ff | 6020ff | 4000ff |
60ff00 | 80ff20 | a0ff40 | c0ff60 | e0ff80 | ffffa0 | ffe0a0 | ffc0a0 | ffa0a0 | ffa0c0 | ffa0e0 | ffa0ff | e080ff | c060ff | a040ff | 8020ff | 6000ff |
80ff00 | a0ff20 | c0ff40 | e0ff60 | ffff80 | ffe080 | ffc080 | ffa080 | ff8080 | ff80a0 | ff80c0 | ff80e0 | ff80ff | e060ff | c040ff | a020ff | 8000ff |
a0ff00 | c0ff20 | e0ff40 | ffff60 | ffe060 | ffc060 | ffa060 | ff8060 | ff6060 | ff6080 | ff60a0 | ff60c0 | ff60e0 | ff60ff | e040ff | c020ff | a000ff |
c0ff00 | e0ff20 | ffff40 | ffe040 | ffc040 | ffa040 | ff8040 | ff6040 | ff4040 | ff4060 | ff4080 | ff40a0 | ff40c0 | ff40e0 | ff40ff | e020ff | c000ff |
e0ff00 | ffff20 | ffe020 | ffc020 | ffa020 | ff8020 | ff6020 | ff4020 | ff2020 | ff2040 | ff2060 | ff2080 | ff20a0 | ff20c0 | ff20e0 | ff20ff | e000ff |
ffff00 | ffe000 | ffc000 | ffa000 | ff8000 | ff6000 | ff4000 | ff2000 | ff0000 | ff0020 | ff0040 | ff0060 | ff0080 | ff00a0 | ff00c0 | ff00e0 | ff00ff |
Foreground background |
| Enter new values for foreground and/or background color as hexadecimal, decimal RGB or HSL value in the appropriate input boxes, or click on the arrows |
=O=