Color Theory for Interfaces
The working subset of colour theory for screens: three dimensions, a handful of harmonies, and perceptual colour spaces that behave predictably.
Definition
Colour on screen is described by hue, saturation and lightness, and manipulated through colour spaces. For interface work, perceptually uniform spaces such as OKLCH are more useful than HSL because equal numeric steps produce equal perceptual steps.
Craft convention. True because the industry converged on it. Breaking it costs familiarity, not correctness.
On this page
Colour spaces you will actually use
| Space | Good for | Limitation |
|---|---|---|
| HEX and RGB | Interchange, developer handoff | No perceptual meaning. Cannot be reasoned about. |
| HSL | Quick manipulation, legacy code | Lightness is not perceptual. HSL 50 percent lightness is very different for yellow and blue. |
| OKLCH | Building palettes and themes | Wide browser support since 2023, but needs fallbacks for older targets. |
| LAB and LCH | Colour science, gradients | Similar benefits to OKLCH; OKLCH generally behaves better in the blue range. |
| P3 | Wide-gamut displays | Needs an sRGB fallback, and can exceed the gamut of older screens. |
Harmony schemes, and when each is useful
- Monochromatic: one hue at multiple lightness levels. Safest for interfaces, since it cannot clash.
- Analogous: neighbouring hues. Calm, and useful for sequential data.
- Complementary: opposite hues. Maximum contrast, which suits an accent against a neutral base.
- Split complementary: softer than complementary and easier to balance.
- Triadic: vivid and hard to control in interfaces. Usually too much for product UI.
In practice
Building a ramp in OKLCH
Design systemsHolding hue and chroma steady while stepping lightness produces a ramp where each step feels evenly spaced. The same operation in HSL produces steps that bunch in the middle and wash out at the ends.
Sources
Where a source establishes something narrower than the popular reading of it, the note says so.
W3C
Defines lab(), lch(), oklab() and oklch() in CSS.
A perceptual color space for image processing
B. Ottosson, 2020
Introduces Oklab, the basis for OKLCH.
Continue from here
Each link says what the connection is, so you can tell a principle from an alternative from a thing people mix this up with.
Related concept
Connected closely enough to change how you apply this.
- Design TokensDesign system
- Brand Color in InterfacesUI foundation
- Color AccessibilityUI foundation
- Color SystemsUI foundation
- Dark ModeUI foundation
- Data Visualization ColorUI foundation
- HueUI foundation
- LightnessUI foundation
- NeutralsUI foundation
- SaturationUI foundation
- Semantic ColorUI foundation