Skip to content
← Color Tools

Tailwind v4 OKLCH Palette

Generate a Tailwind v4 compatible 50-950 palette from one brand color, perceptually spaced in OKLCH.

Tailwind v4 OKLCH Palette

Generate a Tailwind v4 compatible 50-950 palette from one brand color, perceptually spaced in OKLCH.

Why Tailwind v4 Moved to OKLCH

Tailwind v3 used HSL for its default color palettes (slate, gray, zinc, red, blue, and so on), with the 50-to-950 numeric scale corresponding to specific HSL lightness values per hue. The problem was that HSL is not perceptually uniform: the same HSL lightness step looks like a bigger change on yellow than on blue. The result was that the canonical Tailwind palettes felt right because they had been hand-corrected, but custom brand palettes generated by Tailwind config plugins always felt slightly off in the middle stops. Tailwind v4 fixed this by moving its color system to OKLCH, where equal numerical lightness steps look equally different to the eye regardless of hue. The new palettes use OKLCH lightness values from 0.98 (the 50 stop) down to 0.20 (the 950 stop), with chroma scaled per stop to maintain perceptual richness. Custom palettes generated to match this OKLCH spacing feel as polished as the built-in palettes, which is the main reason to migrate brand colors from manual HEX values to the v4 OKLCH generator.

How the Generator Picks Each Shade

Paste a brand color in any CSS format. The tool extracts its OKLCH hue and uses that hue as the anchor for the entire 11-stop palette. Lightness values for each stop follow Tailwind v4 canonical spacing: 0.98, 0.95, 0.90, 0.83, 0.72, 0.60, 0.50, 0.42, 0.33, 0.25, 0.18 for stops 50, 100, 200, 300, 400, 500, 600, 700, 800, 900, 950 respectively. Chroma is computed per stop using a curve that peaks around the 500 stop (matching the brand input) and tapers toward the lighter and darker ends, which is the pattern the Tailwind built-in palettes use. The 500 stop is calibrated to match the brand color as closely as possible while staying on the same hue line; if your brand color is significantly more or less saturated than typical Tailwind palettes, the 500 stop preserves the saturation and the surrounding stops adapt accordingly. The output is a drop-in tailwind.config.js block with all 11 stops named per Tailwind convention, plus a CSS custom property block for the same values if you prefer raw CSS variables over Tailwind config.

Migrating From v3 HSL Palettes

Two migration strategies exist. The full migration replaces v3 HSL palette values with v4 OKLCH-generated equivalents, which gives the cleanest result but requires visual review of every component that uses the brand color. The gradual migration generates new OKLCH palettes for new components while leaving existing v3 HSL palettes in place; this is the safer path for large codebases because it limits regression risk. Either way, the tool gives you the OKLCH values to feed into Tailwind v4 config, and the resulting palette will feel cohesive with the built-in v4 palettes (which the tool matches in spacing). For projects still on Tailwind v3 the OKLCH palette can still be useful: paste the values as HEX into the v3 config, accepting that v3 will not interpolate them in OKLCH at runtime but the static values are still better-spaced than v3 HSL output. Tailwind v3 with OKLCH-computed HEX values is a common intermediate state during the upgrade.

Frequently Asked Questions

How is this different from Tailwind Color Scale?+
Tailwind Color Scale generates a Tailwind v3-style scale using HSL, which matches the v3 built-in palettes. The Tailwind v4 OKLCH Palette generates a v4-compatible scale using OKLCH, which matches the v4 built-in palettes. Use the v3 tool for projects still on Tailwind v3 and the v4 tool for Tailwind v4 projects.
Will the v4 palette work in Tailwind v3 if I paste it as HEX?+
Yes. The OKLCH lightness spacing produces visibly better results than HSL even when consumed as static HEX in v3 config. You lose the runtime OKLCH interpolation that v4 enables, but the per-shade values are still more perceptually consistent than v3 HSL output.
What lightness values does the tool use?+
0.98, 0.95, 0.90, 0.83, 0.72, 0.60, 0.50, 0.42, 0.33, 0.25, 0.18 for the 11 stops from 50 to 950. These values match the spacing used by the Tailwind v4 built-in palettes. The curve is steeper at the dark end than the light end, which matches how the eye perceives lightness changes.
Why does the 500 stop sometimes look different from my brand color?+
The 500 stop is calibrated to match the brand color in OKLCH hue and chroma, but the lightness is constrained to 0.60 to match the v4 spacing. If your brand color has a lightness significantly above or below 0.60 in OKLCH, the 500 stop preserves the hue and chroma but adjusts the lightness; the closest match to the exact brand color will be the stop with matching lightness (often 400 or 600).
Can I customize the lightness curve?+
The default curve matches v4 built-in palettes for cross-palette consistency. For custom curves the output is editable: copy the generated values, adjust the lightness values you want to change, and the result is still valid Tailwind v4 config. The default exists because most projects benefit from matching the v4 built-in palette spacing.
Does the palette work for grayscale colors?+
Yes, with low input chroma producing a near-grayscale 11-stop palette. The chroma curve scales with the input, so a near-gray brand color produces a near-gray palette and a saturated brand color produces a saturated palette. The Tailwind v4 built-in slate, gray, zinc, neutral, and stone palettes are good references for what near-grayscale OKLCH palettes look like.
Is the palette gamut-safe?+
All stops fit within sRGB by default; the chroma values are clamped to stay in-gamut for the chosen hue. A toggle enables Display P3 mode, which raises the chroma cap and produces more vivid stops on capable screens with graceful fallback on sRGB-only screens. Default sRGB mode is the right pick for cross-platform consistency.
What does the tailwind.config.js output look like?+
A theme.extend.colors block with a named color (default brandColor) and 11 nested entries from 50 to 950, each with its computed OKLCH value as a hex fallback or oklch() syntax depending on the output toggle. The block is drop-in compatible with Tailwind v4 config; paste it into your config file and the new color is available as brandColor-50 through brandColor-950 in utility classes.

Built by Derek Giordano · Part of Ultimate Design Tools

Privacy Policy · Terms of Service