Color Systems
A structured palette of ramps and semantic aliases, so colour decisions are made once rather than per screen.
Definition
A colour system organises raw colour values into ramps, then maps those ramps to semantic roles through tokens. Designers and engineers consume the roles, not the raw values.
Craft convention. True because the industry converged on it. Breaking it costs familiarity, not correctness.
On this plate
Reach for this when
- Starting a design system.
- Adding dark mode or a second brand.
- Consolidating a palette that has grown organically.
- The palette exists and components are about to start consuming it.
Common mistakes
- Components referencing primitive tokens.
- Semantic names that describe appearance rather than role.
- Ramps generated without contrast verification.
Building one
- 1
Choose hues
One neutral, one accent, four semantic. Add more only when a real need appears.
- 2
Generate ramps
Nine to twelve steps per hue, stepping perceptual lightness at consistent chroma.
- 3
Verify contrast
Produce a matrix of every foreground and background pair, and mark which combinations are permitted.
- 4
Define semantic tokens
Map roles such as surface, surface-raised, text-primary, border-subtle and action-primary onto ramp steps.
- 5
Define the dark theme
Remap the same semantic tokens to different ramp steps. Never invert values arithmetically.
- 6
Document usage
State which token to use in which situation, with examples of the wrong choice.
Three-layer token structure
:root {
/* 1. Primitives: raw values, never used directly in components */
--neutral-50: oklch(0.985 0.002 90);
--neutral-600: oklch(0.505 0.010 90);
--neutral-900: oklch(0.215 0.012 90);
--accent-600: oklch(0.560 0.170 38);
/* 2. Semantics: meaning, remapped per theme */
--surface: var(--neutral-50);
--text-primary: var(--neutral-900);
--text-secondary: var(--neutral-600);
--action: var(--accent-600);
}
[data-theme="dark"] {
--surface: oklch(0.180 0.008 90);
--text-primary: oklch(0.960 0.003 90);
--text-secondary: oklch(0.720 0.010 90);
--action: oklch(0.700 0.150 38);
}
/* 3. Components consume semantics only */
.button-primary { background: var(--action); }Primitives hold values, semantics hold meaning, components consume semantics. Only the middle layer changes between themes.
Keeping the layers honest
Do
- Let components reference semantic tokens only.
- Name semantic tokens for their role and surface, such as text on subtle background.
- Add a primitive only when no existing one fits, and record why.
- Test a theme swap early, which is the fastest way to find leaks.
Do not
- Let a component import a raw palette value, which makes theming impossible later.
- Create a semantic token used in exactly one place.
- Encode the hue in the semantic name, which is how brand-danger-green happens.
In practice
- i.
Themes as token remapping
Multi-brand productsA product supporting several brands changes only the semantic layer per brand. Component code never changes, which is what makes multi-brand maintainable at all.
- ii.
The leak found by dark mode
Why theming is the testEleven components looked correct until dark mode shipped, at which point each one that had reached past the semantic layer to a raw grey appeared as a bright patch. The leak existed all along; the theme is what made it visible.
Local chart
FND·026 · Region II · Grid C1
This entry and the entries it is stated to connect with. Each line is labelled with what the connection means.
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.
Often used with
These usually appear in the same screen or the same decision.
- Style DictionaryTOOL·040 · Tool
Short definition
The one-paragraph version, for when that is all you need.
- Design TokenTERM·071 · Term
- OKLCHTERM·065 · Term
Related concept
Connected closely enough to change how you apply this.
- Design System GovernanceSYS·004 · Design system
- Design TokensSYS·001 · Design system
- ThemingSYS·008 · Design system
- Brand Color in InterfacesFND·024 · UI foundation
- Color AccessibilityFND·028 · UI foundation
- Color Theory for InterfacesFND·019 · UI foundation
- Dark ModeFND·027 · UI foundation
- LightnessFND·022 · UI foundation
- NeutralsFND·025 · UI foundation
- Semantic ColorFND·023 · UI foundation