Sunteți pe pagina 1din 8

Web colors - Wikipedia, the free encyclopedia Log in / create account

Article Discussion

Read Edit View history

Search

Web colors
From Wikipedia, the free encyclopedia Main page Contents Featured content Current events Random article Donate to Wikipedia Interaction Help About Wikipedia Community portal Recent changes Contact Wikipedia Toolbox Print/export Languages Aragons Azrbaycanca Catal Dansk Deutsch Espaol Euskara Franais Bahasa Indonesia Basa Jawa Lumbaart Magyar Bahasa Melayu Polski Portugus Romn Shqip Simple English Slovenina Svenska Nederlands Contents 1 Hex triplet 1.1 Converting RGB to hexadecimal 2 HTML color names 3 X11 color names 4 Web-safe colors 4.1 Color table 4.2 Safest web colors 5 CSS colors 6 Accessibility 7 See also 8 References 9 External links
This box: view talk edit

Web colors are colors used in designing web pages, and the methods for describing and specifying those colors. Hexadecimal color codes begin with a hash (#). [1][2] 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. Often a color tool or other graphics software is used to generate color values. 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. [3] Web colors have an unambiguous colorimetric definition, sRGB, which relates the chromaticities of a particular phosphor set, a given transfer curve, adaptive whitepoint, and viewing conditions. [4] These have been chosen to be similar to many real-world monitors and viewing conditions, so that even without color management rendering is fairly close to the specified values. However, user agents vary in the fidelity with which they represent the specified colors. More advanced user agents use color management to provide better color fidelity; this is particularly important for Web-to-print applications.

HTML HTML and HTML5 Dynamic HTML XHTML XHTML Mobile Profile and C-HTML Canvas element Character encodings Document Object Model Font family HTML editor HTML element HTML Frames HTML5 video HTML scripting Web browser engine Quirks mode Style sheets Unicode and HTML W3C and WHATWG Web colors Web Storage Comparison of document markup languages web browsers layout engines for HTML HTML5 HTML5 Canvas HTML5 Media Non-standard HTML XHTML (1.1)

Hex triplet

[edit]

Norsk (bokml)

A hex triplet is a six-digit, three-byte hexadecimal number used in HTML, CSS, SVG, and other computing applications, to represent colors. The bytes represent the red, green and blue components of the color. One byte represents a number in the range 00 to FF (in hexadecimal notation), or 0 to 255 in decimal notation. This represents the least (0) to the most (255) intensity of each of the color components. Thus web colors specify colors in the Truecolor (24-bit RGB) color scheme. The hex triplet is formed by concatenating three bytes in hexadecimal notation, in the following order: Byte 1: red value (color type red) Byte 2: green value (color type green) Byte 3: blue value (color type blue)

http://en.wikipedia.org/wiki/Web_colors[11/13/2011 5:02:48 PM]

Web colors - Wikipedia, the free encyclopedia

Trke

For example, consider the color where the red/green/blue values are decimal numbers: red=36, green=104, blue=160 (a greyish-blue color). The decimal numbers 36, 104 and 160 are equivalent to the hexadecimal numbers 24, 68 and A0 respectively. The hex triplet is obtained by concatenating the 6 hexadecimal digits together, 2468A0 in this example. Note that if any one of the three color values is less than 16 (decimal) or 10 (hex), it must be represented with a leading zero so that the triplet always has exactly six digits. For example, the decimal triplet 4, 8, 16 would be represented by the hex digits 04, 08, 10, forming the hex triplet 040810. The number of colors that can be represented by this system is 256 256 256 = 16,777,216. An abbreviated, three (hexadecimal) digit form is sometimes used.[5] Expanding this form to the six-digit form is as simple as doubling each digit: 09C becomes 0099CC. This allows each color value to cover its full range from 00 to FF. The three-digit form is described in the CSS specification, not in HTML. As a result, the three digit form in an attribute other than "style" is not interpreted as a valid color in some browsers.

Converting RGB to hexadecimal


See also: Hexadecimal#Converting from other bases

[edit]

RGB values are usually given in the 0255 range; if they are in the 01 range, the values are multiplied by 255 before conversion. This number divided by 16 (integer division; ignoring any remainder) gives us the first hexadecimal digit (between 0 and F, where the letters A to F represent the numbers 10 to 15. See hexadecimal for more details). The remainder gives us the second hexadecimal digit. For instance the RGB value 201 divides into 12 groups of 16, thus the first digit is C. A remainder of 9 gives us the hexadecimal number C9. This process is repeated for each of the three color values. Conversion between number bases is a common feature of calculators, including both hand-held models and the software calculators bundled with most modern operating systems. Web-based tools specifically for converting color values are also available.[6]

HTML color names


Main article: HTML color names

[edit]

The HTML 4.01 specification [7] defines sixteen named colors, as follows (names are defined in this context to be case-insensitive): CSS 12.0 / HTML 3.24 / VGA color names Hex Red triplet 100% 75% 50% 0% 100% 50% 100% 50% 0% CGA number (name); alias

Name

Green

Blue

Hue

Satur

Light

Satur

Value

White Silver Gray Black Red Maroon Yellow Olive Lime

#FFFFFF

100% 75% 50% 0% 0% 0% 100% 50% 100%

100% 75% 50% 0% 0% 0% 0% 0% 0%

0 0 0 0 0 0 60 60 120

0% 0% 0% 0% 100% 100% 100% 100% 100%

100% 75% 50% 0% 50% 25% 50% 25% 50%

0% 0% 0% 0% 100% 100% 100% 100% 100%

100% 15 (white) 75% 50% 0% 100% 50% 7 (light gray) 8 (dark gray) 0 (black) 12 (high red) 4 (low red)

#C0C0C0

#808080

#000000

#FF0000

#800000

#FFFF00 #808000

100% 14 (yellow) 50% 6 (brown)

#00FF00

10 (high 100% green); green 50% 2 (low

Green

#008000

0%

50%

0%

120

100%

25%

100%

http://en.wikipedia.org/wiki/Web_colors[11/13/2011 5:02:48 PM]

Web colors - Wikipedia, the free encyclopedia

green) Aqua 0% 100% 100% 180 100% 50% 100% 11 (high 100% cyan); cyan 50% 100% 50% 3 (low cyan) 9 (high blue) 1 (low blue)

#00FFFF

Teal Blue Navy

#008080

0% 0% 0%

50% 0% 0%

50% 100% 50%

180 240 240

100% 100% 100%

25% 50% 25%

100% 100% 100%

#0000FF

#000080

Fuchsia

#FF00FF

100%

0%

100%

300

100%

50%

100%

13 (high 100% magenta); magenta 50% 5 (low magenta)

Purple

#800080

50%

0%

50%

300

100%

25%

100%

These 16 were labelled as sRGB and included in the HTML 3.0 specification, which noted they were "the standard 16 colors supported with the Windows VGA palette." [8]

X11 color names


Main article: X11 color names

[edit]

In addition, a number of colors are defined by web browsers. A particular browser may not recognize all of these colors, but as of 2005 all modern general-use browsers support the full list of colors. Many of these colors are from the list of X11 color names distributed with the X Window System. These colors were standardized by SVG 1.0, and are accepted by SVG Full user agents. They are not part of SVG Tiny. The list of colors actually shipped with the X11 product varies between implementations, and clashes with certain of the HTML names such as green. Furthermore, X11 colors are defined as simple RGB (hence, no particular color space), rather than sRGB. This means that the list of colors found in X11 (e.g. in /usr/lib/X11/rgb.txt) should not directly be used to choose colors for the web. [9] The list of web "X11 colors" from the CSS3 specification, along with their hexadecimal and decimal equivalents, is shown below, compare the alphabetical lists in the W3C standards. Note that this includes the common synonyms: aqua (HTML4/CSS 1.0 standard name) and cyan (common sRGB name), magenta (common sRGB name) and fuchsia (HTML4/CSS 1.0 standard name), gray (HTML4/CSS 1.0 standard name) and grey. [10][11]
Hex HTML name code R G B Decimal code R G B HTML name Hex code R G B Decimal code R G B HTML name Hex code R G B Decimal code R G B

Red colors
IndianRed LightCoral Salmon DarkSalmon LightSalmon Red Crimson FireBrick DarkRed
CD 5C 5C 205 92 92

Green colors
GreenYellow Chartreuse LawnGreen Lime LimeGreen PaleGreen LightGreen MediumSpringGreen SpringGreen MediumSeaGreen
FF C0 CB 255 192 203 FF B6 C1 255 182 193 AD FF 2F 173 255 7F FF 00 127 255 7C FC 00 124 252 00 FF 00 32 CD 32 0 255 50 205 47 0 0 0 50

Brown colors
Cornsilk BlanchedAlmond Bisque NavajoWhite Wheat BurlyWood Tan RosyBrown SandyBrown Goldenrod DarkGoldenrod Peru
FF F8 DC 255 248 220 FF EB CD 255 235 205 FF E4 C4 255 228 196 FF DE AD 255 222 173 F5 DE B3 245 222 179 DE B8 87 222 184 135 D2 B4 8C 210 180 140 BC 8F 8F 188 143 143 F4 A4 60 244 164 DA A5 20 218 165 B8 86 0B 184 134 CD 85 3F 205 133 96 32 11 63

F0 80 80 240 128 128 FA 80 72 250 128 114 E9 96 7A 233 150 122 FF A0 7A 255 160 122 FF 00 00 255 DC 14 3C 220 B2 22 22 178 8B 00 00 139 0 20 34 0 0 60 34 0

98 FB 98 152 251 152 90 EE 90 144 238 144 00 FA 9A 00 FF 7F 3C B3 71 2E 8B 57 22 8B 22 0 250 154 0 255 127 60 179 113 46 139 34 139 87 34

Pink colors
Pink LightPink

SeaGreen ForestGreen

http://en.wikipedia.org/wiki/Web_colors[11/13/2011 5:02:48 PM]

Web colors - Wikipedia, the free encyclopedia HotPink DeepPink MediumVioletRed PaleVioletRed
FF 69 B4 255 105 180 FF 14 93 255 C7 15 85 199 20 147 21 133

Green DarkGreen YellowGreen OliveDrab Olive

00 80 00 00 64 00

0 128 0 100

0 0 50 35 0 47

Chocolate SaddleBrown Sienna Brown Maroon

D2 69 1E 210 105 8B 45 13 139 A0 52 2D 160 A5 2A 2A 165 80 00 00 128 69 82 42 0

30 19 45 42 0

9A CD 32 154 205 6B 8E 23 107 142 80 80 00 128 128 55 6B 2F 85 107

DB 70 93 219 112 147

Orange colors
LightSalmon Coral Tomato OrangeRed DarkOrange Orange
FF A0 7A 255 160 122 FF 7F 50 255 127 FF 63 47 255 FF 45 00 255 99 69 80 71 0 0 0

DarkOliveGreen MediumAquamarine DarkSeaGreen LightSeaGreen DarkCyan Teal

White colors
White Snow Honeydew MintCream Azure AliceBlue
FF FF FF 255 255 255 FF FA FA 255 250 250 F0 FF F0 240 255 240 F5 FF FA 245 255 250 F0 FF FF 240 255 255 F0 F8 FF 240 248 255 F8 F8 FF 248 248 255 F5 F5 F5 245 245 245 FF F5 EE 255 245 238 F5 F5 DC 245 245 220 FD F5 E6 253 245 230 FF FA F0 255 250 240 FF FF F0 255 255 240 FA EB D7 250 235 215 FA F0 E6 250 240 230 FF F0 F5 255 240 245 FF E4 E1 255 228 225

66 CD AA 102 205 170 8F BC 8F 143 188 143 20 B2 AA 00 8B 8B 00 80 80 32 178 170 0 139 139 0 128 128

FF 8C 00 255 140 FF A5 00 255 165

Yellow colors
Gold Yellow LightYellow LemonChiffon LightGoldenrodYellow PapayaWhip Moccasin PeachPuff PaleGoldenrod Khaki DarkKhaki
FF D7 00 255 215 FF FF 00 255 255 0 0

Blue/Cyan colors
Aqua Cyan LightCyan PaleTurquoise Aquamarine Turquoise MediumTurquoise DarkTurquoise CadetBlue SteelBlue LightSteelBlue PowderBlue
E6 E6 FA 230 230 250 D8 BF D8 216 191 216 DD A0 DD 221 160 221 EE 82 EE 238 130 238 DA 70 D6 218 112 214 FF 00 FF 255 FF 00 FF 255 BA 55 D3 186 0 255 0 255 85 211 00 FF FF 00 FF FF 0 255 255 0 255 255

GhostWhite WhiteSmoke Seashell Beige OldLace FloralWhite Ivory AntiqueWhite Linen LavenderBlush MistyRose

FF FF E0 255 255 224 FF FA CD 255 250 205 FA FA D2 250 250 210 FF EF D5 255 239 213 FF E4 B5 255 228 181 FF DA B9 255 218 185 EE E8 AA 238 232 170 F0 E6 8C 240 230 140 BD B7 6B 189 183 107

E0 FF FF 224 255 255 AF EE EE 175 238 238 7F FF D4 127 255 212 40 E0 D0 48 D1 CC 00 CE D1 5F 9E A0 46 82 B4 64 224 208 72 209 204 0 206 209 95 158 160 70 130 180

B0 C4 DE 176 196 222 B0 E0 E6 176 224 230 AD D8 E6 173 216 230 87 CE EB 135 206 235 87 CE FA 135 206 250 00 BF FF 1E 90 FF 0 191 255 30 144 255

Purple colors
Lavender Thistle Plum Violet Orchid Fuchsia Magenta MediumOrchid MediumPurple BlueViolet DarkViolet DarkOrchid DarkMagenta Purple Indigo DarkSlateBlue SlateBlue MediumSlateBlue

Gray colors
Gainsboro LightGrey Silver DarkGray Gray DimGray LightSlateGray SlateGray DarkSlateGray Black
DC DC DC 220 220 220 D3 D3 D3 211 211 211 C0 C0 C0 192 192 192 A9 A9 A9 169 169 169 80 80 80 128 128 128 69 69 69 105 105 105 77 88 99 119 136 153 70 80 90 112 128 144 2F 4F 4F 00 00 00 47 0 79 0 79 0

LightBlue SkyBlue LightSkyBlue DeepSkyBlue DodgerBlue CornflowerBlue RoyalBlue Blue MediumBlue DarkBlue Navy MidnightBlue

64 95 ED 100 149 237 41 69 E1 00 00 FF 00 00 CD 00 00 8B 00 00 80 19 19 70 65 105 225 0 0 0 0 25 0 255 0 205 0 139 0 128 25 112

93 70 DB 147 112 219 8A 2B E2 138 94 00 D3 148 99 32 CC 153 8B 00 8B 139 80 00 80 128 4B 00 82 48 3D 8B 75 72 43 226 0 211 50 204 0 139 0 128 0 130 61 139 90 205

6A 5A CD 106

7B 68 EE 123 104 238

Web-safe colors
At one time many computer displays were only capable of displaying 256 colors. These
Color depth

[edit]

http://en.wikipedia.org/wiki/Web_colors[11/13/2011 5:02:48 PM]

Web colors - Wikipedia, the free encyclopedia

may be dictated by the hardware or changeable by a "color table". When a color is found (e.g., in an image) that is not one available, a different one has to be used. This can be either using the closest color (fast) or dithering (slow, looks better). There were various attempts to make a "standard" color palette. 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 equally-spaced shades of red, green, and blue (6 6 6 = 216), each from 00 to FF (including both limits).

1-bit monochrome 8-bit grayscale 8-bit color 15/16-bit color (High color) 24-bit color (True color) 30/36/48-bit color (Deep color) Related Indexed color Palette RGB color model Web-safe color

The list of colors is often presented as if it has special properties that render them immune to dithering. In fact, on 256-color displays applications can set a palette of any This box: view talk edit selection of colors that they choose, dithering the rest. These colors were chosen specifically because they matched the palettes selected by the then leading browser applications. Fortunately, there were not radically different palettes in use in different popular browsers. [citation needed] "Web-safe" colors had a flaw in that, on systems such as X11 where the palette is shared between applications, smaller color cubes (555 or 444) were often allocated by browsersthus, the "web safe" colors would actually dither on such systems. Better results were obtained by providing an image with a larger range of colors and allowing the browser to quantize the color space if needed, rather than suffer the quality loss of a double quantization. As of 2011, personal computers typically [12] have 24-bit (TrueColor) and the use of "web-safe" colors has fallen into practical disuse. Even mobile devices have at least 16-bit color, driven by the inclusion of cameras on cellphones. The "web-safe" colors do not all have standard names, but each can be specified by an RGB triplet: each component (red, green, and blue) takes one of the six values from the following table (out of the 256 possible values available for each component in full 24-bit color). 6 shades of each color Key 0 3 6 9 Hex Decimal Fraction 00 33 66 99 0 51 102 153 204 255 0 0.2 0.4 0.6 0.8 1

C or (12) CC F or (15) FF

The following table shows all of the "web-safe" colors, underlining the really-safe colors. (One shortcoming of the web-safe palette is its poor selection of light background colors.) The intensities at the low end of the range, especially the two darkest, are often hard to distinguish.

Color table

[edit]

In the table below, each color code listed is a short-hand for the RGB value; for example, code 609 is equivalent to RGB code 102-0-153 or HEX code #660099. Web-Safe Colors *000* *003* 006 009 00C *00F* 030 033 036 039 300 303 306 309 30C 30F 330 333 336 339 600 603 606 609 60C 60F 630 633 636 639 900 903 906 909 90C 90F 930 933 936 939 C00 C03 C06 C09 C0C C0F C30 C33 C36 C39 *F00* *F03* F06 F09 F0C *F0F* F30 F33 F36 F39

http://en.wikipedia.org/wiki/Web_colors[11/13/2011 5:02:48 PM]

Web colors - Wikipedia, the free encyclopedia

03C 03F 060 063 066 069 06C 06F 090 093 096 099 09C 09F 0C0 0C3 0C6 0C9 0CC 0CF *0F0* 0F3 *0F6* 0F9 *0FC* *0FF*

33C 33F 360 363 366 369 36C 36F 390 393 396 399 39C 39F 3C0 3C3 3C6 3C9 3CC 3CF 3F0 *3F3* *3F6* 3F9 *3FC* *3FF*

63C 63F 660 663 666 669 66C 66F 690 693 696 699 69C 69F 6C0 6C3 6C6 6C9 6CC 6CF *6F0* *6F3* 6F6 6F9 6FC *6FF*

93C 93F 960 963 966 969 96C 96F 990 993 996 999 99C 99F 9C0 9C3 9C6 9C9 9CC 9CF 9F0 9F3 9F6 9F9 9FC 9FF

C3C C3F C60 C63 C66 C69 C6C C6F C90 C93 C96 C99 C9C C9F CC0 CC3 CC6 CC9 CCC CCF CF0 CF3 *CF6* CF9 CFC CFF

F3C F3F F60 F63 F66 F69 F6C F6F F90 F93 F96 F99 F9C F9F FC0 FC3 FC6 FC9 FCC FCF *FF0* *FF3* *FF6* FF9 FFC *FFF* [edit]

Safest web colors

Designers were often encouraged to stick to these 216 "web-safe" colors in their websites; however, 8-bit color displays were much more common when the 216-color palette was developed than they are now. 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, as can be seen in the table above, where the "really safe" colors are underlined. [13]

CSS colors
16 listed previously. Additionally, CSS 2.1 adds the 'orange' color name to the list[14] : Colors added in CSS 2.1 Name orange Hex Red triplet
#FFA500

[edit]

The Cascading Style Sheets language defines the same number of named colors as the HTML 4 spec, namely the

Green 65%

Blue 0%

Hue 39

Satur 100%

Light 50%

Satur %

Value %

Alias

100%

CSS 2, SVG 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. [15] As of early 2004, it appears that the CSS3 color module will once again drop these values, marking them deprecated, but this may change. [16] The developing CSS3 specification will also introduce HSL color space values to style sheets:

http://en.wikipedia.org/wiki/Web_colors[11/13/2011 5:02:48 PM]

Web colors - Wikipedia, the free encyclopedia

/* RGB model */ p { color: #F00 } /* #rgb */ p { color: #FF0000 } /* #rrggbb */ p { color: rgb(255, 0, 0) } /* integer range 0 - 255 */ p { color: rgb(100%, 0%, 0%) } /* float range 0.0% - 100.0% */

/* RGB with alpha channel, added to CSS3 */ p { color: rgba(255, 0, 0, 0.5) } /* 0.5 opacity, semi - transparent */

/* HSL model, added to CSS3 */ p { color: hsl(0, 100%, 50%) } /* red */ p { color: hsl(120, 100%, 50%) } /* green */ p { color: hsl(120, 100%, 25%) } /* dark green */ p { color: hsl(120, 100%, 75%) } /* light green */ p { color: hsl(120, 50%, 50%) } /* pastel green */

/* HSL model with alpha channel p { color: hsla(120, 100%, 50%, p { color: hsla(120, 100%, 50%, p { color: hsla(120, 100%, 50%,

*/ 1) } /* green */ 0.5) } /* semi - transparent green */ 0.1) } /* very transparent green */

