loading...
running...
The science
Colour is not a property of light or of a surface alone: it is the response of three kinds of cone cells to the spectrum that reaches the eye. That is why three numbers are enough to describe any colour, and also why very different spectra can look identical. This lab shows both facts with real spectra.
Tristimulus values. For a surface with reflectance R(λ) lit by a source with spectral power S(λ) the CIE 1931 2° observer gives
X = k Σ S R x̄, Y = k Σ S R ȳ, Z = k Σ S R z̄, k = 100 / Σ S ȳ, x = X/(X+Y+Z), y = Y/(X+Y+Z)
The colour matching functions x̄, ȳ, z̄ are the analytic multi-lobe fit of Wyman, Sloan and Shirley (2013) to the CIE tables, sampled every 5 nm from 380 to 780 nm. Its ȳ integral is within about 0.1 % of the tabulated 106.857, and equal-energy light lands at x = y = 1/3 within 0.2 %. The horseshoe in the diagram is the spectral locus: the chromaticities of single wavelengths. Everything a real light can do lies inside it.
Light sources. A blackbody follows Planck's law, B(λ,T) ∝ λ−5/(exp(hc/λkT) − 1). The "daylight-like" light is a 6500 K blackbody, which is close to but not identical with CIE D65 (its chromaticity is 0.313, 0.324 instead of 0.313, 0.329); the incandescent lamp is a 2856 K blackbody (CIE illuminant A). The warm LED, fluorescent tube and sodium lamp are stylised spectra built from Gaussians: a blue pump line plus broad phosphor, a smooth continuum plus mercury lines at 405, 436, 546 and 578 nm, and the 589 nm sodium doublet as one line. They show the right behaviour, not the exact spectrum of a particular product.
Metamerism. Paint A has a smooth pigment reflectance (cut-on or cut-off edge, or a band). Paint B is made of three broad bands at 455, 540 and 615 nm whose amplitudes are solved from the 3×3 linear system that makes XYZ of B equal XYZ of A under the reference light. Two different reflectance curves with the same X, Y, Z are a metameric pair: identical under that light, different under any other light because the products S R x̄ change. The shown difference is the CIELAB ΔE*ab = √(ΔL*² + Δa*² + Δb*²), with the white point of each light; about 2.3 is a just-noticeable difference. If a solution needs an amplitude outside 0–1 it is flagged as not physically realisable.
Adaptation. The eye partly discounts the colour of the light. The adaptation switch applies the Bradford von Kries transform that maps the light's white onto D65 before display. It makes a white sheet look white under a lamp, but it cannot restore a metameric match: the ΔE under the test light is computed with the lamp's own white either way.
Colour matching with three lights. A monochromatic test light is matched by mixing three narrow primaries. With P the 3×3 matrix of the primaries' XYZ, the weights solve P w = XYZtest. When a weight comes out negative, that primary has to be added to the test side instead, which is why real displays cannot show every colour and why the original RGB matching functions have a negative lobe near 500 nm. The graph shows r̄, ḡ, b̄ for your primaries. The sliders are in units of the fraction of the test luminance carried by each primary; Auto-match sets the non-negative part of the solution.
Numerical checks run in the page. (1) the ȳ integral against 106.857; (2) equal-energy white at 1/3, 1/3; (3) blackbody chromaticities at 2856 and 6500 K against the Kim et al. cubic Planckian-locus formula; (4) the Bradford transform maps a lamp white exactly onto D65; (5) D65 white converts to sRGB (1, 1, 1); (6) the metameric pair has ΔE near 0 under the reference light and a visible difference under fluorescent light; (7) the solved primary weights reproduce the test XYZ, and 500 nm needs a negative red weight as in the classical experiment.
Simplifications. 2° standard observer only, no individual variation or colour deficiency; no fluorescence of paints, gloss or texture; sRGB display is gamut clipped, so some saturated colours (the monochromatic test lights) are only approximations on screen; illuminant spectra are stylised; screen brightness and surround are not modelled.