Lexicon / Colour · 1 of 5

37 / Colour

Token Interpolation

Every colour on the card is held to one dial. Scroll, and they all turn together, in step, never landing on a combination nobody chose.

One angle, every colour

Philipp Otto Runge’s colour sphere of 1810 has white at one pole, black at the other and the pure colours round its equator: lightness, hue and chroma. Every colour of the interface beside it is a point on that sphere, and all of them share one angle. Scroll, and it turns.

Runge’s plate: the colour sphere seen from its white pole and from its black pole, and cut through the equator and through both poles
Farben-Kugel · the sphere from its white pole and its black pole, and cut through the equator and through both poles

Philipp Otto Runge · Hamburg, 1810

Farben-Kugel

The colour sphere: white at one pole, black at the other, the pure colours round its equator, and every mixture in between.

See the plateRead about Runge

  • lightness, the axis
  • hue, the angle
  • chroma, the distance out

the angle every colour here shares

ground
oklch(0.965 0.016 )
surface
oklch(0.925 0.03 )
rule
oklch(0.85 0.045 )
soft ink
oklch(0.47 0.075 )
ink
oklch(0.27 0.045 )
accent
oklch(0.72 0.118 )
complement
oklch(0.72 0.118 )

also called scroll-driven theme · animated custom properties · palette rotation

The whole palette is one number. @property is what makes it animatable at all — an unregistered custom property has no interpolable type. Every token keeps its lightness and chroma and shares the angle, so nothing can drift out of step. Each token keeps its own lightness and chroma and only the angle is shared, so what makes a palette work (dark ink on a pale ground, the accent between them) holds at every hue: ink on ground stays between 13.45 and 13.78 to 1 all the way round, soft ink never below 5.96. The lightnesses and chromas are chosen inside what a screen can show at every hue, the accent’s 0.118 being the most a mid-tone can have at the cyan, where sRGB is narrowest, so no colour is clipped out of step on the way. Runge’s sphere has the same three measures, and the needle points at the ink he printed at the palette’s hue, his twelve sectors measured on the plate. His circle has no cyan: between his green and his blue the needle slows across a fifth of the circle.

How it is built@property --turn { syntax: '<angle>'; inherits: true; initial-value: 0deg } .frame { animation: turn linear both; animation-timeline: --dial; /* the scroll turns one number */ --h: calc(18.17deg + var(--turn)); --ground: oklch(.965 .016 var(--h)); --ink: oklch(.27 .045 var(--h)); --accent: oklch(.72 .118 var(--h)) } @keyframes turn { to { --turn: 360deg } }

In full, on GitHub index.html showcase.css

Plate — Philipp Otto Runge, Farben-Kugel, Hamburg, 1810, public domain, via Wikimedia Commons; its twelve equatorial inks measured in OKLCH from the scan. Facts — Philipp Otto Runge; Oklab color space.