Main Page

encyclopedia.codeboy.net

 

Web colors

\n\n\n Authors of web pages have a variety of options available for specifying colors for elements of web documents. Colors may be specified as an RGB triplet in hexadecimal format (a hex triplet); they may also be specified according to their common English names in some cases. The first versions of Mosaic and Netscape Navigator used the X11 color names as the basis for their color lists, as both started as X Window System applications. The origin of the X11 color list is unknown. [1]

Table of contents
1 Hex triplet
2 Construction
3 Examples
4 Standard color names
5 Proprietary color names
6 Web-safe colors
7 Really web safe colors
8 CSS Colors
9 See also
10 External links

Hex triplet

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) \n# byte: red value \n# byte: green value\n# byte : blue value

Construction

\nIf you want to construct a hex triplet, \n# try to figure out the
RGB coordinates of your color (for instance, red) : \n (255, 0, 0)
  1. Convert the numbers to hexadecimal values:\n (FF, 00, 00)
  2. then just run them together:\n #FF0000

Examples

\n(your browser must support style sheets to be able to see this)
Blue : #0000FF \n
Red : #FF0000 \n
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

Standard color names

The
HTML 4.01 specification defines sixteen named colors, as follows: {| border="0"\n!Color\n!Hexadecimal\n!Color\n!Hexadecimal\n|-\n|black\n|style="background:#000000; color:#ffffff; font-family:monospace;"|#000000\n|silver\n|style="background:#c0c0c0; color:#000000; font-family:monospace;"|#c0c0c0\n|-\n|gray\n|style="background:#808080; color:#ffffff; font-family:monospace;"|#808080\n|white\n|style="background:#ffffff; color:#000000; font-family:monospace;"|#ffffff\n|-\n|maroon\n|style="background:#800000; color:#ffffff; font-family:monospace;"|#800000\n|red\n|style="background:#ff0000; color:#000000; font-family:monospace;"|#ff0000\n|-\n|purple\n|style="background:#800080; color:#ffffff; font-family:monospace;"|#800080\n|fuchsia\n|style="background:#ff00ff; color:#000000; font-family:monospace;"|#ff00ff\n|-\n|green\n|style="background:#008000; color:#ffffff; font-family:monospace;"|#008000\n|lime\n|style="background:#00ff00; color:#000000; font-family:monospace;"|#00ff00\n|-\n|olive\n|style="background:#808000; color:#ffffff; font-family:monospace;"|#808000\n|yellow\n|style="background:#ffff00; color:#000000; font-family:monospace;"|#ffff00\n|-\n|navy\n|style="background:#000080; color:#ffffff; font-family:monospace;"|#000080\n|blue\n|style="background:#0000ff; color:#000000; font-family:monospace;"|#0000ff\n|-\n|teal\n|style="background:#008080; color:#ffffff; font-family:monospace;"|#008080\n|aqua\n|style="background:#00ffff; color:#000000; font-family:monospace;"|#00ffff\n|}

Proprietary color names

In addition, a number of colors are defined by browsers such as
Netscape or Internet Explorer. A particular browser may not recognise all of these colors. Many of these colors are from the list of X11 color names distributed with the X Window System.\nSome of them, along with their hexadecimal equivalents, are listed below. {| border="0"\n|-\n!color\n!hexadecimal\n!color\n!hexadecimal\n|-\n|indianred\n|style="background:#cd5c5c; color:#ffffff; font-family:monospace;"|#cd5c5c\n|darksalmon\n|style="background:#e9967a; color:#ffffff; font-family:monospace;"|#e9967a\n|-\n|lightcoral\n|style="background:#f08080; color:#ffffff; font-family:monospace;"|#f08080\n|salmon\n|style="background:#fa8072; color:#ffffff; font-family:monospace;"|#fa8072\n|-\n|orangered\n|style="background:#ff4500; color:#ffffff; font-family:monospace;"|#ff4500\n|red\n|style="background:#ff0000; color:#ffffff; font-family:monospace;"|#ff0000\n|-\n|crimson\n|style="background:#dc143c; color:#ffffff; font-family:monospace;"|#dc143c\n|firebrick\n|style="background:#b22222; color:#ffffff; font-family:monospace;"|#b22222\n|-\n|darkred\n|style="background:#8b0000; color:#ffffff; font-family:monospace;"|#8b0000\n|mediumvioletred\n|style="background:#c71585; color:#ffffff; font-family:monospace;"|#c71585\n|-\n|pink\n|style="background:#ffc0cb; font-family:monospace;"|#ffc0cb\n|lightpink\n|style="background:#ffb6c1; font-family:monospace;"|#ffb6c1\n|-\n|hotpink\n|style="background:#ff69b4; font-family:monospace;"|#ff69b4\n|deeppink\n|style="background:#ff1493; font-family:monospace;"|#ff1493\n|-\n|palevioletred\n|style="background:#db7093; font-family:monospace;"|#db7093\n|darkkhaki\n|style="background:#bdb76b; font-family:monospace;"|#bdb76b\n|-\n|khaki\n|style="background:#f0e68c; font-family:monospace;"|#f0e68c\n|palegoldenrod\n|style="background:#eee8aa; font-family:monospace;"|#eee8aa\n|-\n|lightgoldenrodyellow\n|style="background:#fafad2; font-family:monospace;"|#fafad2\n|lightyellow\n|style="background:#ffffe0; font-family:monospace;"|#ffffe0\n|-\n|lemonchiffon\n|style="background:#fffacd; font-family:monospace;"|#fffacd\n|yellow\n|style="background:#ffff00; font-family:monospace;"|#ffff00\n|-\n|gold\n|style="background:#ffd700; font-family:monospace;"|#ffd700\n|papayawhip\n|style="background:#ffefd5; font-family:monospace;"|#ffefd5\n|-\n|moccasin\n|style="background:#ffe4b5; font-family:monospace;"|#ffe4b5\n|peachpuff\n|style="background:#ffdab9; font-family:monospace;"|#ffdab9\n|-\n|cyan\n|style="background:#00ffff; font-family:monospace;"|#00ffff\n|aqua\n|style="background:#00ffff; font-family:monospace;"|#00ffff\n|-\n|aquamarine\n|style="background:#7fffd4; font-family:monospace;"|#7fffd4\n|turquoise\n|style="background:#40e0d0; font-family:monospace;"|#40e0d0\n|-\n|mediumturquoise\n|style="background:#48d1cc; font-family:monospace;"|#48d1cc\n|darkturquoise\n|style="background:#00ced1; font-family:monospace;"|#00ced1\n|-\n|cadetblue\n|style="background:#5f9ea0; color:#ffffff; font-family:monospace;"|#5f9ea0\n|slategray\n|style="background:#708090; color:#ffffff; font-family:monospace;"|#708090\n|-\n|lightcyan\n|style="background:#e0ffff; font-family:monospace;"|#e0ffff\n|paleturquoise\n|style="background:#afeeee; font-family:monospace;"|#afeeee\n|-\n|powderblue\n|style="background:#b0e0e6; font-family:monospace;"|#b0e0e6\n|lightsteelblue\n|style="background:#b0c4de; font-family:monospace;"|#b0c4de\n|-\n|steelblue\n|style="background:#4682b4; color:#ffffff; font-family:monospace;"|#4682b4\n|lightblue\n|style="background:#add8e6; font-family:monospace;"|#add8e6\n|-\n|skyblue\n|style="background:#87ceeb; font-family:monospace;"|#87ceeb\n|lightskyblue\n|style="background:#87cefa; font-family:monospace;"|#87cefa\n|-\n|deepskyblue\n|style="background:#00bfff; font-family:monospace;"|#00bfff\n|cornflowerblue\n|style="background:#6495ed; font-family:monospace;"|#6495ed\n|-\n|royalblue\n|style="background:#4169e1; font-family:monospace;"|#4169e1\n|mediumslateblue\n|style="background:#7b68ee; font-family:monospace;"|#7b68ee\n|-\n|dodgerblue\n|style="background:#1e90ff; font-family:monospace;"|#1e90ff\n|blue\n|style="background:#0000ff; color:#ffffff; font-family:monospace;"|#0000ff\n|-\n|mediumblue\n|style="background:#0000cd; color:#ffffff; font-family:monospace;"|#0000cd\n|darkblue\n|style="background:#00008b; color:#ffffff; font-family:monospace;"|#00008b\n|-\n|navy\n|style="background:#000080; color:#ffffff; font-family:monospace;"|#000080\n|midnightblue\n|style="background:#191970; color:#ffffff; font-family:monospace;"|#191970\n|-\n|lightsalmon\n|style="background:#ffa07a; font-family:monospace;"|#ffa07a\n|orange\n|style="background:#ffa500; font-family:monospace;"|#ffa500\n|-\n|darkorange\n|style="background:#ff8c00; font-family:monospace;"|#ff8c00\n|coral\n|style="background:#ff7f50; font-family:monospace;"|#ff7f50\n|-\n|tomato\n|style="background:#ff6347; font-family:monospace;"|#ff6347\n|orangered\n|style="background:#ff4500; font-family:monospace;"|#ff4500\n|-\n|aquamarine\n|style="background:#7fffd4; font-family:monospace;"|#7fffd4\n|mediumspringgreen\n|style="background:#00fa9a; font-family:monospace;"|#00fa9a\n|-\n|springgreen\n|style="background:#00ff7f; font-family:monospace;"|#00ff7f\n|palegreen\n|style="background:#98fb98; font-family:monospace;"|#98fb98\n|-\n|greenyellow\n|style="background:#adff2f; font-family:monospace;"|#adff2f\n|chartreuse\n|style="background:#7fff00; font-family:monospace;"|#7fff00\n|-\n|lawngreen\n|style="background:#7cfc00; font-family:monospace;"|#7cfc00\n|lime\n|style="background:#00ff00; font-family:monospace;"|#00ff00\n|-\n|lightgreen\n|style="background:#90ee90; font-family:monospace;"|#90ee90\n|yellowgreen\n|style="background:#9acd32; font-family:monospace;"|#9acd32\n|-\n|limegreen\n|style="background:#32cd32; font-family:monospace;"|#32cd32\n|mediumseagreen\n|style="background:#3cb371; font-family:monospace;"|#3cb371\n|-\n|darkseagreen\n|style="background:#8fbc8f; font-family:monospace;"|#8fbc8f\n|forestgreen\n|style="background:#228b22; color:#ffffff; font-family:monospace;"|#228b22\n|-\n|seagreen\n|style="background:#2e8b57; color:#ffffff; font-family:monospace;"|#2e8b57\n|green\n|style="background:#008000; color:#ffffff; font-family:monospace;"|#008000\n|-\n|olivedrab\n|style="background:#6b8e23; color:#ffffff; font-family:monospace;"|#6b8e23\n|olive\n|style="background:#808000; color:#ffffff; font-family:monospace;"|#808000\n|-\n|darkolivegreen\n|style="background:#556b2f; color:#ffffff; font-family:monospace;"|#556b2f\n|darkgreen\n|style="background:#006400; color:#ffffff; font-family:monospace;"|#006400\n|-\n|mediumaquamarine\n|style="background:#66cdaa; font-family:monospace;"|#66cdaa\n|turquoise\n|style="background:#40e0d0; font-family:monospace;"|#40e0d0\n|-\n|lightseagreen\n|style="background:#20b2aa; font-family:monospace;"|#20b2aa\n|darkcyan\n|style="background:#008b8b; color:#ffffff; font-family:monospace;"|#008b8b\n|-\n|teal\n|style="background:#008080; color:#ffffff; font-family:monospace;"|#008080\n|lavender\n|style="background:#e6e6fa; font-family:monospace;"|#e6e6fa\n|-\n|thistle\n|style="background:#d8bfd8; font-family:monospace;"|#d8bfd8\n|plum\n|style="background:#dda0dd; font-family:monospace;"|#dda0dd\n|-\n|violet\n|style="background:#ee82ee; font-family:monospace;"|#ee82ee\n|fuchsia\n|style="background:#ff00ff; font-family:monospace;"|#ff00ff\n|-\n|magenta\n|style="background:#ff00ff; font-family:monospace;"|#ff00ff\n|orchid\n|style="background:#da70d6; font-family:monospace;"|#da70d6\n|-\n|mediumorchid\n|style="background:#ba55d3; font-family:monospace;"|#ba55d3\n|darkorchid\n|style="background:#9932cc; color:#ffffff; font-family:monospace;"|#9932cc\n|-\n|blueviolet\n|style="background:#8a2be2; color:#ffffff; font-family:monospace;"|#8a2be2\n|darkviolet\n|style="background:#9400d3; color:#ffffff; font-family:monospace;"|#9400d3\n|-\n|mediumpurple\n|style="background:#9370db; color:#ffffff; font-family:monospace;"|#9370db\n|slateblue\n|style="background:#6a5acd; color:#ffffff; font-family:monospace;"|#6a5acd\n|-\n|purple\n|style="background:#800080; color:#ffffff; font-family:monospace;"|#800080\n|darkmagenta\n|style="background:#8b008b; color:#ffffff; font-family:monospace;"|#8b008b\n|-\n|darkslateblue\n|style="background:#483d8b; color:#ffffff; font-family:monospace;"|#483d8b\n|indigo\n|style="background:#4b0082; color:#ffffff; font-family:monospace;"|#4b0082\n|-\n|honeydew\n|style="background:#f0fff0; font-family:monospace;"|#f0fff0\n|mintcream\n|style="background:#f5fffa; font-family:monospace;"|#f5fffa\n|-\n|azure\n|style="background:#f0ffff; font-family:monospace;"|#f0ffff\n|aliceblue\n|style="background:#f0f8ff; font-family:monospace;"|#f0f8ff\n|-\n|ghostwhite\n|style="background:#f8f8ff; font-family:monospace;"|#f8f8ff\n|whitesmoke\n|style="background:#f5f5f5; font-family:monospace;"|#f5f5f5\n|-\n|lavenderblush\n|style="background:#fff0f5; font-family:monospace;"|#fff0f5\n|mistyrose\n|style="background:#ffe4e1; font-family:monospace;"|#ffe4e1\n|-\n|antiquewhite\n|style="background:#faebd7; font-family:monospace;"|#faebd7\n|seashell\n|style="background:#fff5ee; font-family:monospace;"|#fff5ee\n|-\n|snow\n|style="background:#fffafa; font-family:monospace;"|#fffafa\n|white\n|style="background:#ffffff; font-family:monospace;"|#ffffff\n|-\n|beige\n|style="background:#f5f5dc; font-family:monospace;"|#f5f5dc\n|linen\n|style="background:#faf0e6; font-family:monospace;"|#faf0e6\n|-\n|oldlace\n|style="background:#fdf5e6; font-family:monospace;"|#fdf5e6\n|floralwhite\n|style="background:#fffaf0; font-family:monospace;"|#fffaf0\n|-\n|ivory\n|style="background:#fffff0; font-family:monospace;"|#fffff0\n|gainsboro\n|style="background:#dcdcdc; font-family:monospace;"|#dcdcdc\n|-\n|lightgrey\n|style="background:#d3d3d3; font-family:monospace;"|#d3d3d3\n|silver\n|style="background:#c0c0c0; font-family:monospace;"|#c0c0c0\n|-\n|darkgray\n|style="background:#a9a9a9; font-family:monospace;"|#a9a9a9\n|gray\n|style="background:#808080; color:#ffffff; font-family:monospace;"|#808080\n|-\n|dimgray\n|style="background:#696969; color:#ffffff; font-family:monospace;"|#696969\n|darkslategray\n|style="background:#2f4f4f; color:#ffffff; font-family:monospace;"|#2f4f4f\n|-\n|lightslategray\n|style="background:#778899; color:#ffffff; font-family:monospace;"|#778899\n|slategray\n|style="background:#708090; color:#ffffff; font-family:monospace;"|#708090\n|-\n|cornsilk\n|style="background:#fff8dc; font-family:monospace;"|#fff8dc\n|blanchedalmond\n|style="background:#ffebcd; font-family:monospace;"|#ffebcd\n|-\n|bisque\n|style="background:#ffe4c4; font-family:monospace;"|#ffe4c4\n|navajowhite\n|style="background:#ffdead; font-family:monospace;"|#ffdead\n|-\n|wheat\n|style="background:#f5deb3; font-family:monospace;"|#f5deb3\n|sandybrown\n|style="background:#f4a460; font-family:monospace;"|#f4a460\n|-\n|goldenrod\n|style="background:#daa520; font-family:monospace;"|#daa520\n|darkgoldenrod\n|style="background:#b8860b; font-family:monospace;"|#b8860b\n|-\n|peru\n|style="background:#cd853f; font-family:monospace;"|#cd853f\n|chocolate\n|style="background:#d2691e; font-family:monospace;"|#d2691e\n|-\n|maroon\n|style="background:#800000; color:#ffffff; font-family:monospace;"|#800000\n|saddlebrown\n|style="background:#8b4513; color:#ffffff; font-family:monospace;"|#8b4513\n|-\n|brown\n|style="background:#a52a2a; color:#ffffff; font-family:monospace;"|#a52a2a\n|sienna\n|style="background:#a0522d; color:#ffffff; font-family:monospace;"|#a0522d\n|-\n|darkred\n|style="background:#8b0000; color:#ffffff; font-family:monospace;"|#8b0000\n|burlywood\n|style="background:#deb887; font-family:monospace;"|#deb887\n|-\n|tan\n|style="background:#d2b48c; font-family:monospace;"|#d2b48c\n|rosybrown\n|style="background:#bc8f8f; font-family:monospace;"|#bc8f8f\n|-\n|black\n|style="background:#000000; color:#ffffff; font-family:monospace;"|#000000\n| \n| \n|}

Web-safe colors

Another set of 216 color values are commonly considered to be the "web-safe" color palette; when the web-safe palette was developed, computer displays were often capable of displaying only 256 colors. A set of colors was needed that could be shown without
dithering on 256-color displays; the number 216 was chosen partly because computer operating systems customarily reserved sixteen to twenty colors for their own use; it was also selected because it allows exactly six shades each of red, green, and blue. (6 × 6 × 6 = 216). The palette was first identified by Lynda Weinman. The "web-safe" colors do not have names, but each can be specified by an RGB triplet. In the table below, a three-digit number is used as a shorthand notation for the six-digit hexadecimal numerals above. The digit "3" is equivalent to the hexadecimal numeral "33"; "C" is equivalent to "CC". For example, "F63" in the table below is equivalent to "#FF6633" in the system used previously. This table shows all of the "web-safe" colors, underlining the really-safe (see next section) colors: \n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n
000\n300\n600\n900\nC00\nF00\n003\n303\n603\n903\nC03\nF03\n
006\n306\n606\n906\nC06\nF06\n009\n309\n609\n909\nC09\nF09\n
00C\n30C\n60C\n90C\nC0C F0C\n00F\n30F\n60F\n90F\nC0F\nF0F\n
030\n330\n630\n930\nC30\nF30\n033\n333\n633\n933\nC33\nF33\n
036\n336 636\n936\nC36\nF36\n039\n339\n639\n939\nC39\nF39\n
03C\n33C\n63C\n93C\nC3C\nF3C\n03F\n33F\n63F\n93F\nC3F\nF3F\n
060\n360\n660\n960\nC60\nF60\n063\n363\n663\n963\nC63\nF63\n
066\n366\n666\n966\nC66\nF66\n069\n369\n669\n969 C69\nF69\n
06C\n36C\n66C\n96C\nC6C\nF6C\n06F\n36F\n66F\n96F\nC6F\nF6F\n
090\n390\n690\n990\nC90\nF90\n093\n393\n693\n993\nC93\nF93\n
096\n396\n696\n996\nC96\nF96\n099\n399\n699\n999\nC99\nF99\n
09C\n39C\n69C\n99C\nC9C\nF9C\n09F\n39F\n69F\n99F\nC9F\nF9F\n
0C0\n3C0\n6C0\n9C0\nCC0\nFC0\n0C3\n3C3\n6C3\n9C3\nCC3\nFC3\n
0C6\n3C6\n6C6\n9C6\nCC6\nFC6\n0C9\n3C9\n6C9\n9C9\nCC9\nFC9\n
0CC\n3CC\n6CC\n9CC\nCCC\nFCC\n0CF\n3CF\n6CF\n9CF\nCCF\nFCF\n
0F0\n3F0\n6F0\n9F0\nCF0\nFF0\n0F3\n3F3\n6F3\n9F3\nCF3\nFF3\n
0F6\n3F6\n6F6\n9F6\nCF6\nFF6\n0F9\n3F9\n6F9\n9F9\nCF9\nFF9\n
0FC\n3FC\n6FC\n9FC\nCFC\nFFC\n0FF\n3FF\n6FF\n9FF\nCFF\nFFF\n
\n

Really web safe colors

Designers are often encouraged to stick to these 216 "web-safe" colors in their websites; however, 8-bit color displays are much less common now than they were when the 216-color palette was developed. David Lehn and Hadley Stern have since discovered that only 22 of the 216 colors in the web-safe palette are reliably displayed without inconsistent remapping on 16-bit computer displays; they called these 22 colors the "really safe" palette; it consists mainly of shades of green and yellow and are the underlined colors in the table above.

CSS Colors

The
Cascading Style Sheets language defines the same number of named colors as the HTML 4 spec, namely the 16 listed above.\nAdditionally, CSS 2.1 adds the 'orange' color name to the list: orange, with value #ffA500. CSS 2 and CSS 2.1 also allow web authors to use so-called system colors, which are color names whose values are taken from the operating system. This enables web authors to style their content in line with the operating system of the user agent. See [1]. As of early 2004, it appears that the CSS3 color module will once again drop these values, marking them deprecated, but this may change: [1]. \n

See also

\n*
RGB color space\n* hexadecimal\n* HTML and CSS\n* color\n* RGB color model And for further examples:\nHex triplets for each color are listed under:\n

External links


"Distrust any enterprise that requires new clothes." - Henry David Thoreau (1817-1862)