Colour Science & Perception

About

What this site is, why every swatch on it is computed from a spectrum, and why the page it is printed on is deliberately grey.

This is a growing collection of illustrated essays about colour and how it is seen. Each takes a single idea and draws it until the argument is visible — and this is the one subject where the page is displayed on the very apparatus under discussion, which is both the opportunity and the whole difficulty.

No figure contains a hex code

A colour on this site begins as a spectral power distribution: a function of wavelength, either an illuminant, a measured reflectance under an illuminant, or a constructed spectrum. It is integrated against the colour-matching functions of a named observer to give CIE XYZ, converted into whatever space the figure works in, and only then written into the drawing. Nothing is eyedroppered, and nothing is a value recalled from a table.

This matters more here than the equivalent discipline does elsewhere in this fleet, because a hex code on its own does not identify a colour at all. It identifies three numbers whose meaning depends on a colour space, a transfer function, a white point and a display. Naming the spectrum and the observer is the only way to say what was actually meant.

Everything outside the gamut is marked

Most of the colours a person can see cannot be shown on this page. The canonical illustration of that fact — the CIE chromaticity diagram — is usually printed filled edge to edge with colour, which is impossible: a screen reaches a triangle covering roughly a third of the diagram's area. Everything beyond it, including the entire spectral boundary that the diagram exists to plot, has been clipped or mapped to something reachable, and the caption almost never says so.

Here the machinery asks, for every colour it is about to draw, whether the display can reach it. If it cannot, the figure marks the region rather than filling it with the nearest available lie. That is the single most visible difference between the diagrams on this site and the ones in print, and the hatching covers about two thirds of the picture.

"These two patches are identical" is an assertion

It is the most repeated and least checkable sentence in visual perception. Simultaneous contrast, White's illusion, the Adelson checkerboard, the Cornsweet edge — the entire rhetorical force of each figure rests on an identity the reader cannot confirm by looking, because the whole point is that it does not look true.

Every such claim here is a call to assertSame, which compares the two computed values and throws. The caption therefore states a fact about the drawing rather than a promise from the author, and a figure whose two patches ever drift apart stops the build.

What else is checked

Why the page is grey

Deliberately, and for a reason from the subject rather than from taste. A patch of colour has no fixed appearance: it shifts with whatever surrounds it. Coloured page furniture would bias every swatch on every page, in a direction varying with where the swatch happened to sit in the layout. So the paper and the ink here are exactly neutral — equal in all three channels, checked in the gate — and the only chroma on a page is chroma some figure computed.

Where the models stop

Three places, and the first is the one that causes the most trouble in practice.

Matching is not appearance. CIE XYZ predicts when two lights will look the same under identical viewing conditions. It was never a model of how anything looks. Two patches with identical XYZ in different surrounds can look completely different, and most of the confusion in applied colour comes from treating a matching model as an appearance model.

The standard observer is not a person. The 1931 functions are an average over seventeen observers, they are known to be wrong in the blue, and real observers vary by more than most people expect. Where an essay says "the observer" it means a specific tabulated function, named in the figure.

Nothing here knows what display this is. Every appearance claim is conditional on an uncalibrated screen of unknown gamut in unknown ambient light. The figures state their assumptions — sRGB primaries, D65 white, the standard transfer function — and where a claim would collapse if those were wrong, the essay says which claim and how.

On being wrong

Corrections are welcome and will be made. A swatch with a wrong caption looks exactly like one with a right caption, which is the entire argument for computing the caption.