|
1 | 1 | <!DOCTYPE HTML SYSTEM "http://www.w3.org/TR/WD-html40/sgml/HTML4.dtd"> |
2 | 2 | <html lang="en"> |
3 | | -<!-- $Id: colors.src,v 1.10 1997-09-07 00:31:08 ian Exp $ --> |
| 3 | +<!-- $Id: colors.src,v 1.11 1997-09-08 02:52:07 ian Exp $ --> |
4 | 4 | <HEAD> |
5 | 5 | <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"> |
6 | 6 | <TITLE>Colors and backgrounds</TITLE> |
|
11 | 11 | <BODY> |
12 | 12 | <H1 align="center"><a name="colors">Colors</a> and <a name="backgrounds">backgrounds</a></H1> |
13 | 13 |
|
14 | | -<H2><a name="color-units">Color Units</a></H2> |
15 | | - |
16 | | -A <span class="index-def" title="<color>, definition of"><a |
17 | | -name="value-def-color" class="value-def"><color></a></span> |
18 | | -is a either a keyword or a numerical RGB specification. |
19 | | - |
20 | | -<P> The suggested list of keyword color names is: aqua, black, blue, |
21 | | -fuchsia, gray, green, lime, maroon, navy, olive, purple, red, silver, |
22 | | -teal, white, and yellow. These 16 colors are taken from the Windows |
23 | | -VGA palette, and their RGB values are not defined in this |
24 | | -specification. |
25 | | - |
26 | | -<PRE> |
27 | | - BODY {color: black; background: white } |
28 | | - H1 { color: maroon } |
29 | | - H2 { color: olive } |
30 | | -</PRE> |
31 | | - <P> |
32 | | - The RGB color model is being used in numerical color specifications. These |
33 | | - examples all specify the same color: |
34 | | - <PRE> |
35 | | - EM { color: #f00 } /* #rgb */ |
36 | | - EM { color: #ff0000 } /* #rrggbb */ |
37 | | - EM { color: rgb(255,0,0) } /* integer range 0 - 255 */ |
38 | | - EM { color: rgb(100%, 0%, 0%) } /* float range 0.0% - 100.0% */ |
39 | | -</PRE> |
40 | | - |
41 | | -<P> The format of an RGB value in hexadecimal notation is a '#' |
42 | | -immediately followed by either three or six hexadecimal |
43 | | -characters. The three-digit RGB notation (#rgb) is converted into |
44 | | -six-digit form (#rrggbb) by replicating digits, not by adding |
45 | | -zeros. For example, #fb0 expands to #ffbb00. This makes sure that |
46 | | -white (#ffffff) can be specified with the short notation (#fff) and |
47 | | -removes any dependencies on the color depth of the display. |
48 | | - |
49 | | -<P> The format of an RGB value in the functional notation is 'rgb(' |
50 | | -followed by a comma-separated list of three numerical values (either |
51 | | -three integer values in the range of 0-255, or three percentage values |
52 | | -in the range of 0.0% to 100.0%) followed by ')'. Whitespace characters |
53 | | -are allowed around the numerical values. |
54 | | - |
55 | | -<P> Values outside the numerical ranges should be clipped. The three |
56 | | -rules below are therefore equivalent: |
57 | | - |
58 | | -<PRE> |
59 | | - EM { color: rgb(255,0,0) } /* integer range 0 - 255 */ |
60 | | - EM { color: rgb(300,0,0) } /* clipped to 255 */ |
61 | | - EM { color: rgb(110%, 0%, 0%) } /* clipped to 100% */ |
62 | | -</PRE> |
63 | | - |
64 | | -<P> RGB colors are specified in the sRGB color space |
65 | | -<a rel="biblioentry" href="./refs.html#ref-SRGB">[SRGB]</a> |
66 | | -UAs may vary in the fidelity with which they |
67 | | -represent these colors, but use of sRGB provides an unambiguous and |
68 | | -objectively measurable definition of what the color should be, which |
69 | | -can be related to international standards <a rel="biblioentry" href="./refs.html#ref-COLORIMETRY">[COLORIMETRY]</a>. |
70 | | - |
71 | | -<P> UAs may limit their efforts in displaying colors to performing a |
72 | | -gamma-correction on them. sRGB specifies a display gamma of 2.2 under |
73 | | -specified viewing conditions. UAs adjust the colors given in CSS such |
74 | | -that, in combination with an output device's "natural" display gamma, |
75 | | -an effective display gamma of 2.2 is produced. See the section on <a |
76 | | -href="notes.html#gamma-correction">gamma correction</a> for further |
77 | | -details. Note that only colors specified in CSS are affected; e.g., |
78 | | -images are expected to carry their own color information. |
79 | | - |
80 | 14 | <H2>Color and background properties</H2> |
81 | 15 |
|
82 | 16 | <P> These properties describe the color (often called <EM>foreground |
|
0 commit comments