Skip to content

[mediaqueries] In-gamut media query #5045

@LeaVerou

Description

@LeaVerou

We currently have the color-gamut media query. While generally useful, this is a rather crude measure of the output device's gamut, and currently only supports RGB color spaces. Since there is no ordering of gamuts, we also cannot really have min/max-color-gamut either, either it's "approximately" P3 (whatever that means), or it's not.

I would like a to propose an in-gamut: <color> media feature, that supports any CSS color, and matches if that particular color is within the output device's gamut. This will enable authors to more accurately determine the gamut of the output device, based on what matters in their own particular use cases.

Furthermore, this will allow authors to indicate whether the color displayed is accurate or an approximation, which can matter a lot in certain applications (e.g. displaying the right color for merchandise)

Also, since we already allow providing a fallback in color() if the specified color is out of gamut, the code path to check this is already in place.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions