- From: Lea Verou via GitHub <sysbot+gh@w3.org>
- Date: Wed, 24 Aug 2022 14:58:10 +0000
- To: public-css-archive@w3.org
> > Since canvas is driven from script, it is easy for script authors to use their own gamut mapping stage if they wish (like my demo does). Canvas clip can then be seen as a failsafe (if they get this wrong, or don't do it). > > My understanding is that the [color-gamut media query](https://www.w3.org/TR/mediaqueries-4/%23color-gamut#color-gamut) exist to allow content authors to do exactly this (with or without script) for CSS Colors. > > For instance, one can do custom gamut mapping with the following CSS: > > ``` > <style> > div { background-color: color(srgb 1 0.24 0.08); } > @media (color-gamut: p3) { div { background-color: color(display-p3 1 0.157 0.117); } } > @media (color-gamut: rec2020) { div { background-color: color(rec2020 1 0 0); } } > </style> > ``` > > This solves the problem of rendering out-of-gamut CSS Colors, without introducing any regressions in color matching behavior or performance. It also gives the content author full control over how their page is to do gamut mapping (the author can even implement a perceptual-like mapping if they want). Given how trivially easy it is to specify out of gamut colors with e.g. LCH or OKLCH, having to do manual gamut mapping to not get a terrible result is **completely** unacceptable. Not to mention that the `color-gamut` media query is a very blunt instrument for this purpose. I think there is a fundamental misunderstanding permeating this discussion. Going out of gamut is not some edge case we can relegate to script or manual computation, it will be very very common once authors can specify wide gamut colors, so it's important to handle it well and not sweep it under the rug. -- GitHub Notification of comment by LeaVerou Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/7610#issuecomment-1225842937 using your GitHub account -- Sent via github-notify-ml as configured in https://github.com/w3c/github-notify-ml-config
Received on Wednesday, 24 August 2022 14:58:12 UTC