Accessibility

[edit]

Some browsers and devices do not support colors. For these blind and colorblind users, Web content depending on colors can be unusable or difficult to use. Both foreground and background color should be modified to avoid black on black effects.[17] Similarly, most browsers show links as shades of blue by default; therefore, dark background colors, such as blue or navy, do not display well for such links.

See also
Color tool List of colors List of color palettes CIE 1931 XYZ color space CIE L*a*b* color space Wide Gamut RGB color space ProPhoto RGB Adobe RGB color space scRGB sRGB RGB color space
Color portal

[edit]

Computer graphics portal

References
1. ^ Niederst Robbins, Jennifer. Web Design in a Nutshell, p. 103. 2. ^ York, Richard. Beginning CSS, pp. 7172. 3. ^ Guide to Graphics . SP LUS, splus.com. Page 13. 4. ^ Digital Color Imaging Handbook By Gaurav Sharma. ISBN 084930900X 5. ^ CSS3 color module 6. ^ RGB to Hexadecimal Color Converter 7. ^ HTML 4.01 Specification section 6.5 "Colors" 8. ^ HTML 3.2 Specification "The BODY element" 9. ^ Public discussion on SVG mailing list Re: color names

[edit]
in SVG-1.0 conflict with /usr/lib/X11/rgb.txt 10. ^ W3C TR CSS3 Color Module, SVG color keywords 11. ^ W3C TR SVG 1.0, recognized color keyword names 12. ^ http://www.w3schools.com/browsers/browsers_display.as 13. ^ Death of the Websafe Color Palette? 14. ^ "CSS 2.1 Specification: Syntax and basic data types: Colors" . 2009-09-08. Retrieved 2009-12-21. 15. ^ User interface - System colors 16. ^ CSS3 Color Module - CSS2 System Colors 17. ^ If You Pick One Color, Pick Them All

External links
4,096 Web-Safe Colors CSS2.1 Color Specification

[edit]

http://en.wikipedia.org/wiki/Web_colors[11/13/2011 5:02:48 PM]

Web colors - Wikipedia, the free encyclopedia

Sortable Table of X11 Colors Web colors at the Open Directory Project X11/browser colors, with closest web-safe equivalents Color hex codes with rgb chart graph
vde vde

Web colors Color topics

[show] [show]

Categories: Color

Web development

Web design

This page was last modified on 10 November 2011 at 18:15. Text is available under the Creative Commons Attribution-ShareAlike License; additional terms may apply. See Terms of use for details. Wikipedia is a registered trademark of the Wikimedia Foundation, Inc., a non-profit organization. Contact us Privacy policy About Wikipedia Disclaimers Mobile view

http://en.wikipedia.org/wiki/Web_colors[11/13/2011 5:02:48 PM]

S-ar putea să vă placă și