UI Design · Lesson 05 / 12
Color in UI
Colour theory for interfaces: hue, saturation and lightness, building a palette and tonal scales, assigning colour roles, the 60-30-10 rule, WCAG contrast, colour blindness and cultural meaning.
4 min read · 5 quiz questions
What colour does in UI
In interfaces, colour has jobs. It creates hierarchy (the accent button stands out), communicates meaning (red for errors, green for success), shows state (selected, disabled, hovered), groups related elements, and expresses the brand.
Because colour is so powerful, the best UIs use it with restraint: mostly neutrals, one accent for actions and highlights, and a small set of status colours.
Colour basics: HSL
It's easier to design with colour when you think in HSL instead of hex codes:
| Property | What it is | Range |
|---|---|---|
| Hue | The colour itself, as a position on the colour wheel | 0–360° (0 red, 120 green, 240 blue) |
| Saturation | How vivid or grey the colour is | 0% (grey) – 100% (pure colour) |
| Lightness | How light or dark it is | 0% (black) – 100% (white) |
/* Same hue, different lightness = a tonal scale */
--blue-100: hsl(216 92% 94%);
--blue-500: hsl(216 92% 52%); /* ≈ #146ef5 */
--blue-700: hsl(216 85% 35%);Pure grey (0% saturation) can feel cold and lifeless. Many designers add a tiny bit of the brand hue or a warm tint to neutrals.
Building a palette
- 1Pick a primary (brand) colour for actions and key highlights.
- 2Choose neutrals for text, backgrounds, borders and surfaces — they'll make up most of the UI.
- 3Add semantic colours: success (green), warning (amber/orange), error (red), info (blue).
- 4Generate tonal scales for each, usually 50 (lightest) to 900 (darkest), so you have light tints for backgrounds and dark shades for text.
- 5Test contrast for every text/background combination you plan to use.
Live preview
blue
50
100
200
300
400
500
600
700
800
900
gray
50
100
200
300
400
500
600
700
800
900
Colour roles
Assign colours to roles, not to individual screens. Roles become tokens in your design system and keep usage consistent.
| Role | Typical colour | Used for |
|---|---|---|
| Background | White or very light neutral | Page background |
| Surface | White / neutral-50 | Cards, sheets, menus |
| Text primary | Neutral-900 | Headings, body text |
| Text secondary | Neutral-600 | Descriptions, metadata |
| Border | Neutral-200 | Dividers, input borders |
| Primary action | Brand-500 / 600 | Main buttons, links, selected states |
| Error | Red-600 | Error messages, destructive actions |
| Success | Green-600 | Confirmations |
The 60-30-10 rule
Borrowed from interior design, the 60-30-10 guideline is a quick way to balance colour: about 60% dominant colour (usually neutrals/background), 30% secondary colour (surfaces, sections), and 10% accent (buttons, highlights).
It's not a strict formula, but it prevents the two most common problems: an accent colour that's everywhere (so nothing stands out) and a UI with no clear dominant tone.
Contrast and accessibility
Text must contrast enough with its background to be readable — for people with low vision, on a phone in sunlight, or on a cheap screen. The WCAG 2.2 guidelines define minimum contrast ratios:
| Content | Level AA | Level AAA |
|---|---|---|
| Normal text | 4.5:1 | 7:1 |
| Large text (≥ 24px regular or ≥ 18.66px bold) | 3:1 | 4.5:1 |
| UI components and graphics (borders of inputs, icons) | 3:1 | — |
Live preview
Readable text?
1.7:1 — fails AA
Readable text?
5.6:1 — passes AA
Readable text?
4.6:1 — passes AA
Common mistake: Light grey placeholder or helper text on white. It looks elegant in design files and fails contrast for many users. Check it with a contrast tool (Figma plugins, WebAIM Contrast Checker, or browser dev tools).
Colour blindness
Around 1 in 12 men and 1 in 200 women have some form of colour vision deficiency, most commonly difficulty distinguishing red and green.
- Never use colour alone to convey meaning. Add icons, text labels or patterns.
- Error fields: red border plus an error icon plus a message.
- Charts: use labels, different line styles, or colours that differ in lightness as well as hue.
- Test designs with colour-blindness simulators (available in Figma plugins and browser dev tools).
Meaning, culture and brand
- Common conventions: red = error/danger/stop, green = success/go, amber = warning, blue = information/links.
- Meanings vary by culture — red signals luck and celebration in China; white is associated with mourning in some cultures. In financial apps, some markets use red for price increases. Know your audience.
- Keep the primary colour for actions, so users learn that "this colour = I can click it".
- Brand colours aren't always suitable for UI. A light yellow brand may need a darker shade for text and buttons to pass contrast.
Do
- Use mostly neutrals and one accent.
- Define colours as roles/tokens.
- Check contrast for every text colour.
- Pair colour with icons or text for meaning.
Don't
- Use the accent colour for decoration everywhere.
- Rely on red vs green alone.
- Use pure black #000 text on pure white for long reading — a near-black is softer.
- Pick a palette only because it looks good on Dribbble.
Key takeaways
- Colour creates hierarchy, meaning, state and brand — use it with restraint.
- Think in HSL and build tonal scales (50–900) for brand, neutrals and status colours.
- Assign colours to roles (text, surface, border, action, error) and reuse them.
- Meet WCAG AA contrast: 4.5:1 for normal text, 3:1 for large text and UI components.
- Never use colour as the only signal; consider colour blindness and culture.
Exercise
Build an accessible palette
- Pick a brand colour and generate a 50–900 scale (use a tool like Figma's colour picker or an online scale generator).
- Create a neutral scale with a slight tint of the brand hue.
- Define 8 roles (background, surface, text primary/secondary, border, action, error, success).
- Check the contrast of every text role on its background and fix failures.
- Design one card and one form with only these roles.
Test yourself
Color in UI quiz
5 questions. Score 70% or more to complete the lesson.
