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.
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
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
On a dark surface
The preview is not interactive. Each ratio is measured on the colours shown.
Export
@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
| Steps apart | At least | Enough for |
|---|---|---|
| 400 | 3:1 | Large text, icons, borders and focus rings |
| 500 | 4.5:1 | Normal text, AA |
| 700 | 7:1 | Normal 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.