From b860b74e84091b12fc42c00af7816b17a90b66fe Mon Sep 17 00:00:00 2001 From: Lea Verou Date: Thu, 20 Oct 2022 16:50:22 -0400 Subject: [PATCH] [css-color-6] Prepare prose for multiple contrast algorithms, see #7357 Co-Authored-By: fantasai <725717+fantasai@users.noreply.github.com> --- css-color-6/Overview.bs | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/css-color-6/Overview.bs b/css-color-6/Overview.bs index dda3ef7812f..eb7b3b24d92 100644 --- a/css-color-6/Overview.bs +++ b/css-color-6/Overview.bs @@ -86,14 +86,20 @@ Computing a Contrasting Color: the ''contrast-color()'' function {#colorcontrast or as a background against a list of [=color candidate|candidate=] text colors. (The effective contrast of a pair of colors depends on their usage.) - ISSUE (#7359): The keywords to specify whether the [=base color=] is a foreground or background are TBD. + ISSUE(#7359): The keywords to specify whether the [=base color=] is a foreground or background are TBD. - The <> argument specifies the contrast algorithm to use. + The <> argument specifies the contrast algorithm(s) to use. If no [=color candidates=] have been provided, <> may be omitted, in which case a UA-chosen algorithm is used. + Arguments to a <> [=functional notation=] indicate the target contrast level. + Multiple contrast algorithms with [=target contrast levels=] may be specified, + in which case all their requirements are simultaneously applied. + A ''contrast-color()'' function specifying multiple algorithms + must specify a [=target contrast level=] for each algorithm, + and is otherwise [=invalid=]. If the [=target contrast level=] is omitted, the color candidate with the greatest contrast is returned. @@ -120,9 +126,13 @@ If there is a target contrast Candidate colors are tested sequentially, starting with the first color in the list, and ending with an automatically appended ''white, black''. - The first color to pass the specified level of contrast + The first color to pass the specified level(s) of contrast against the [=base color=] wins. + If no candidate color passes, then whichever of ''white'' or ''black'' has the highest contrast + according to the first specified algorithm wins. + If they both have the same contrast, ''white'' wins. +