@@ -86,14 +86,20 @@ Computing a Contrasting Color: the ''contrast-color()'' function {#colorcontrast
86
86
or as a background against a list of [=color candidate|candidate=] text colors.
87
87
(The effective contrast of a pair of colors depends on their usage.)
88
88
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> .
90
90
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.
92
92
If no [=color candidates=] have been provided,
93
93
<<target-contrast>> may be omitted,
94
94
in which case a UA-chosen algorithm is used.
95
+
95
96
Arguments to a <<target-contrast>> [=functional notation=]
96
97
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=] .
97
103
98
104
If the [=target contrast level=] is omitted,
99
105
the color candidate with the greatest contrast is returned.
@@ -120,9 +126,13 @@ If there is a target contrast</h4>
120
126
Candidate colors are tested sequentially,
121
127
starting with the first color in the list,
122
128
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
124
130
against the [=base color=] wins.
125
131
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
+
126
136
<!-- live example
127
137
https://colorjs.io/notebook/?storage=https%3A%2F%2Fgist.github.com%2Fsvgeesus%2Fec249f376fcecbaa8794f75dbfc1dacf
128
138
-->
0 commit comments