UP | HOME

Wide gamut colour

The standard sRGB colour space used for images (and background and text colours) on the World Wide Web is deficient. Just look at how small the gamut triangle compared to the set of all colours. The ones outside the triangle may not look that different from the ones at the edges inside, but that’s only because you’re looking at it on a display which can’t show those contrasts. You can get a better idea of what colours are missing from the palettes of average computer screens by looking at Pteromys’s Munsell colour palette. All the greyed-out areas in the middle of the palette are inaccessible in standard range of the sRGB gamut.

Now look at the same triangle for the Adobe wide-gamut RGB space. There are over twice as many colours available! Unfortunately, browsers, operating systems, and displays are engaged in a conspiracy together to stop us using those brilliant colours. (In CSS, colours are usually clamped to the range of 0–255; in theory, one could use R/G/B values outside that range to obtain the desired colours — by checking the ‘plot out-of-range colors’ box on Pteromys‘s page, it will generate those colours for you.)

sRGB was specified in 1996, when most colours hadn’t even been invented yet. Okay, that’s not quite true, but the typical displays we had then were straight out of the metapaleolithic era. Today’s displays — perhaps not typical computer displays, but with Retina displays and so on, atypical displays are slowly becoming more typical anyway — have much wider ranges of colours available. (Even Retina displays only barely cover sRGB, though.)

Applications for more colours

‘So what?’ you might say. ‘The web gives us 16,777,216 colours, that’s enough for me,’ which neatly confuses the issues of colour depth and colour space gamut.

The application of additional colours which I care about the most is statistical graphics displays. The Munsell colour system could be used quite effectively to perceptually highlight areas in a chloropleth, for instance, but it’s hard to choose appropriate base values because after a certain point you fall outside the range of usable web colours.

Photographers also have to restrict the range of colours in their photos if they want them to look good on the web. Leaving sRGB behind would make photos look better on computer screens.

Fixes

One way to fix this would be to introduce (yet) another CSS colour syntax. E.g. wrgba(space, r, g, b, a) — note how this leaves the ’space’ variable. You could give srgb as the space for normal web colours, or adobe for the flawed 1998 Adobe RGB specification, or wide-gamut for the Adobe wide-gamut RGB selection. Since browsers ignore CSS properties they don’t understand, they could ignore e.g. wide-gamut specifications on displays which don’t support the entire range of wide-gamut colours. This would mean that authors could give two values to every colour, letting them give one colour scheme for wide-gamut displays and another for people stuck with sRGB.

Another way to achieve the same goal would be to use media queries to detect the range of colours supported by a display. Then you could use the technique hinted at above — giving sRGB values outside the 0–255 range to obtain colours outside of the putative normal range of sRGB.

Note that, though Wikipedia says that wide-gamut RGB requires 16-bit colour depth, in reality this isn’t an issue with CSS since its colour coördinates can be specified as fractional values.