CSS color recipe

Display P3 Wide-gamut color with an sRGB fallback

color(display-p3 …) reaches colors sRGB cannot, on the wide-gamut screens of most phones and many laptops. Write the sRGB color first and the P3 color second; a browser that cannot read color() keeps the first.

See it run
Baseline
Widely available
First versions
Chrome 111 · Firefox 113 · Safari 15
Tested
3 of 3 engines

Live example

The recipe, running

Left: the CSS below, as your browser runs it. Right: the same CSS as a browser without the feature reads it, so you see exactly what the fallback gives.

Turn on JavaScript to see whether your browser supports it; the examples work either way.

As written, in your browser
In a browser without it

The CSS

Copy it as it is

This is the exact CSS the example runs. Fallbacks come first; the modern values follow, so each browser keeps the last line it understands.

display-p3.css

/* sRGB first; browsers that read color() take the second line. */
.swatch--p3 {
  background: #FF3F90;
  background: color(display-p3 1 0.1 0.55);
}
.swatch--srgb { background: #FF3F90; }

.swatch { display: grid; place-items: end start; height: 84px; padding: 8px; border-radius: 10px; color: #000000; font-size: 12px; }
.screen::after { content: "sRGB screen"; }
@media (color-gamut: p3) {
  .screen::after { content: "P3 screen"; }
}

How it works

What each part does

  1. Two declarations are enough here. There is no var() in the value, so an old browser drops the line it cannot parse and keeps the hex.

  2. The fallback is mapped, not clipped. #FF3F90 is the P3 color brought inside sRGB by lowering its OKLCH chroma, CSS Color 4’s method, so the hue and lightness hold.

  3. The difference needs the screen. On an sRGB screen both swatches look alike; on a P3 screen the left one is richer. @media (color-gamut: p3) tells you which screen you have.

Browser support

Where it runs

First version of each browser with the feature, from the web-features project and MDN’s browser-compat-data. “No” means not supported yet.

  • color()Widely availableBaseline widely available since 9 November 2025.
  • color-gamutWidely availableBaseline widely available since 14 August 2025.
First supporting version by browser
Browsercolor()color-gamut
Chrome11158
Chrome for Android11158
Edge11179
Firefox113110
Firefox for Android113110
Safari1510
Safari on iOS1510

Support reviewed on against web-features 98723fd and browser-compat-data 3b28abe.

Tested

Tested in three engines

Engines this recipe was run in
EngineVersionSupportedAs writtenFallback
Chromium147.0.7727.15YesPassPass
Firefox148.0.2YesPassPass
WebKit26.4YesPassPass

Run on in Chromium 147.0.7727.15, Firefox 148.0.2 and WebKit 26.4, with Playwright.

Accessibility

Measured, not assumed

The P3 color has an OKLCH chroma of 0.299; its sRGB fallback 0.233. The black labels measure 6.37:1 on the fallback, the color every screen can show.

  • Display P3 color0.299
  • sRGB fallback0.233

References

Go to the source