media-feature

color-gamut — CSS reference

Reports an approximate color gamut supported by the user agent and output device. Values srgb, p3 and rec2020 represent increasing gamut capability; matching a larger gamut also satisfies smaller gamut queries. Syntax support for color(display-p3 …) is a separate question. Keep a usable sRGB fallback regardless of the reported gamut.

Formal Syntax & Structure

css syntaxcss
@media (color-gamut: p3) { … }

Working Example

Example Snippetcss
<!doctype html><html lang="en"><meta charset="utf-8"><title>CSS accessible theme lab</title><style>body {margin:0} .sample {height:12px;background:#006050}p{--gamut:baseline;color:#005a80}@media(color-gamut:srgb){p{--gamut:srgb}}@media(color-gamut:p3){p{--gamut:p3;color:color(display-p3 0 0.35 0.5)}}</style><body><p id="a">Color gamut example</p></body></html>
CSS Reference