Colour values

Overview
Colour names and values - HTML compliant
Colour names and values - browser friendly (SVG)
Greyscale colour values
Defining a colour using RGB format
Defining a colour using hexadecimal format
Summary example

This reference is designed to assist in defining colours1 in web pages. Theoretically there are 16,777,216 colours in the available palette, although most monitors can only tell the difference between a little over 16,000 of them. Almost certainly the colour you want is among them.

Colour names and values - HTML compliant2

Aqua  #00FFFF rgb(000,255,255)
Black  #000000 rgb(000,000,000)
Blue  #0000FF rgb(000,000,255)
Fuchsia  #FF00FF rgb(255,000,255)
Gray  #808080 rgb(128,128,128)
Green  #008000 rgb(000,128,000)
Lime  #00FF00 rgb(000,255,000)
Maroon  #800000 rgb(128,000,000)
Navy  #000080 rgb(000,000,128)
Olive  #808000 rgb(128,128,000)
Orange  #FFA500 rgb(255,165,000)
Purple  #800080 rgb(128,000,128)
Red  #FF0000 rgb(255,000,000)
Silver  #C0C0C0 rgb(192,192,192)
Teal  #008080 rgb(000,128,128)
White  #FFFFFF rgb(255,255,255)
Yellow  #FFFF00 rgb(255,255,000)

Colour names and values - browser friendly (SVG)3

