Tailwind v4 Color Palette (OKLCH)
Generate a 50 to 950 colour scale from a single base colour. The output is an @theme block of CSS variables for Tailwind CSS v4, in OKLCH or hex, with a visual preview.
Use the tool
Why this tool exists
Tailwind v4 moves theme configuration into CSS, and its default palette is written in OKLCH, a colour space where lightness steps look even to the eye. If you want your own brand colour to behave like the built-in ones, with a 50 to 950 scale, you need to calculate every shade.
Pick a base colour and a name, and the tool produces eleven steps with lightness and chroma adjusted along the scale, wrapped in an @theme block with --color-name-50 to --color-name-950 variables. Switch to hex if you need values for tools that do not understand OKLCH, and a hex fallback list is included. The scale is generated by a formula, so review it for contrast against your backgrounds before shipping. Nothing is uploaded.
How to use it
- Enter a colour name, for example brand, and pick the base colour.
- Choose OKLCH or hex for the values.
- Check the swatches in the preview.
- Copy the @theme block into your Tailwind v4 CSS file.
Frequently asked questions
Where do I put the output?
In your main CSS file after importing Tailwind. Variables named --color-brand-500 make utilities like bg-brand-500 and text-brand-700 available automatically in Tailwind v4.
Why OKLCH?
OKLCH is perceptually even, so steps in lightness look consistent across hues, and it can express colours outside sRGB on wide-gamut screens. Tailwind v4's own palette uses it.
Will the scale match Tailwind's default colours?
No. It is generated from your base colour with a formula and will not equal hand-tuned palettes. Check contrast and adjust individual steps where needed.
Which step is my base colour?
The step closest to your base lightness is marked with a base comment in the output, so you can see where your original colour sits in the scale.