W3C home > Mailing lists > Public > public-css-archive@w3.org > February 2020

[csswg-drafts] [css-color-5] color-contrast() needs resolution logic if 2 or more have the same contrast (#4732)

From: Adam Argyle via GitHub <sysbot+gh@w3.org>
Date: Mon, 03 Feb 2020 05:40:01 +0000
To: public-css-archive@w3.org
Message-ID: <issues.opened-558855672-1580708399-sysbot+gh@w3.org>
argyleink has just created a new issue for https://github.com/w3c/csswg-drafts:

== [css-color-5] color-contrast() needs resolution logic if 2 or more have the same contrast ==
Spec draft
https://drafts.csswg.org/css-color-5/#colorcontrast

**Example**
```css
foo {
  --bg: hsl(200 50% 80%);
  --purple-in-hsl: hsl(300 100% 25%);
  color: color-contrast(var(--bg) hsl(200 83% 23%), purple, var(--purple-in-hsl));
}
```
verify contrast scores: [[hsl(200 83% 23%)](https://contrast-ratio.com/#hsl%28200%2083%25%2023%25%29-on-hsl%28200%2C50%25%2C80%25%29), [purple](https://contrast-ratio.com/#purple-on-hsl%28200%2C50%25%2C80%25%29), [var(--purple-in-hsl)](https://contrast-ratio.com/#hsl%28300%20100%25%2025%25%29-on-hsl%28200%2C50%25%2C80%25%29)]

Given `purple`, `hsl(200 83% 23%)`, & `hsl(300 100% 25%)` all have the same contrast with `--bg`, which wins? First match, cascade, your idea? 

Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/4732 using your GitHub account
Received on Monday, 3 February 2020 06:06:00 UTC

This archive was generated by hypermail 2.4.0 : Tuesday, 5 July 2022 06:42:00 UTC