Skip to content

How to choose a colour palette for a website

One brand scale, one neutral scale and a few status colours, with steps assigned by measured contrast. Tailwind’s own scales measured in light and dark.

Updated 23 November 2026Tested with
  • Tailwind CSS 4.3.5 palette
  • WCAG 2.2 contrast

A website palette needs fewer colours than most people start with: one brand colour in a full scale of light to dark steps, one neutral scale for text, borders and backgrounds, and three or four status colours. Pick the brand colour, build its scale, then choose which steps do which job by measuring contrast, not by eye. That last step is where most palettes fail.

This is how we pick colours for our own themes, with the numbers we measured along the way.

What a palette actually contains

RoleHow manyUsed for
Neutral scale1 scale, about 11 stepsText, muted text, borders, backgrounds, panels. Most of every page.
Brand colour1 scalePrimary buttons, links, focus rings, small accents
Status colours3 or 4 (error, warning, success, info)Form errors, alerts, badges
Accent0 or 1Only if the brand truly has two colours

The neutrals do most of the work. On a typical page of our themes, the brand colour shows up in a handful of places: the main button, links, maybe a badge. That restraint is what makes it noticeable when it does appear.

Pick the colours in five steps

  1. Step 1: Start from one brand colour

    Take the colour from the logo or the brand guide. If there isn't one, pick the hue first (blue, green, orange) and worry about the exact shade later; the scale step fixes it. Avoid starting with a very light or very dark colour, because you'll need both directions.

  2. Step 2: Build a scale of 11 steps

    Tailwind's convention is 50, 100, 200 and so on to 950. A good scale changes lightness in even steps and lowers the saturation near both ends, so the 50 is a soft tint and the 950 isn't neon. We build ours in oklch, where equal lightness steps look equal. Our free palette generator does exactly this from one hex value and puts your colour on the step where its lightness belongs:

    The themes.dev palette generator showing an 11-step blue scale from 50 to 950, with the input colour on step 600
    One colour in, a 50 to 950 scale out. The input #3e63dd landed on step 600, and the tool copies the scale as a Tailwind v4 @theme block.
  3. Step 3: Choose a neutral with a hint of the brand

    Pure grey works, but a neutral with a tiny bit of the brand's hue feels more deliberate. Tailwind ships five: slate (blue), gray (cool), zinc (a touch of violet), neutral (none) and stone (warm). Pick the one closest to your brand's temperature: a blue brand sits well on slate or zinc, an orange one on stone.

  4. Step 4: Assign steps by contrast

    This is the step that matters. WCAG asks for 4.5:1 between normal text and its background, and 3:1 for large text (about 24px, or 19px bold) and for borders of controls. We measured Tailwind v4's own blue and zinc scales against white:

    StepBlue on whiteZinc on white
    4002.64:12.62:1
    5003.76:14.83:1
    6005.25:17.72:1
    7006.83:110.43:1

    So with white text, blue-500 fails for body text (3.76:1, enough only for large text) and blue-600 passes. Zinc-500 is the lightest grey that passes for muted text; zinc-400 is for borders and placeholder hints that aren't the only way to read something. Write those choices down as roles: primary is 600, muted text is 500, borders are 200.

  5. Step 5: Choose the dark mode steps separately

    Dark mode isn't the same steps reversed. On a near-black background (zinc-950), the numbers flip: blue-500 gets 5.29:1 and passes, blue-600 drops to 3.79:1, and blue-700 to 2.91:1. So a dark theme usually takes its primary from one or two steps lighter, with dark text on the button instead of white. We go through the code side of that in adding a colour to a shadcn theme.

Mistakes we see most

  • Too many brand colours. Three equally strong colours means none of them signals "click here". Keep one for actions.
  • Status colours that clash with the brand. A red brand makes error messages invisible. Shift the error colour toward crimson or the brand toward coral, so they stay apart.
  • Grey text on a grey panel. Muted text that passes on white can fail on a panel. Zinc-500 on zinc-100 has less contrast than on white; check the actual pair.
  • Saturated or dark backgrounds everywhere. Big fields of strong colour tire the eye and make every other element fight for attention. We keep grounds white or near-white and let photography and type carry the mood.

Turning the palette into tokens

Name colours by their job, not their hue, once they're in code: --primary, --muted-foreground, --border, --destructive. Then a rebrand changes values, not class names. That's how shadcn/ui themes work, and how every block in UI Pro picks up your palette. In Tailwind v4, adding the scale itself is one @theme block.

Questions

How many colours should a website have?

One brand colour, one neutral scale and three or four status colours covers almost every site. Count scales, not shades: a scale of 11 steps is still one colour.

What is the 60-30-10 rule?

An interior design rule of thumb: 60% dominant colour, 30% secondary, 10% accent. On websites the dominant 60% is usually white or a neutral, and the brand colour sits well under 10%. Treat it as a reminder to keep the accent small.

Should I use oklch or hex?

Either works in CSS. Build and adjust scales in oklch, where lightness behaves predictably; hand hex values to tools or people who need them. Tailwind v4's own palette is defined in oklch.

Was this page helpful?

Still stuck? We answer every message ourselves. Write to us

This page is built from UI Pro parts: the docs article block (docs-quernly) with the code, terminal, install command, steps, contents and feedback components. They ship in the next UI Pro release; the install command and the contents rail are free.