03.3.4 · Skill in UI design

Color

Using color for meaning, emphasis and brand, with enough contrast.

Color in interfaces should carry meaning, such as state, emphasis or category, more than decoration. Limited palettes with defined roles keep things consistent. Contrast has to work for everyone, including in dark mode.

Your status · Color

Saved in this browser. Sign in to keep it on every device.It colours this skill's tile on your map.

Why it matters for a product engineer

Colour in an interface should mean something: a state, an action, a category, a warning. A small palette with defined roles keeps the product consistent and easy to read. Contrast has to work for everyone, in light and dark mode. Engineers turn the palette into tokens, so they decide whether the rules hold everywhere.

How to do it

  1. Define a small palette, and give each colour a role: text, background, action, success, warning, error.
  2. Store the colours as tokens with names that describe the role, such as danger, not red-500.
  3. Check contrast for every pair of text and background, including on images and in dark mode. Normal text needs a ratio of at least 4.5 to 1.
  4. Never use colour as the only signal. Add an icon, a label or a pattern.
  5. Build dark mode from the same roles, with colours checked again, not inverted.
  6. Add a check to the build that fails on a raw colour value outside the tokens.

Common mistakes

  • Grey text that looks elegant and is hard to read.
  • Red and green as the only difference between two states.
  • Many near-identical colours that nobody chose on purpose.
  • Light text on a light, animated background.
  • Dark mode made by inverting colours.

Example

RelievApp uses ten colours and no others, each with a meaning: coral is the hard end, sun is energy that works for you, mint is settled. A session moves from its hard colour to its settled one, so the colour itself shows the change. An earlier audit had found the opposite problem: white text over a pale mint sphere that almost disappeared. (RelievApp in In practice)

Numbers

Low contrast text on the top million home pages, 2026

83.9%
Home pages with low contrast text
34
Distinct cases per page, on average
Up 15% from 2025

Low contrast is the most common accessibility failure on the web, and it is a colour decision.

MeasuredWebAIM, The WebAIM Million, 2026 report

Sources: Color and contrast (web.dev) ↗ · The WebAIM Million, 2026 report (WebAIM) ↗

In practice

Real products

Resources

2
  • courseStart here
    Color and contrast ↗
    web.dev (Google) · 2022 · 8 min

    How contrast ratios work, the WCAG thresholds, and the tools that check them for you.

  • articleGo deeper
    Building a color scheme ↗
    Adam Argyle (web.dev) · 2021 · 15 min

    Building a light and dark palette in CSS with enough contrast in both, step by step.

Tools

1