Black  #000000 rgb(000,000,000)
Indigo   #4B0082 rgb(075,000,130)
MidnightBlue  #191970 rgb(025,025,112)
Navy  #000080 rgb(000,000,128)
DarkBlue  #00008B rgb(000,000,139)
DarkSlateBlue  #483D8B rgb(072,061,139)
MediumBlue  #0000CD rgb(000,000,205)
Blue  #0000FF rgb(000,000,255)
RoyalBlue  #4169E1 rgb(065,105,225)
SteelBlue  #4682B4 rgb(070,130,180)
CornflowerBlue  #6495ED rgb(100,149,237)
DodgerBlue  #1E90FF rgb(030,144,255)
LightSteelBlue  #B0C4DE rgb(176,196,222)
LightBlue  #ADD8E6 rgb(173,216,230)
PaleTurquoise  #AFEEEE rgb(175,238,238)
PowderBlue  #B0E0E6 rgb(176,224,230)
SkyBlue  #87CEEB rgb(135,206,235)
LightSkyBlue  #87CEFA rgb(135,206,250)
CadetBlue  #5F9EA0 rgb(095,158,160)
Teal  #008080 rgb(000,128,128)
DarkCyan  #008B8B rgb(000,139,139)
LightSeaGreen  #20B2AA rgb(032,178,170)
DeepSkyBlue  #00BFFF rgb(000,191,255)
DarkTurquoise  #00CED1 rgb(000,206,209)
MediumTurquoise  #48D1CC rgb(072,209,204)
Turquoise  #40E0D0 rgb(064,224,208)
Cyan  #00FFFF rgb(000,255,255)
Aqua  #00FFFF rgb(000,255,255)
Aquamarine  #7FFFD4 rgb(127,255,212)
MediumAquaMarine  #66CDAA rgb(102,205,170)
DarkSlategray  #2F4F4F rgb(047,079,079)
DarkGreen  #006400 rgb(000,100,000)
Green  #008000 rgb(000,128,000)
ForestGreen  #228B22 rgb(034,139,034)
SeaGreen  #2E8B57 rgb(046,139,087)
MediumSeaGreen  #3CB371 rgb(060,179,113)
MediumSpringGreen  #00FA9A rgb(000,250,154)
SpringGreen  #00FF7F rgb(000,255,127)
DarkSeaGreen  #8FBC8F rgb(143,188,143)
LightGreen  #90EE90 rgb(144,238,144)
PaleGreen  #98FB98 rgb(152,251,152)
LimeGreen  #32CD32 rgb(050,205,050)
Lime  #00FF00 rgb(000,255,000)
LawnGreen  #7CFC00 rgb(124,252,000)
Chartreuse  #7FFF00 rgb(127,255,000)
GreenYellow  #ADFF2F rgb(173,255,047)
YellowGreen  #9ACD32 rgb(154,205,050)
OliveDrab  #6B8E23 rgb(107,142,035)
Olive  #808000 rgb(128,128,000)
DarkOliveGreen  #556B2F rgb(085,107,047)
DimGray  #696969 rgb(105,105,105)
Gray  #808080 rgb(128,128,128)
SlateGray  #708090 rgb(112,128,144)
LightSlateGray  #778899 rgb(119,136,153)
DarkGray  #A9A9A9 rgb(169,169,169)
Silver  #C0C0C0 rgb(192,192,192)
MediumSlateBlue  #7B68EE rgb(123,104,238)
SlateBlue  #6A5ACD rgb(106,090,205)
MediumPurple  #9370D8 rgb(147,112,216)
BlueViolet  #8A2BE2 rgb(138,043,226)
DarkViolet  #9400D3 rgb(148,000,211)
DarkOrchid  #9932CC rgb(153,050,204)
DarkMagenta  #8B008B rgb(139,000,139)
Purple  #800080 rgb(128,000,128)
DarkRed  #8B0000 rgb(139,000,000)
Maroon  #800000 rgb(128,000,000)
SaddleBrown  #8B4513 rgb(139,069,019)
Sienna  #A0522D rgb(160,082,045)
Brown  #A52A2A rgb(165,042,042)
FireBrick  #B22222 rgb(178,034,034)
DarkGoldenRod  #B8860B rgb(184,134,011)
DarkKhaki  #BDB76B rgb(189,183,107)
PaleVioletRed  #D87093 rgb(216,112,147)
MediumVioletRed  #C71585 rgb(199,021,133)
IndianRed   #CD5C5C rgb(205,092,092)
Crimson  #DC143C rgb(220,020,060)
Chocolate  #D2691E rgb(210,105,030)
GoldenRod  #DAA520 rgb(218,165,032)
Peru  #CD853F rgb(205,133,063)
DarkSalmon  #E9967A rgb(233,150,122)
LightCoral  #F08080 rgb(240,128,128)
Salmon  #FA8072 rgb(250,128,114)
BurlyWood  #DEB887 rgb(222,184,135)
SandyBrown  #F4A460 rgb(244,164,096)
Tan  #D2B48C rgb(210,180,140)
PaleGoldenRod  #EEE8AA rgb(238,232,170)
Khaki  #F0E68C rgb(240,230,140)
RosyBrown  #BC8F8F rgb(188,143,143)
LightGray  #D3D3D3 rgb(211,211,211)
Gainsboro  #DCDCDC rgb(220,220,220)
Thistle  #D8BFD8 rgb(216,191,216)
Plum  #DDA0DD rgb(221,160,221)
Violet  #EE82EE rgb(238,130,238)
Orchid  #DA70D6 rgb(218,112,214)
MediumOrchid  #BA55D3 rgb(186,085,211)
Red  #FF0000 rgb(255,000,000)
OrangeRed  #FF4500 rgb(255,069,000)
Tomato  #FF6347 rgb(255,099,071)
DeepPink  #FF1493 rgb(255,020,147)
Fuchsia  #FF00FF rgb(255,000,255)
HotPink  #FF69B4 rgb(255,105,180)
LightPink  #FFB6C1 rgb(255,182,193)
Pink  #FFC0CB rgb(255,192,203)
LightSalmon  #FFA07A rgb(255,160,122)
Coral  #FF7F50 rgb(255,127,080)
Darkorange  #FF8C00 rgb(255,140,000)
Orange  #FFA500 rgb(255,165,000)
Gold  #FFD700 rgb(255,215,000)
Yellow  #FFFF00 rgb(255,255,000)
LightCyan  #E0FFFF rgb(224,255,255)
Lavender  #E6E6FA rgb(230,230,250)
AliceBlue  #F0F8FF rgb(240,248,255)
HoneyDew  #F0FFF0 rgb(240,255,240)
Azure  #F0FFFF rgb(240,255,255)
WhiteSmoke  #F5F5F5 rgb(245,245,245)
MintCream  #F5FFFA rgb(245,255,250)
GhostWhite  #F8F8FF rgb(248,248,255)
Linen  #FAF0E6 rgb(250,240,230)
LightGoldenRodYellow  #FAFAD2 rgb(250,250,210)
OldLace  #FDF5E6 rgb(253,245,230)
Beige  #F5F5DC rgb(245,245,220)
AntiqueWhite  #FAEBD7 rgb(250,235,215)
PeachPuff  #FFDAB9 rgb(255,218,185)
NavajoWhite  #FFDEAD rgb(255,222,173)
Wheat  #F5DEB3 rgb(245,222,179)
Moccasin  #FFE4B5 rgb(255,228,181)
Bisque  #FFE4C4 rgb(255,228,196)
BlanchedAlmond  #FFEBCD rgb(255,235,205)
PapayaWhip  #FFEFD5 rgb(255,239,213)
MistyRose  #FFE4E1 rgb(255,228,225)
LavenderBlush  #FFF0F5 rgb(255,240,245)
Cornsilk  #FFF8DC rgb(255,248,220)
LemonChiffon  #FFFACD rgb(255,250,205)
LightYellow  #FFFFE0 rgb(255,255,224)
SeaShell  #FFF5EE rgb(255,245,238)
FloralWhite  #FFFAF0 rgb(255,250,240)
Snow  #FFFAFA rgb(255,250,250)
Ivory  #FFFFF0 rgb(255,255,240)
White  #FFFFFF rgb(255,255,255)

