Skip to main content

Guide

Tailwind color scales: custom 50–950 palettes

By · Updated · 6 min read

A Tailwind color scale is eleven shades of one color named 50, 100, 200 … 900, 950, from nearly white to nearly black. In Tailwind v4 you add one with --color-<name>-<step> variables in an @theme block; in v3 you add an object under theme.extend.colors.

How the steps are used

StepsTypical use
50–100Page and section backgrounds, subtle hover fills
200–300Borders, dividers, disabled fills
400–500Icons, decorative accents, large text on dark
600–700Primary buttons, links, text on white
800–950Headings, text on light tints, dark-mode surfaces

A dependable rule of thumb: the 50 and 950 of the same scale are always a readable pair, and text on white usually needs the 600 step or darker. Always check — yellows and limes need a darker step than blues to reach 4.5:1 (why).

Tailwind v4: @theme

Tailwind v4 is configured in CSS. Any --color-* variable inside @theme becomes a set of utilities (bg-brand-500, text-brand-700, border-brand-200 …) and a real CSS variable you can use anywhere.

css
@import "tailwindcss";

@theme {
  --color-brand-50: #F7F6FF;
  --color-brand-100: #ECE8FF;
  --color-brand-200: #DBD3FF;
  --color-brand-300: #C4B5FF;
  --color-brand-400: #A78BFF;
  --color-brand-500: #9160FF;
  --color-brand-600: #7C3AED;
  --color-brand-700: #6527C7;
  --color-brand-800: #511DA2;
  --color-brand-900: #401782;
  --color-brand-950: #2A0B5A;
}
The scale Tinta generates for #7C3AED: the color itself is step 600.

Tailwind v4’s own default palette is defined in OKLCH (for example oklch(0.623 0.214 259.815) for blue-500), which lets it use colors outside sRGB on wide-gamut screens. Hex values work just as well in @theme; they are simply limited to sRGB.

To replace the defaults rather than add to them, reset the namespace first with --color-*: initial; inside the same @theme block.

Tailwind v3: theme.extend.colors

js
// tailwind.config.js
export default {
  theme: {
    extend: {
      colors: {
        brand: {
          50: '#F7F6FF',
          100: '#ECE9FF',
          // … 200 to 900
          950: '#2A0B5A',
        },
      },
    },
  },
}

Putting colors under extend keeps the default palette; putting them directly under theme.colors replaces it. Migrating to v4, each brand.500 entry becomes a --color-brand-500 line in @theme.

How Tinta builds a scale

Tinta generates scales in OKLCH so steps are perceptually even and keep the color’s hue; ramps made by mixing with white and black in sRGB or HSL tend to drift towards grey in the middle or neon at the ends. For each step it:

  1. Starts from target lightness values close to Tailwind v4’s own palettes (L 0.977 at 50, 0.635 at 500, 0.26 at 950), then stretches them so your color lands exactly on its nearest step.
  2. Keeps the base hue and shapes its chroma: 12% of the peak at 50, the peak at 500, tapering to 50% at 950, scaled so your step keeps your color’s own chroma; pale and deep ends are calmer.
  3. Brings any step that falls outside sRGB back in by reducing chroma, never by clipping channels, which would shift the hue.
  4. Gives near-greys a small fixed chroma so they keep a trace of their hue rather than turning flat grey.

Your exact color is always in the scale: Tinta puts it at the step whose lightness is closest ("this is your 600") and stretches the other steps around it, so the ramp stays smooth from 50 to 950 and your brand color appears verbatim.

Generate a scale

The Tailwind color palette generator turns any colors into 50–950 scales with v4 @theme, v3 config and plain CSS export. Every palette page and the Color Studio have the same Shades export, and every color page such as #7C3AED shows its tints and shades.