Skip to content

Commit 1ccd616

Browse files
authored
[css-color-5] Simplify contrast-color(), per WG resolution. #11534 (#11654)
1 parent affbded commit 1ccd616

File tree

1 file changed

+7
-13
lines changed

1 file changed

+7
-13
lines changed

css-color-5/Overview.bs

Lines changed: 7 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -2606,23 +2606,17 @@ or any other color or monochrome output device which has been characterized.
26062606
the surrounding colors, etc.
26072607

26082608
<pre class='prod'>
2609-
<dfn export>contrast-color()</dfn> = contrast-color( <<color>> max? )
2609+
<dfn export>contrast-color()</dfn> = contrast-color( <<color>> )
26102610
</pre>
26112611

2612-
If ''max''' is specified, the function computes to ''white'' or ''black'',
2613-
depending on which of the two produces _maximum_ color contrast for text when the input color is used as a solid background.
2614-
If both colors produce the same contrast, the function should return ''white''.
2615-
2616-
If ''max''' is omitted, the function computes to a <em>very light</em> or <em>very dark</em> color (which <em>may</em> still be white or black),
2617-
which will contrast well with the input color when used as a text color and the input color is used as a solid background.
2618-
The function MUST return a light color if it would have returned ''white'' if ''max'' were specified,
2619-
and a dark color if it would have returned ''black'' if ''max'' were specified.
2620-
2621-
Note: The precise requirement for how close these colors need to be to white and black
2622-
and what color difference measure to use for that are still under discussion.
2612+
''contrast-color()'' resolves to either ''white'' or ''black'',
2613+
whichever produces <strong>maximum</strong> color contrast for text
2614+
when the input color is used as a solid background.
2615+
If both ''white'' and ''black'' produce the same contrast,
2616+
it resolves to ''white''.
26232617

26242618
The precise color contrast algorithm for determining whether to output a light or dark color
2625-
is UA-defined at this level, as is the precise color produced when ''max''' is omitted.
2619+
is UA-defined at this level.
26262620

26272621
Note: Future versions of this specification are expected to introduce more control over
26282622
both the contrast algorithm(s) used, the use cases, as well as the returned color.

0 commit comments

Comments
 (0)