Greyscale colour values4

#080808  rgb(008,008,008) 
#101010  rgb(016,016,016) 
#181818  rgb(024,024,024) 
#202020  rgb(032,032,032) 
#282828  rgb(040,040,040) 
#303030  rgb(048,048,048) 
#383838  rgb(056,056,056) 
#404040  rgb(064,064,064) 
#484848  rgb(072,072,072) 
#505050  rgb(080,080,080) 
#585858  rgb(088,088,088) 
#606060  rgb(096,096,096) 
#686868  rgb(104,104,104) 
#707070  rgb(112,112,112) 
#787878  rgb(120,120,120) 
#808080  rgb(128,128,128) 
#888888  rgb(136,136,136) 
#909090  rgb(144,144,144) 
#989898  rgb(152,152,152) 
#A0A0A0  rgb(160,160,160) 
#A8A8A8  rgb(168,168,168) 
#B0B0B0  rgb(176,176,176) 
#B8B8B8  rgb(184,184,184) 
#C0C0C0  rgb(192,192,192) 
#C8C8C8  rgb(200,200,200) 
#D0D0D0  rgb(208,208,208) 
#D8D8D8  rgb(216,216,216) 
#E0E0E0  rgb(224,224,224) 
#E8E8E8  rgb(232,232,232) 
#F0F0F0  rgb(240,240,240) 
#F8F8F8  rgb(248,248,248) 

Overview - CSS colour values

Strictly speaking, only 17 colours have a literal name value that will work validly in CSS5 style sheets. That means that using any other colour name will show up as an error if the CSS script is checked for well-formedness6 by using an HTML validator such as the one at validator.w3.org/#validate-by-upload and the CSS file validator at jigsaw.w3.org/css-validator/#validate-by-upload. The 17 fully compliant colours are shown above.

Having said that, there is actually a total of 140 colours also listed above that may be referred to explicitly by name and will work regardless in most browsers, despite the fact that these colour names are not in the CSS specification. They are commonly referred to as SVG colours. If you generally use any of the internationalisations of the English language, notice that colour names and the word 'color' follows the American English spelling convention in HTML and CSS. The colours table here is sorted to facilitate easy selection of the required colour.

