Controls
Mixing physics
Presets
Light sources
Filters between lamp and wall
Paint set
Jars (parts mixed)
Camera
Quality
Experiments
Model checks
The science
Colour is a spectrum, then three numbers. Light is a power spectrum S(lambda). The eye has three cone types; the CIE 1931 colour matching functions xbar, ybar, zbar summarise them: X = sum S xbar, Y = sum S ybar, Z = sum S zbar (5 nm steps, 380-720 nm; the curves are the Wyman-Sloan-Shirley 2013 analytic fit, accurate to about 1-2 % of the published table). The chromaticity is x = X/(X+Y+Z), y = Y/(X+Y+Z). To show it on a screen, XYZ is converted with the standard sRGB matrix and gamma C = 1.055 c^(1/2.4) - 0.055. Colours the screen cannot make (negative linear value) are clipped and flagged.
Additive light. Lights add: S = R S_R + G S_G + B S_B. The three LEDs here are narrow Gaussian bands (about 612, 540 and 462 nm) weighted so that all three at full power equal a 6504 K daylight-like white. Because XYZ is linear in S, mixing in XYZ or in linear RGB is exact (Grassmann's law); mixing gamma-encoded codes is not. Red + green = yellow although no yellow light is present; the experiment "metamer lab" finds the LED powers that match a broad spectrum exactly, and shows how different the two spectra still are.
Subtractive filters (Beer-Lambert). Light crossing a filter loses power exponentially: dI/dx = -ln(10) eps c I, so T = I/I0 = 10^-A with absorbance A = eps(lambda) c d. A stack multiplies transmittances (absorbances add). The cyan, magenta and yellow dyes are modelled as smooth absorption bands (cyan: long wavelengths, magenta: about 545 nm, yellow: short wavelengths) with peak absorbance 1 at thickness 1. They are illustrative curves, not measured dye spectra. Filters never create light: more filters is always darker, and C + M + Y tends to a dark neutral.
Paint (Kubelka-Munk). A paint layer scatters (S) and absorbs (K) light. For a thick opaque layer the reflectance is R_inf = 1 + K/S - sqrt((K/S)^2 + 2 K/S), i.e. K/S = (1-R)^2 / (2R). For a mixture the coefficients add by concentration: K = sum c_j K_j, S = sum c_j S_j. Blue plus yellow paint is green because the mixture reflects only what neither pigment absorbs. White (titanium-like) has a large S, so a little tints a lot. Pigment reflectance curves are illustrative, built from sigmoids and Gaussians, so the exact hues are not those of a named brand. Illuminant: 6504 K Planck blackbody, a stand-in for D65 (chromaticity differs by about 0.01).
Simplifications. No surface gloss or Saunderson correction, no fluorescence, one fixed illuminant, a 2-degree standard observer, perfectly opaque layers, filter dyes without scattering, no chromatic adaptation beyond scaling the white to (1,1,1) in linear RGB. The "RYB primaries" of art class are a teaching convention: real subtractive primaries are cyan, magenta and yellow (switch to the printer set to see them). The 3D lighting on the wall adds linear RGB in the renderer and so agrees with the model only where colours stay inside the sRGB gamut.
Checks on this page. (1) CIE fit against the equal-energy point and published spectral-locus values, (2) sRGB matrices against the published primaries and white, (3) Beer-Lambert closed form against numerical integration of the differential equation, (4) Kubelka-Munk closed form against a numerical two-flux solution, (5) Planck peak against Wien's law. The 2D and 3D pages import the same model file, so identical settings give identical numbers.
What to try
- Light, all three at 1: white. Pull one down: the other two make yellow, cyan or magenta.
- Paint, blue + yellow: green. Compare the "naive" swatch (average of codes): a duller olive. Press the ratio sweep.
- Filters: cyan + yellow makes green because each removes a different part of white light.
- Printer set: cyan + magenta + yellow paint makes a muddy dark brown, not black: real inks are not perfect absorbers.
- Metamer lab: three LEDs impersonate a broad warm-white spectrum; the CIE diagram shows both at the same point.