[csswg-drafts] [css-color] color-contrast() should distinguish foreground and background (#7359)

LeaVerou has just created a new issue for https://github.com/w3c/csswg-drafts:

== [css-color] color-contrast() should distinguish foreground and background ==
As we move towards a `color-contrast()` function that is more flexible and allows specifying the algorithm used (see #7356), we run into the issue that many (most?) contrast algorithms are not commutative operations; it makes a difference which of the two colors is background and which one is foreground. Currently, `color-contrast()` does not distinguish between the two, but we think the syntax should make it clear which one is which. 

While the most common case is to provide a fixed background color and multiple candidates for the foreground color, we think the reverse should be possible as well (fixed foreground, variable background). We do not think there are enough use cases that warrant the complexity of providing multiple candidates for *both*.

@fantasai suggested the following syntax, which also addresses the syntax concerns raised in #7354: `color-contrast([over | under] <color>, <color>#)` (target level omitted from this grammar for simplicity)

*(Issue filed following breakout discussions between @svgeesus, @fantasai, @argyleink and myself)*

Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/7359 using your GitHub account


-- 
Sent via github-notify-ml as configured in https://github.com/w3c/github-notify-ml-config

Received on Tuesday, 14 June 2022 18:06:05 UTC