For convenience, a greyscale colour chart is included.

Other than the limited set of named colours, any colour can be referred to by it's hexadecimal7 value or it's RGB value. Both are alternative ways to give the same result. See below for an explanation and examples of each of these.

Defining a colour using RGB format

All colours are constituted of a mixture of red, green and blue. The amount of red, green and blue in a colour is determined by setting a number between 0 and 255 for each colour component. If there is 0 blue, that's no blue at all. On the other hand, 255 blue is full on. Here is an example of a light grey blue;

rgb(119,136,153)

The resulting displayed colour is mixed from 119 parts of red, 136 parts of green and 153 parts of blue. An alternative way of mixing red, green and blue is to set the percentage of each constituent colour. Here is the same light grey blue again;

rgb(47%,53%,60%)

Notice that any exactly equal amounts of each of the red, green and blue constituents will create a shade of grey.

Defining a colour using hexadecimal format

The hexadecimal colour definition works similarly to the RGB colour definition in that it is a composite of red, green and blue. Each constituent colour value is converted into hexadecimal numbers from 00 to FF. The values are strung together without spaces or commas between each value and are proceeded by the # symbol. Here is an example hexadecimal colour;

#6A5ACD

The # character tells the browser that this is a hex colour value. It is composed of 6A (106) parts red, 5A (90) parts green and CD (205) parts blue. It could just as easily have been written;

rgb(106,90,205)

or

rgb(42%,35%,80%)

Another - and even more compact - hex method of defining colours is to use the alternative single hex digit for each value. This means that there is a maximum range for each constituent colour from 0 to F (that's the same as 0 to 15 in decimal notation). This still gives a total range of colour definitions of 16 x 16 x 16 colours or 4,096 colours in total. An example definition for a bright yellow would be;

#FF0

The browser will understand any of these alternative methods of writing colours values.

Summary example

This example demonstrates all the variant forms of notation that will set the CSS text colour property to light sea green. These all define the red component of a colour in the left most digits, the green component in the middle digits and the blue component in the right most digits.

color: LightSeaGreen; 
color: rgb(032,178,170);
color: rgb(13%,70%,67%);
color: #20B2AA;
color: #20b2aa;
color: #2BB;
color: #2bb;

The percentages in the third method above approximate to the color values in the second method. The 3 digit hex methods are an approximation of the 6 digit hex method, rounding off to the nearest significant digit.

 


 

1 This document is written in UK English

2 The seventeen Strictly CSS compliant named colours (with the possible exception of orange) will work in any browser including most legacy browsers.

3 The named colours listed here are, strictly speaking, part of the Scalable Vector Graphics (SVG) specification. Since SVG and XHTML are both (almost) XML compliant, the SVG colours have been implemented for HTML in most current browsers, even though they are not part of the HTML specification. Scalable Vector Graphics (SVG) is an implementation of XML defined by the W3C. It provides a fully scalable description of images and entire page presentations if required.

4 Only significant increments of greyscale are shown here in the Greyscale table. Any colour where the individual RGB red, blue and green have the same value - for example color: rgb(199,199,199) will render as a shade of grey. Since the HTML range for each RGB colour element is 0 to 255, there is a range of 256 greyscale shades.

5 This document conforms to the CSS2 and above specification

6 "Well-formed" script is defined as fully meeting the HTML / CSS specification defined by the W3C. If it is not well-formed, it does not necessarily mean that the web page won't actually work correctly, as long as the inclusions are broadly accepted practice and therefore are supported by all the major browsers. SVG colour literal names are a case in point. And yes, 'well-formedness' is a dreadful word.

7 Hexadecimal uses the base 16 numerals 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, A, B, C, D, E, F. In comparison, the decimal system goes from 0 to 9.