loading...
running...
How to use
Click anywhere on the colour ring (or use the hue slider) to set the base hue. The pegs stand on the ring at the harmony angles, the swatch board shows the palette, and the vase, block and ball take the base, second and third colours. Drag to orbit, wheel or pinch to zoom, camera buttons for presets. Tick "Tint the room light" to see how a coloured light changes every surface. Try the colour-vision preview: the whole scene is re-coloured as a dichromat would see it.
Models and baked PBR textures made in Blender; Three.js r160 places the pegs and recolours the materials.
The science
HSL describes a colour by hue angle H (0-360 degrees around the wheel), saturation S and lightness L. A harmony scheme is a set of hue offsets from the base hue, taken at the same S and L:
complementary 0, 180 | analogous 0, +-d | triadic 0, 120, 240
split 0, 150, 210 | tetradic 0, 60, 180, 240 | square 0, 90, 180, 270
HSL to RGB: C = (1 - |2L - 1|) S, X = C (1 - |(H/60) mod 2 - 1|), m = L - C/2, then (R,G,B) = (C,X,0) + m for H in [0,60) and the cyclic permutations for the other sectors. Rotating the hue by 180 degrees replaces every channel c by (max + min) - c, so a colour and its complement always add up to 2L in each channel; the checks test that identity, the hue round trip and the peg geometry measured from the actual 3D positions of the pegs.
contrast = (L1 + 0.05) / (L2 + 0.05), L = 0.2126 R + 0.7152 G + 0.0722 B (linear sRGB)
Honest simplifications: HSL is a geometric re-labelling of sRGB, not a perceptual space, so equal HSL lightness is not equal brightness (the OKLab L readout shows the gap). Under real room light a surface colour is the product of its reflectance and the light spectrum; here the tint light is a simple RGB multiplication, not a spectral render. The colour-vision preview uses full-severity Machado et al. 2009 matrices in linear RGB, an approximation of dichromacy. The harmony rules are design conventions, not physics. Lighting and shadows are real-time PBR, so the on-screen colours also depend on tone mapping.