Skip to content

Commit b860b74

Browse files
LeaVeroufantasai
andcommitted
[css-color-6] Prepare prose for multiple contrast algorithms, see #7357
Co-Authored-By: fantasai <[email protected]>
1 parent b7e5000 commit b860b74

File tree

1 file changed

+13
-3
lines changed

1 file changed

+13
-3
lines changed

css-color-6/Overview.bs

+13-3
Original file line numberDiff line numberDiff line change
@@ -86,14 +86,20 @@ Computing a Contrasting Color: the ''contrast-color()'' function {#colorcontrast
8686
or as a background against a list of [=color candidate|candidate=] text colors.
8787
(The effective contrast of a pair of colors depends on their usage.)
8888

89-
ISSUE (#7359): The keywords to specify whether the [=base color=] is a foreground or background are <abbr title="to be decided">TBD</abbr>.
89+
ISSUE(#7359): The keywords to specify whether the [=base color=] is a foreground or background are <abbr title="to be decided">TBD</abbr>.
9090

91-
The <dfn><<target-contrast>></dfn> argument specifies the contrast algorithm to use.
91+
The <dfn><<target-contrast>></dfn> argument specifies the contrast algorithm(s) to use.
9292
If no [=color candidates=] have been provided,
9393
<<target-contrast>> may be omitted,
9494
in which case a UA-chosen algorithm is used.
95+
9596
Arguments to a <<target-contrast>> [=functional notation=]
9697
indicate the <dfn>target contrast level</dfn>.
98+
Multiple contrast algorithms with [=target contrast levels=] may be specified,
99+
in which case all their requirements are simultaneously applied.
100+
A ''contrast-color()'' function specifying multiple algorithms
101+
must specify a [=target contrast level=] for each algorithm,
102+
and is otherwise [=invalid=].
97103

98104
If the [=target contrast level=] is omitted,
99105
the color candidate with the greatest contrast is returned.
@@ -120,9 +126,13 @@ If there is a target contrast</h4>
120126
Candidate colors are tested sequentially,
121127
starting with the first color in the list,
122128
and ending with an automatically appended ''white, black''.
123-
The first color to pass the specified level of contrast
129+
The first color to pass the specified level(s) of contrast
124130
against the [=base color=] wins.
125131

132+
If no candidate color passes, then whichever of ''white'' or ''black'' has the highest contrast
133+
according to the first specified algorithm wins.
134+
If they both have the same contrast, ''white'' wins.
135+
126136
<!-- live example
127137
https://colorjs.io/notebook/?storage=https%3A%2F%2Fgist.github.com%2Fsvgeesus%2Fec249f376fcecbaa8794f75dbfc1dacf
128138
-->

0 commit comments

Comments
 (0)