Skip to content

Palette generator

Turn one colour into an 11-step OKLCH scale where contrast follows the step numbers: any two steps 500 apart pass AA, whatever the hue. Everything runs in your browser, and the link keeps your choices.

Runs in your browserOKLCH11 steps

Colour

Hex or oklch(), such as #6366f1 or oklch(0.6 0.2 277).

Used in the export, as --brand-500.

Puts it in step 500, the closest match. Turn this off for exact step contrast.

Greys with a trace of the same hue, for text, borders and surfaces.

brand scale

Each step of the brand scale, with its colour values and contrast on white and on black.
StepColourOn whiteOn blackCopy
50#f7f8ff1.05Low: check #f7f8ff on white19.82AAA: check #f7f8ff on black
100#e7ebff1.18Low: check #e7ebff on white17.72AAA: check #e7ebff on black
200#c8cff41.53Low: check #c8cff4 on white13.68AAA: check #c8cff4 on black
300#9fa9eb2.24Low: check #9fa9eb on white9.34AAA: check #9fa9eb on black
400#7b85eb3.28Large: check #7b85eb on white6.39AA: check #7b85eb on black
500#6366f1Your colour4.46Large: check #6366f1 on white4.70AA: check #6366f1 on black
600#4e4cd16.40AA: check #4e4cd1 on white3.27Large: check #4e4cd1 on black
700#3c37ad8.96AAA: check #3c37ad on white2.34Low: check #3c37ad on black
800#2c258812.15AAA: check #2c2588 on white1.72Low: check #2c2588 on black
900#1b146115.91AAA: check #1b1461 on white1.31Low: check #1b1461 on black
950#0f054518.61AAA: check #0f0545 on white1.12Low: check #0f0545 on black

AAA is 7:1, AA is 4.5:1, and Large is 3:1, enough for large text and UI components. Select a ratio to open that pair in the contrast checker.

Step rules

Subtract the step numbers to know if a pair passes.

  • 400 apart: 3:1UI components and large textPass
  • 500 apart: 4.5:1Normal text, AAPass
  • 700 apart: 7:1Normal text, AAAPass
Text on white, AA
600 and darker
Text on black, AA
500 and lighter

In use

On a light surface

ButtonWhite on brand-6006.40:1 AA
Badgebrand-700 on brand-1007.56:1 AAA
Calloutbrand-800 on brand-5011.47:1 AAA

On a dark surface

Buttonbrand-950 on brand-4005.67:1 AA
Badgebrand-200 on brand-8007.92:1 AAA
Calloutbrand-100 on brand-90013.43:1 AAA

The preview is not interactive. Each ratio is measured on the colours shown.

Export

brand-theme.css
@theme {
  --color-brand-50: oklch(0.981 0.009 277.1);
  --color-brand-100: oklch(0.944 0.027 277.1);
  --color-brand-200: oklch(0.862 0.052 277.1);
  --color-brand-300: oklch(0.752 0.096 277.1);
  --color-brand-400: oklch(0.655 0.151 277.1);
  --color-brand-500: oklch(0.585 0.204 277.1);
  --color-brand-600: oklch(0.501 0.198 277.1);
  --color-brand-700: oklch(0.423 0.181 277.1);
  --color-brand-800: oklch(0.347 0.157 277.1);
  --color-brand-900: oklch(0.264 0.128 277.1);
  --color-brand-950: oklch(0.199 0.109 277.1);
}

How it works

Steps spaced by contrast

Most scales space their steps by lightness. Two colours at the same lightness can still differ in WCAG contrast, so a yellow 500 and a blue 500 behave differently and every pair needs checking. This scale spaces its steps by contrast instead. Each step has a position on a logarithmic axis from white to black, and the generator finds the OKLCH lightness that reaches it for your hue and chroma. On that axis the ratio between two steps depends only on how far apart they are.

What the step numbers tell you

The contrast guaranteed by the distance between two steps
Steps apartAt leastEnough for
4003:1Large text, icons, borders and focus rings
5004.5:1Normal text, AA
7007:1Normal text, AAA

Step 500 passes AA on both white and black, so steps 500 to 950 work as text on white, and steps 50 to 500 as text on black. Every scale shares the same positions, so the rules also hold between two scales built here, such as your colour on its neutral. Ratios are measured on the final hex values, so rounding can't hide a failure.

Your exact colour

A brand colour rarely sits exactly on a step, so “Keep my exact colour” swaps it into the closest one. That step then has the contrast your colour has, which can break a rule. The Step rules panel tests the real colours and names any pair that fails, and each ratio in the table opens that pair in the contrast checker. Turn the option off to get the generated step back.

Hue and chroma

Every step keeps your hue. Chroma peaks at your colour and eases off towards both ends, more on the light side so tints stay usable as backgrounds. Colours are kept inside sRGB, so a step gets less chroma when a screen couldn't show more at that lightness. The neutral scale uses at most 0.02 chroma, so it stays grey but sits comfortably next to your colour.

The exports

The Tailwind export is a @theme block for Tailwind CSS v4, which gives you utilities such as bg-brand-500. The DTCG export follows the 2025.10 colour format, with OKLCH components and a hex fallback. OKLCH values are rounded for reading, so hex is the exact colour the ratios describe.

Not covered yet

  • Wide-gamut colours. Scales are sRGB only, so Display P3 chroma is left out.
  • Hue shifts across the scale, such as warmer tints and cooler shades.
  • More than one base colour at once. Build each scale and combine the exports.
  • APCA, the contrast method proposed for WCAG 3. WCAG 2.2 is what audits and laws refer to today.