Skip to content

Commit ee2446a

Browse files
committed
[css-color-4] Rewrite computed/used colors section and fill in more detail. Fixes w3c#4136, fixes w3c#3843.
1 parent f8393c1 commit ee2446a

File tree

1 file changed

+61
-48
lines changed

1 file changed

+61
-48
lines changed

css-color-4/Overview.bs

Lines changed: 61 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ Editor: Chris Lilley, W3C, chris@w3.org, w3cid 1438
1313
Former Editor: L. David Baron, Mozilla https://www.mozilla.org/, https://dbaron.org/, w3cid 15393
1414
Abstract: This specification describes CSS <<color>> values and properties for foreground color and group opacity.
1515
Repository: w3c/csswg-drafts
16-
Inline Github Issues: title
1716
Ignored Terms: stacking context, double, octet
1817
</pre>
1918

@@ -181,60 +180,74 @@ Notes On Using Colors</h3>
181180
<h2 id='resolving-color-values'>
182181
Resolving Color values</h2>
183182

184-
Various properties accept <<color>> values.
185-
Unless an exception is explicitly defined,
186-
all such properties must <dfn export lt="resolve color values|resolving color values">resolve color values</dfn> as defined below
187-
to determine the <a>computed value</a> and the <a>used value</a> for <<color>>.
188-
189-
<ul>
190-
<li>
191-
If ''<color>/currentcolor'' is the specified value of the 'color' property,
192-
it is treated as if the specified value was ''inherit''.
193-
194-
For all other properties that accept a <<color>>,
195-
the computed value of the ''<color>/currentcolor'' keyword is ''<color>/currentcolor'',
196-
and the used value of ''<color>/currentcolor'' is the same as
197-
the used value of the 'color' property on the same element.
183+
Unless otherwise specified for a particular property,
184+
[=specified value|specified=] colors are resolved to
185+
<dfn export lt="computed color">[=computed value|computed=] colors</dfn>
186+
and then further to <dfn export lt="used color">[=used value|used=] colors</dfn> as follows:
187+
188+
: ''transparent''
189+
::
190+
The computed and used value is [=transparent black=].
191+
192+
: [=hex colors=]
193+
: ''rgb()'' and ''rgba()'' values
194+
: ''hsl()'' and ''hsla()'' values
195+
: ''hwb()'' values
196+
: [=named colors=]
197+
::
198+
The computed and used value
199+
is the corresponding sRGB color
200+
paired with the specified alpha channel
201+
(defaulting to opaque if unspecified).
202+
203+
: ''lab()'', ''lch()'', and ''gray()'' values
204+
::
205+
The computed and used value
206+
is the corresponding CEI Lab color
207+
paired with the specified alpha channel
208+
(defaulting to opaque if unspecified).
209+
210+
Issue(3844): Does working color space affect these values?
211+
212+
: ''color()'' values
213+
::
214+
The computed and used value
215+
is the color in the specified colorspace,
216+
paired with the specified alpha channel
217+
(defaulting to opaque if unspecified).
218+
219+
: ''device-cmyk()'' values
220+
::
221+
The computed and used value
222+
is the specified device-specific CMYK color,
223+
paired with the specified alpha channel
224+
(defaulting to opaque if unspecified).
225+
226+
The [=actual value=] can vary based on the operation;
227+
for rendering to a CMYK-capable device,
228+
it may be rendered as a CMYK color;
229+
for blending with non-CMYK colors
230+
or rendering to a non-CMYK device,
231+
it must be converted
232+
as specified in [[#cmyk-colors]].
233+
234+
: ''currentcolor''
235+
::
236+
The ''currentcolor'' keyword computes to itself.
237+
238+
In the 'color' property,
239+
its used value is the [=inherited value=].
240+
In any other property,
241+
its used value is the used value of the 'color' property on the same element.
198242

199243
Note: This means that if the ''<color>/currentcolor'' value is inherited,
200244
it’s inherited as a keyword,
201245
not as the value of the 'color' property,
202246
so descendants will use their own 'color' property to resolve it.
203247

204-
<li>
205-
The computed value and used value of ''<color>/transparent'' is ''rgba(0, 0, 0, 0)''.
206-
207-
Issue(3844):
208-
<!-- needs WPT test -->
209-
210-
<li>
211-
The computed value and used value of
212-
<a>named colors</a> (including <<system-color>> colors),
213-
3 and 6 digits <a>hex colors</a>,
214-
4 and 8 digits <a>hex colors</a> with an explicitly opaque alpha channel,
215-
comma separated ''rgb()'' colors without an alpha channel,
216-
comma separated ''rgba()'' colors with an explicitly opaque alpha channel,
217-
comma separated ''hsl()'' colors without an alpha channel,
218-
and comma separated ''hsla()'' colors with an explicitly opaque alpha channel,
219-
is the equivalent numeric value in comma separated ''rgb()'' notation omitting the alpha value.
220-
221-
<li>
222-
The computed value and used value of
223-
4 and 8 digits <a>hex colors</a> with a non opaque alpha channel,
224-
comma separated ''rgba()'' colors with a non opaque alpha channel,
225-
and comma separated ''hsla()'' colors with a non opaque alpha channel,
226-
is the equivalent numeric value in comma separated ''rgba()'' notation with the alpha value.
227-
228-
</ul>
229-
230-
Issue(3843):
231-
232-
Issue(3844):
233-
234-
Issue(3845):
248+
The [=resolved value=] of a <<color>> is its [=used value=].
235249

236-
Any future specification extending the syntax of <<color>>
237-
must define the how to <a>resolve color values</a> for the new extensions.
250+
Issue(3845): When should channel-clamping occur?
238251

239252
<h2 id='numeric-rgb'>
240253
RGB Colors</h2>

0 commit comments

Comments
 (0)