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

Re: [csswg-drafts] [css-color-adjust-1] Is forced background-color computed or used value? (#4915)

From: Chris Lilley via GitHub <sysbot+gh@w3.org>
Date: Sat, 20 Jun 2020 14:28:19 +0000
To: public-css-archive@w3.org
Message-ID: <issue_comment.created-647002741-1592663298-sysbot+gh@w3.org>
@tabatkins wrote:

> <TabAtkins> `color-mix(appropriate-system-color, specified-color a(100%))`

[As specified](https://drafts.csswg.org/css-color-5/#color-mix), that will do the [color interpolation(https://drafts.csswg.org/css-color-5/#interpolation) in the LCH colorspace, which is the default. That might not be what is wanted however. I can think of two other options:

`color-mix(appropriate-system-color, specified-color a(100%) srgb)`

That will mix in the (gamma corrected, i.e. non-linear-light) sRGB colorspace, which is what the current implementations do when mixing colors. It gives the wrong (too dark) result but is compatible with lots of software which also does it the wrong way :) It is also constrained to the sRGB gamut, which is temporarily fine but won't be over time as some system colors may be specified in, for example, `display-p3`.

`color-mix(appropriate-system-color, specified-color a(100%) xyz)`

That will get you linear-light mixing, _ie_ the correct result for the physical mixture of two lights, and avoids gamut mapping. It gives the same result as mixing in linear-light sRGB, except without the gamut limitation.


-- 
GitHub Notification of comment by svgeesus
Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/4915#issuecomment-647002741 using your GitHub account
Received on Saturday, 20 June 2020 14:28:21 UTC

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