A defined way of turning numbers into colours, so that the same numbers mean the same colour wherever they are used.
A colour model (such as RGB) plus the specifics that pin it down: the primaries, the white point and the transfer function. sRGB, Display P3 and Adobe RGB are all RGB models but different colour spaces.
'RGB' is not a colour space on its own. R 255, G 0, B 0 is a different red in sRGB and in Display P3.
CSS assumes HEX values are sRGB; color(display-p3 1 0 0) names a redder red.
Colour values are only portable when the space travels with them, which is what embedded profiles and CSS colour functions are for.
An RGB colour space is pinned down by three things: the chromaticities of its red, green and blue primaries, its white point, and the transfer function that relates stored values to light. sRGB uses the primaries of HD television, a D65 white and a curve with a short linear toe followed by a 1/2.4 power. Display P3 keeps the white and the curve and moves the red and green primaries outwards. A display is checked against a space by measuring its primaries and white with a colorimeter and comparing the chromaticities.
| Colour space | Chromaticity x, y | Same light in linear sRGB | Inside sRGB? |
|---|---|---|---|
| sRGB | 0.640, 0.330 | 1.000, 0.000, 0.000 | Yes |
| Display P3 | 0.680, 0.320 | 1.225, −0.042, −0.020 | No |
| Rec. 2020 | 0.708, 0.292 | 1.660, −0.125, −0.018 | No |
Full red is a different light in each space. Display P3's red would need a linear sRGB red channel of 1.225 and a green channel of −0.042, more than all and less than none, so no sRGB value can name it. The triplet is identical in every row. The colour space is what turns it into a colour.
How this was calculated: Each space's red primary is converted to CIE XYZ with the matrix derived from its published primaries and D65 white, then expressed in linear sRGB.
An image saved in Display P3 or Adobe RGB has its profile stripped by an upload pipeline.
Software falls back to treating the numbers as sRGB, and the picture turns flat and desaturated. Converting to sRGB before export, or keeping the profile, prevents it.
A design tool is set to one working space and the stylesheet is written in another.
A hex value picked in a P3 document names a more saturated colour there than the same hex does in a browser. Colours agree only when the document and the code share a space.