@@ -95,61 +95,40 @@ For example, to specify lime green:
9595 to how ''<color>/currentcolor'' value works.
9696
9797<h2 id='color-type'>
98- Representing sRGB Colors: the <<color>> type</h2>
98+ Representing Colors: the <<color>> type</h2>
9999
100- CSS colors in the sRGB color space are represented by a triplet of values--
101- red, green, and blue--
102- identifying a point in the sRGB color space [[!SRGB]] .
103- This is an internationally-recognized, device-independent color space,
104- and so is useful for specifying colors that will be displayed on a computer screen,
105- but is also useful for specifying colors on other types of devices, like printers.
106- (See [[COLORIMETRY]] .)
107- Additionally, every color is accompanied by an alpha component,
108- indicating how transparent it is,
109- and thus how much of the backdrop one can see behind the color.
110- The components are also sometimes called "channels".
100+ CSS has several syntaxes for specifying color values.
101+ Some directly specify an sRGB color by its channels,
102+ such as the [=hex color notation=] or ''rgb()'' function.
103+ Others are more human-friendly to write and understand,
104+ such as the ''hsl()'' and ''lch()'' functions,
105+ or the long list of [=named colors=] .
106+
107+ Colors are represented as a list of components,
108+ also sometimes called “channels”,
109+ representing axises in the color space.
111110 Each channel has a minimum and maximum value,
112111 and can take any value between those two.
112+ Additionally, every color is accompanied by
113+ an <dfn lt="alpha channel | alpha component" export>alpha component</dfn> ,
114+ indicating how transparent it is,
115+ and thus how much of the backdrop one can see behind the color.
113116
114- While all colors share an underlying storage format,
115- <!-- that is unlikely to be the case in future, with half floats etc being added to the OM -->
116- CSS contains several syntaxes for <em> specifying</em> <<color>> values.
117- Some directly specify the sRGB color,
118- such as the ''rgb()'' and ''rgba()'' functions
119- and the hex notation.
120- Others are more human-friendly to write and understand,
121- and are converted to an sRGB color by CSS,
122- such as the ''hsl()'' and ''hsla()'' functions,
123- or the long list of named colors defined by CSS.
124-
125- In total, the definition of <<color>> is:
117+ Colors in CSS are represented by the <dfn><<color>></dfn> type:
126118
127119 <pre class='prod'>
128- <dfn><color></dfn> = <<rgb()>> | <<rgba()>> | <<hsl()>> | <<hsla()>> |
129- <<hwb()>> | <<gray()>> | <<device-cmyk()>> |
130- <<hex-color>> | <<named-color>> | currentcolor |
120+ <color> = <<hex-color>> | <<named-color>> | currentcolor | transparent
121+ <<rgb()>> | <<rgba()>> | <<hsl()>> | <<hsla()>> | <<hwb()>> |
122+ <<lab()>> | <<lch()>> | <<gray()>> |
123+ <<color()>> | <<device-cmyk()>> |
131124 <<system-color>>
132125 </pre>
133126
134- Some operations work differently on <dfn export>achromatic</dfn> colors.
135- An <a>achromatic</a> color is a shade of gray:
136- in the sRGB colorspace,
137- a color is <a>achromatic</a> if the red, green, and blue channels are all the same value;
138- in the HSL colorspace,
139- a color is <a>achromatic</a> if the saturation is ''0%'' ;
140- in the HWB colorspace,
141- a color is <a>achromatic</a> if the sum of the whiteness and blackness is at least ''100%'' .
142-
143127 For easy reference in other specifications,
144- <dfn export>opaque black</dfn> is an sRGB color
145- with the red, green, and blue components all at their minimum value,
146- and the alpha component at its maximum value
147- (the same color as produced by ''rgb(0 0 0 / 100%)'' ).
148- <dfn export>Transparent black</dfn> is the same color,
149- but with the alpha component at the minimum instead
150- (the same color as produced by ''rgb(0 0 0 / 0%)'' ).
151-
152-
128+ <dfn export>opaque black</dfn> is defined as the color <nobr> ''rgb(0 0 0 / 100%)'' </nobr> ;
129+ <dfn export>transparent black</dfn> is the same color,
130+ but fully transparent--
131+ i.e. <nobr> ''rgb(0 0 0 / 0%)'' </nobr> .
153132
154133<h3 id="notes">
155134Notes On Using Colors</h3>
@@ -256,7 +235,22 @@ Resolving Color values</h2>
256235<h2 id='numeric-rgb'>
257236RGB Colors</h2>
258237
259- There are several methods of directly specifying an sRGB color in terms of its RGBA channels.
238+ CSS colors in the sRGB color space are represented by a triplet of values--
239+ red, green, and blue--
240+ identifying a point in the sRGB color space [[!SRGB]] .
241+ This is an internationally-recognized, device-independent color space,
242+ and so is useful for specifying colors that will be displayed on a computer screen,
243+ but is also useful for specifying colors on other types of devices, like printers.
244+ (See [[COLORIMETRY]] .)
245+
246+ CSS provides several methods of directly specifying an sRGB color:
247+ [=hex colors=] ,
248+ ''rgb()'' /''rgba()'' notation,
249+ ''hsl()'' /''hsla()'' notation,
250+ ''hwb()'' notation,
251+ [=named colors=] ,
252+ and the ''transparent'' keyword.
253+
260254
261255<h3 id='rgb-functions'>
262256The RGB functions: ''rgb()'' and ''rgba()''</h3>
@@ -311,7 +305,8 @@ The RGB functions: ''rgb()'' and ''rgba()''</h3>
311305<h3 id='hex-notation'>
312306The RGB hexadecimal notations: ''#RRGGBB''</h3>
313307
314- The CSS <dfn export>hex color</dfn> notation allows a color to be specified by giving the channels as hexadecimal numbers,
308+ The CSS <dfn lt="hex color | hex color notation" export>hex color notation</dfn>
309+ allows a color to be specified by giving the channels as hexadecimal numbers,
315310 which is similar to how colors are often written directly in computer code.
316311 It's also shorter than writing the same color out in ''rgb()'' notation.
317312
0 commit comments