All Posts

Between the Tailwind Palettes

Generating new Tailwind color palettes through OkLCh interpolation using only hue as input.

Tailwind CSS v4 changed how colors are defined: from sRGB hex values to OkLCh notation, using the wider Display P3 gamut.

OkLCh is perceptually uniform, which makes color manipulation simpler and more predictable, and P3 makes the colors more vibrant.

This change opened up an interesting possibility: what if we could generate entirely new Tailwind-like palettes by interpolating between existing ones?

New Palettes

Tailwind v4 ships with 17 accent palettes (red, blue, green, etc.) and 5 neutral palettes (slate, gray, zinc, neutral, stone). In December 2025, the Oatmeal Kit by Tailwind Plus introduced 4 additional neutral palettes: Mauve, Mist, Olive, and Taupe.

New Tailwind CSS neutral palettes
mauve
olive
mist
taupe

neutral has zero chroma, so its hue is undefined and it can't be interpolated. It is excluded from the neutral set, which leaves 8 palettes: slate, gray, zinc, stone, and the four new ones. That is enough data points to fill the gaps between them through interpolation.

Tailwind CSS v4.2.0 (released 18/02/2026) ships these four palettes by default.

How It Works

Each Tailwind palette contains 11 shades (50, 100, 200...950). The idea is to use shade 500 as an anchor. It represents the «true» color of the palette and sits at a specific hue in OkLCh.

By mapping all known palettes to their anchor hues, we can:

  1. Take any hue input (0-360°)
  2. Find the two known palettes whose hues surround it
  3. Interpolate between them using linear interpolation (lerp)
  4. Generate a complete 11-shade palette

Because OkLCh is perceptually uniform, equal steps in the interpolation weight produce roughly equal visual changes, so the result moves smoothly from one palette to the other.

For example, for a palette at hue 100° (between yellow at ~86° and lime at ~130°), the algorithm interpolates lightness, chroma, and hue for each shade level between these two palettes, creating a cohesive new palette.

Playground

Here's an interactive demo:

Palette Playground
--color-accent-50: oklch(0.9834 0.0149 178.89);
--color-accent-100: oklch(0.9526 0.0511 178.58);
--color-accent-200: oklch(0.9094 0.0956 178.39);
--color-accent-300: oklch(0.8537 0.1386 179.06);
--color-accent-400: oklch(0.7755 0.1551 179.58);
--color-accent-500: oklch(0.7030 0.1438 180.00);
--color-accent-600: oklch(0.5995 0.1214 182.02);
--color-accent-700: oklch(0.5106 0.0988 183.79);
--color-accent-800: oklch(0.4364 0.0801 185.55);
--color-accent-900: oklch(0.3850 0.0648 185.98);
--color-accent-950: oklch(0.2751 0.0466 190.03);
0
60
120
180
240
300
0
Hue: 180°
Anchor:

Features:

Conclusion

This approach generates brand-specific palettes that feel native to Tailwind's design system.

Instead of being limited to the 26 shipped palettes, we can explore the full 360° hue range while keeping the Tailwind feel.

The technique works because OkLCh takes care of perceptual uniformity. In RGB or HSL, the same interpolation would give muddy or uneven results, and we would need curves calculated from luminance to compensate. In OkLCh, plain lerp is enough, and it is much simpler.