Skip to content

Commit ae086a2

Browse files
committed
[css-color-5] Clarify resolved values of color-contrast() with currentColor; add resolved section for color-mix(). See #6168
1 parent f6b54ba commit ae086a2

File tree

1 file changed

+20
-7
lines changed

1 file changed

+20
-7
lines changed

css-color-5/Overview.bs

+20-7
Original file line numberDiff line numberDiff line change
@@ -2380,8 +2380,13 @@ or any other color or monochrome output device which has been characterized.
23802380
with each <<color>> parameter resolved according to [[css-color-4#resolving-color-values]],
23812381
and the keywords ''AA'', ''AA-large'', ''AAA'', ''AAA-large'' replaced with their corresponding numeric value.
23822382

2383-
The used value is the winning color
2383+
If all <<color>> parameters resolve
2384+
to the corresponding colors in their respective color spaces,
2385+
the used value is the winning color
23842386
resolved according to [[css-color-4#resolving-color-values]].
2387+
Otherwise (if ''currentColor'' was used in the function),
2388+
the used value is the same as the computed value
2389+
thus preserving inheritance into child elements.
23852390

23862391
<div class="example">
23872392

@@ -2393,19 +2398,27 @@ or any other color or monochrome output device which has been characterized.
23932398
color-contrast(currentColor vs hsl(200 83% 23%), purple to AA)
23942399
</pre>
23952400

2396-
has the computed value
2401+
has the computed and used value
23972402

23982403
<pre class="lang-css">
23992404
color-contrast(currentColor vs rgb(10 75 107), rgb(128 0 128) to 4.5)
24002405
</pre>
24012406

2402-
and the used value
2407+
</div>
24032408

2404-
<pre class="lang-css">
2405-
rgb(128 0 128)
2406-
</pre>
2409+
<h3 id="resolving-mix">Resolving ''color-mix()'' values</h3>
24072410

2408-
</div>
2411+
The computed value is the specified ''color-mix()'' function
2412+
with each <<color>> parameter resolved according to [[css-color-4#resolving-color-values]].
2413+
2414+
If all <<color>> parameters resolve
2415+
to the corresponding colors in their respective color spaces,
2416+
the used value is the mixed color,
2417+
in the specified mixing color space,
2418+
resolved according to [[css-color-4#resolving-color-values]].
2419+
Otherwise (if ''currentColor'' was used in the function),
2420+
the used value is the same as the computed value
2421+
thus preserving inheritance into child elements.
24092422

24102423

24112424

0 commit comments

Comments
 (0)