Skip to content
CornerTools

Color Palette Generator

Generate colour palettes from one colour or at random, lock the ones you like, and get a Tailwind 50–950 shade scale to copy as CSS.

  • Aa 6.09:1 with black text
  • Aa 9.01:1 with black text
  • Aa 4.6:1 with black text
  • Aa 9.8:1 with black text
  • Aa 4.61:1 with white text

Locked colours stay. A swatch's menu moves it.

Export

Values
@theme {
    --color-1: #0a9b8d;
    --color-2: #50bab2;
    --color-3: #9f5f9d;
    --color-4: #e29ad3;
    --color-5: #ac6149;
}

Makes colour palettes of 3 to 8 colours, at random or from a harmony around a base colour, and turns any colour into a shade scale from 50 to 950 on Tailwind's own lightness curve. Lock the colours you want to keep, generate again, undo and redo, and copy the result as a Tailwind v4 @theme block, a Tailwind v3 colors object, CSS variables or JSON. Everything runs in your browser.

How to use it

In Palette, choose a Harmony and, for every harmony but Random, a Base colour. Generate (or Space, while no field or button has the focus) replaces every colour not locked; Undo and Redo (Ctrl+Z, Ctrl+Shift+Z) step through the palettes made. Changing the harmony or the base makes a new palette at once.

Each swatch shows Aa in white or black, whichever reads better on it, with that contrast ratio. Type or pick a colour into its field, Lock it so Generate keeps it, or open its menu: Shades opens the Shades mode from it, Move left and Move right (Move up and Move down where the swatches stack, on a phone) reorder it (dragging does too), Check contrast and Open in Color Converter take it to those tools, and Remove drops it. Add colour adds one that fits the rest.

In Shades, give a Base colour and a Name for the tokens. The table gives each shade's HEX, OKLCH and its contrast with white and black text, with the base marked. Copy as and Values (HEX or OKLCH) set the export, remembered on this device; Share gives a link with the palette, its locks, the harmony and the shade settings.

How it works

Colours are made in OKLCH, whose lightness looks the same at every hue: a yellow and a blue at the same OKLCH lightness look equally light, which HSL does not manage. A harmony places hues at fixed angles from the base: analogous fans out 30° a step, complementary adds 180°, split complementary 150° and 210°, triadic 120° and 240°, square every 90°. The base itself takes its place in the palette, and the other colours vary lightness and chroma a little around it, so each press of Generate gives a variation. A hue used again is lighter, then darker. Monochrome keeps the base's hue and spreads lightness; a grey has no hue, so every harmony of a grey gives greys.

Random draws a base colour of any hue, lightness from 0.35 to 0.95 and chroma from 0.04 to 0.2, and one of the harmonies above, so each palette it makes still holds together. Every new colour keeps at least 0.08 (ΔE in OKLab) from the others, locked ones included; each tries up to 200 candidates, and where locked colours leave no room the tool keeps the farthest and says so. Every colour is mapped into sRGB by reducing its chroma alone, keeping lightness and hue, so its HEX is the colour shown.

A shade scale places the base at the shade whose Tailwind lightness is nearest its own. The other shades take Tailwind's mean lightness, rescaled so the base lands exactly: lighter shades between the base and Tailwind's 50, darker ones between it and Tailwind's 950. Chroma follows Tailwind's chroma profile relative to the base's shade, and hue is held. A shade outside sRGB loses chroma to fit, named under the table, and neighbouring shades stay at least 1.5% apart in lightness so none repeats a HEX.

Examples

Shades of #2563eb

Base colour
#2563eb
50
#f4f8ff
500
#6a9cff
950
#0b2459

Its OKLCH lightness is nearest Tailwind's 700, so it becomes 700, not 600 as in Tailwind v3's blue. White text on its 500 reaches 2.69:1.

A triadic palette from a brand blue

Harmony
Triadic (120°, 240°)
Base colour
#2563eb
#2563eb
hue 263°
#c63e41
hue 23°
#2b9b00
hue 140°

The base, at hue 263°, stays as it is; the other two sit about 120° and 240° round from it. Their lightness and chroma vary with each press of Generate, so your colours will differ a little.

Tailwind's lightness curve

Mean OKLCH lightness and relative chroma per shade over Tailwind 4.1.18's 17 chromatic palettes
ShadeLightnessChroma (share of peak)
5097.7%8%
10095%20%
20090.5%38%
30084%63%
40075.3%86%
50068.3%95%
60059.8%93%
70051.5%81%
80044.6%67%
90039.5%54%
95027.8%38%

Frequently asked questions

Tailwind v4 reads colours from CSS: paste the @theme block into your main stylesheet, and bg-brand-500 and the rest work. Tailwind v3 reads them from tailwind.config.js: put the colors object under theme.extend.
The table shows each shade's contrast with white and black text and the WCAG level it reaches. Body text needs 4.5:1 (AA); check other pairs in the Contrast Checker.
A colour typed in another format is rounded to whole bytes per channel for its HEX, and a generated colour outside sRGB is mapped into it. A shade is mapped the same way, which can reduce its chroma.

See also