opyeb ColorOKLCH

OPYEB · ColorOKLCH

Colour design guides, fifteen in all

Basis 28 November 2026 · W3C CSS Color 4 and 5, WCAG 2.1, APCA

Colour looks like a matter of taste until you build a palette and find it is arithmetic. Raise lightness ten points and contrast can halve; add 0.03 of chroma and the colour leaves sRGB, looking different on every screen. Fifteen guides work through the OKLCH coordinates, gamut checks, the difference between WCAG 2.1 and APCA, light-dark() token design and Tailwind v4 @theme, against the specifications as of 28 November 2026.

Foundations

FoundationsOKLCH — the most calculable way to choose colour in 2026What the three axes mean and why a palette holds together better than in HSL.Foundationsoklch() syntax and units — is L 0–1 or 0–100%?Function form, percentages and decimals, alpha and the none keyword.FoundationsOKLab and OKLCH — one space, two coordinate systemsRectangular against cylindrical, and which to use when.FoundationsPerceptual lightness — why ten points is ten pointsGamma, relative luminance and OKLab L, and how they relate.

Gamut and CSS

GamutGamut — the edges of sRGB, Display-P3 and Rec.2020How much colour each space holds and what to do with the rest.GamutGamut mapping — clipping and chroma reduction are not the sameFour ways to bring an out-of-gamut colour onto a screen, and their side effects.GamutRelative colour syntax — deriving one colour from anotherThe from keyword, channel variables and calc() in 2026 CSS.Gamutlight-dark() — theme colours in one declarationcolor-scheme, fallbacks and the image values, all in one place.

Contrast and accessibility

ContrastWCAG 2.1 contrast — how 4.5:1 is calculatedThe luminance formula, AA and AAA, and where the numbers go wrong.ContrastAPCA — the Lc value and its six bandsA contrast method that models what WCAG 2 overstates.ContrastWCAG 2.1 and APCA — where the two disagreeWhy one pair passes on one measure and fails on the other.ContrastDesigning an accessible palette — steps, contrast and colour visionHow to lay out eleven steps and which step belongs where.

Tokens and shipping

TokensDark mode tokens — a rearrangement, not an inversionSurface layers, accent, shadows and borders redone for the dark.TokensTailwind v4 @theme — wiring a palette into utilities--color-* variables, the @theme block and light-dark().TokensDesign tokens — splitting CSS variables into two layersPrimitive and semantic tokens, naming, and theme switching.

Check your own colours in the tool; inputs stay after the # in the address.

Open the tool
Back to the palette