Design

sRGB vs Display P3: Why the Same Colour Looks Different

A hex code is a set of numbers, and the numbers only mean a colour once you know which space they are measured in.

Two nested triangles: a small one inside a larger one. A white dot is inside the small one; pink dots sit in the ring only the larger reaches.

Display P3 is a colour space with a wider gamut than sRGB: its red, green and blue are more saturated, so it can show vivid colours that sRGB cannot. The numbers 255, 0, 0 are a different red in each. On the web, a plain hex code is always sRGB.

What is a gamut?

A gamut is the range of colours a space, or a screen, can produce. Every RGB space is defined by three primaries, its purest red, green and blue, plus a white point and a curve that maps the numbers to brightness. The colours reachable by mixing those three form a triangle on a chromaticity diagram, and that triangle is the gamut.

sRGB has the smaller triangle. Display P3 is a wider one that contains it, with a more saturated red and green and the same white point. MDN describes the color-gamut media feature the same way: sRGB is contained in P3, which is contained in Rec. 2020. Because the P3 triangle contains the sRGB one, every sRGB colour has a P3 equivalent. The reverse is not true.

Why does the same number look different?

Because #ff0000 does not say "this exact red". It says "full red, in whatever space the surrounding software assumes". Full red in P3 is a more intense red than full red in sRGB. Feed the same three numbers to a screen that interprets them as P3 and to one that interprets them as sRGB, and they come out as two different reds.

The grey axis is the exception. Greys, black and white, where the three channels are equal, look the same in both spaces. The differences concentrate in saturated colours, which is why a pastel or a neutral survives any mix-up and a vivid green or orange does not.

Why does a screenshot from my phone look duller on the web?

One common cause: the screenshot was captured with a P3 profile attached, and somewhere on the way to the web page the profile was dropped. The pixel values are unchanged, but whatever shows them now reads them as sRGB. P3 numbers read as sRGB land on a less saturated colour, so everything looks slightly washed out.

The opposite mistake exists too. A tool that converts to sRGB properly keeps the colour as close as the smaller gamut allows, but the most vivid colours have nowhere to go and are clipped or compressed. A photo with strong greens can look flatter after an export to sRGB even when nothing was wrongly tagged.

I cannot tell you which of these happened to your file. Nobody can from the picture alone. The profile is stored as metadata, and uploaders, messaging apps and some editors rewrite or strip it. If a colour shifted between two places, ask what each step did with the profile. The image side of this, including what else travels inside a photo file, is covered in what EXIF data is and what it reveals.

How do you write a P3 colour in CSS?

With the color() function: color(display-p3 1 0.5 0), three values from 0 to 1. MDN lists it as widely available across browsers since May 2023. You can ask whether the screen can use it with @media (color-gamut: p3).

The safe pattern is a fallback in the cascade. Write the sRGB colour first, then the P3 one, and a browser that does not understand color() ignores the second line:

.badge {
  background: #00c853;
  background: color(display-p3 0 0.8 0.3);
}

A browser that understands the P3 line on a screen that cannot show it maps the colour to the nearest one it can. What you get there depends on the device, so check it on an ordinary sRGB monitor rather than assuming.

When is a wider gamut worth the trouble?

Less often than the marketing suggests. It earns its keep in a few places:

It earns nothing on body text, borders, backgrounds and anything grey, because the shared grey axis means there is nothing to gain. And it costs you something: a second value to maintain for every colour you widen, and a design that now looks different on two kinds of screen. The same blue will be two blues, and a reviewer on an sRGB laptop will not see what the designer on a P3 display approved.

What does the contrast check use?

The WCAG 2.x contrast formula is written in terms of sRGB values. For a P3-only colour it has no defined answer, so test the sRGB fallback you ship alongside it. The thresholds themselves are in what contrast ratio you need for readable text.

What our colour tools can and cannot do here

Both of them are sRGB-only. The colour converter moves between HEX, RGB and HSL, which are three ways of writing one sRGB colour, and its picker returns a hex value. It does not convert to or from Display P3, and it does not read OKLCH or any other space. The palette generator builds its palettes from an sRGB base and exports hex codes. For a P3 value you have to write the color() line yourself or take it from a design tool that supports the space. Both run entirely in your browser, and nothing you type is uploaded. The choice of format between HEX, RGB, HSL and OKLCH has its own post: which colour format to use.

To see what your sRGB values actually are before you widen anything, the colour converter shows one colour as HEX, RGB and HSL side by side, and the palette generator gives you a hex palette to start from. Neither will produce a Display P3 value, so that line is yours to write.

If the next question is how to build the palette in the first place, how to choose a colour palette that works covers neutrals, states and contrast, which matter more than gamut for most sites.

Frequently asked questions

What is the difference between sRGB and Display P3?

Both are RGB colour spaces, but Display P3 has more saturated red and green primaries, so it can show vivid colours that sRGB cannot. Every sRGB colour exists in P3, and the reverse is not true. The same three numbers, such as 255, 0, 0, are a more intense red in P3 than in sRGB.

Why do my colours look duller after I upload a screenshot?

A common cause is that the image carried a Display P3 profile and a later step dropped it, so the pixel values are now read as sRGB. P3 numbers read as sRGB come out less saturated. It can also be an export to sRGB that compresses colours the smaller gamut cannot hold. Which one happened depends on what each tool did with the profile, and the picture alone does not tell you.

Can a hex code be a Display P3 colour?

No. In CSS a hex code is always sRGB, so it cannot name a colour outside that gamut. To use Display P3 you write color(display-p3 r g b) with values from 0 to 1, and you keep a hex line before it as the fallback for browsers that do not understand it.

Do I need Display P3 for my website?

Usually not. It helps with saturated brand colours, photos and vivid gradients on screens that can show them, and it does nothing for greys, body text or most interface colours. It also means maintaining two values per colour and accepting that the site looks different on two kinds of screen.

Last updated October 4, 2026