Most interfaces are not held back by a shortage of colour; they are drowning in it. This guide shows you how to build a palette from a handful of well-chosen values, spend your one accent carefully, and meet real contrast requirements instead of guessing.
Start with neutrals, not with colour
A good palette is mostly neutral. Before you pick a brand hue, decide on a near-white background, a near-black ink, and three to five greys in between. These carry the vast majority of your interface: text, borders, dividers, disabled states, surfaces. If the neutrals are right, the design reads as calm and considered even before any colour arrives.
Resist pure black (#000000) on pure white (#ffffff). The contrast is so extreme it causes halation — light text edges appear to shimmer or bleed on bright screens — and it feels harsh over long reading sessions. Pull both ends slightly inward: an ink around hsl(222 25% 12%) and a background around hsl(0 0% 99%), or a very soft off-white like hsl(40 20% 98%). The page still looks white and the text still looks black, but the eye relaxes.
- Background: near-white, e.g. hsl(0 0% 99%) or a faintly warm hsl(40 20% 98%).
- Ink (primary text): near-black with a touch of your brand hue, e.g. hsl(222 25% 12%).
- Greys: a consistent ramp — a 100 for subtle surfaces, a 300 for borders, a 500 for muted text, a 700 for strong secondary text.
- Tint the greys a few degrees toward one hue so they feel like a family, not a stock swatch set.
The 60-30-10 proportion
Colour balance is a question of proportion, not count. The classic interior-design rule transfers cleanly to UI: roughly 60% of the surface is your dominant neutral (background and large areas), 30% is a secondary neutral (cards, panels, bands of grey), and 10% is accent — buttons, links, selected states, the things a user should act on. Keep the accent near 10% and it stays meaningful. Let it creep to 40% and it stops signalling anything at all.
Build colours with HSL and a lightness ramp
Think in HSL (hue, saturation, lightness) rather than hex, because it maps to how you actually reason about colour: pick a hue, decide how vivid, then step the lightness up and down. Choose one accent hue — say orange at hsl(24 95% 53%) — and generate a ramp from 50 to 900 by moving lightness in roughly even steps while nudging saturation. A workable set: 50 very light tint for backgrounds, 500 the base, 700 for hover and text-on-light, 900 near-ink.
Keep lightness consistent across hues so your colours feel engineered rather than collected. If your accent-500 sits at about 53% lightness, your success-500 and error-500 should land near the same lightness. That consistency is what lets a tidy palette hold together, and it makes derived states predictable later.
- Hue: the colour itself, 0–360. Orange ~24, blue ~220, green ~145, red ~0/360.
- Saturation: intensity. Lower it slightly at the light and dark ends so tints do not look chalky and shades do not look muddy.
- Lightness: the ramp. Aim for even perceptual steps, not even numeric ones — the eye needs bigger jumps in the mid-range.
- Ship the ramp as tokens (accent-50 … accent-900), never as scattered hex values in components.
One accent, plus a distinguishable semantic set
One accent colour is almost always enough. It marks the primary action and the brand, and because it is rare, it reads instantly. A second accent is justified only when you have a genuine second axis of meaning — for example a distinct colour for a secondary or destructive-but-not-error path, or a data-visualisation palette where categories must be told apart. A second decorative colour added only for variety is a liability: it dilutes the first and forces the user to learn what each one means.
Alongside brand and neutral colours you need a small semantic set: success (green), warning (amber/yellow), error (red), and often info (blue). These must be distinguishable from each other and from the brand accent. The common trap is a brand that is already red or green colliding with error or success; when that happens, shift the semantic hue or its lightness so the two never read as the same signal. Define each with a light background tint and a readable foreground, not a single flat colour.
Do not lean on these hues to carry meaning on their own. Colour vision deficiency affects roughly 8% of men (about 1 in 12) and under 1% of women, and the most common form is red-green — exactly the pairing most status colours use. A red-only error and a green-only success can look identical to a large minority of your users.
Contrast: the WCAG numbers you must hit
Contrast is where opinion ends and measurement begins. WCAG 2 defines a contrast ratio from 1:1 (no contrast) to 21:1 (black on white). For AA compliance, body text needs at least 4.5:1 against its background. Large text — 24px and up, or 18.66px (14pt) and up when bold — may drop to 3:1. UI components and meaningful graphics (icons, input borders, focus rings, chart elements) also need 3:1 against adjacent colours. AAA raises body text to 7:1 and large text to 4.5:1.
Measure, do not eyeball. Use a contrast checker — browser devtools show the ratio in the colour picker, and standalone tools let you paste two values. Be aware of APCA (Advanced Perceptual Contrast Algorithm), the newer model slated for WCAG 3; it accounts for perception far better than the WCAG 2 formula, especially for thin text and light-on-dark, but it is not yet the legal standard. Design to WCAG 2 AA today and sanity-check with APCA where you can.
- Body text: 4.5:1 minimum (AA), 7:1 for AAA.
- Large text (≥24px, or ≥18.66px bold): 3:1 (AA), 4.5:1 for AAA.
- UI components, icons, borders, focus indicators, graphics: 3:1 against neighbours.
- Placeholder text and muted grey-on-grey are the usual failures — check them explicitly, they often land around 2–3:1.
Never rely on colour alone
Because so many users cannot reliably separate hues, colour must always be a reinforcement, never the only signal. Pair error red with an icon and a text message; mark a required field with an asterisk and a label, not just a red outline; in a chart, add direct labels, patterns, or distinct shapes rather than trusting the legend swatches. A simple test: convert the screen to greyscale. If any meaning disappears, you were relying on colour alone.
Derive states systematically, then do dark mode right
Interactive colours are not one value; they are a small system. Derive the states from the base rather than hand-picking each one. A reliable recipe: hover darkens the base by about 8–12% lightness, active (pressed) goes a little darker again, focus adds a visible ring at 3:1 rather than changing the fill, and disabled is expressed through reduced opacity or lowered contrast — never by inventing a new muddy colour. Deriving states from one base keeps the whole set coherent and makes dark mode far easier.
Dark mode is a separate design, not an inversion. Flipping light values to dark produces harsh, oversaturated, vibrating results. Start from a dark-grey surface — something like hsl(222 18% 12%) — not pure black, which crushes elevation and causes the same halation as pure white in reverse. Desaturate and lighten your accents: a hue that reads well on white is usually too intense on a dark field, so lower its saturation and raise its lightness until it sits comfortably.
In dark mode, elevation is shown by lightening surfaces, not by heavier shadows. A card sits above the background because it is a step lighter; a popover above that is lighter still. Re-check every contrast ratio in dark mode independently — light-on-dark and dark-on-light do not behave symmetrically, and a pairing that passes in one theme can fail in the other.
How to build a palette, step by step
- Choose your neutrals first: a near-white background, a near-black ink (both pulled slightly off the extremes), and a 3–5 step grey ramp, lightly tinted toward one hue.
- Pick a single accent hue in HSL and generate a 50–900 lightness ramp with even perceptual steps and softened saturation at the ends.
- Define your semantic set — success, warning, error, info — at matching lightness, and shift any hue that collides with the brand accent.
- Check every text and UI pairing against WCAG AA (4.5:1 body, 3:1 large and components) with a contrast checker; fix failures by adjusting lightness, not by adding hues.
- Derive interactive states from each base: hover −8 to −12% lightness, active darker, focus ring at 3:1, disabled via reduced opacity.
- Build the dark theme as its own palette: dark-grey surfaces, desaturated lighter accents, elevation by lightness; re-run every contrast check.
- Ship it all as named tokens and verify meaning survives a greyscale pass.
Common mistakes
- Too many hues — a palette that looks like a rainbow has no focus and nothing reads as important.
- Low-contrast grey-on-grey text — it looks elegant in Figma on a bright monitor and is unreadable for many users in real light.
- Pure black on pure white — causes halation and eye strain; pull both ends slightly inward.
- Overusing the accent until it stops meaning 'act' — keep it near 10% of the surface so it still commands attention.
- Conveying meaning by colour alone — always add an icon, label, shape, or text so status survives for colour-blind users and in greyscale.
- Inverting the light theme for dark mode — build dark mode as a deliberate palette with dark-grey surfaces and desaturated accents.