How the palette is named
Each color family has a name, such as sky or slate, and 11 shades numbered 50, 100, 200 and so on up to 900, then 950. Low numbers are light and high numbers are dark; 500 sits in the middle. A class name joins a utility, the family and the shade: bg-sky-500 sets a background, text-sky-500 a text color and border-sky-500 a border color. The 950 shade was added in Tailwind CSS v3.3 (March 2023).
The families run around the color wheel from red, orange, amber and yellow through lime, green, emerald, teal, cyan, sky, blue, indigo, violet, purple, fuchsia and pink to rose, followed by the grays: slate, gray, zinc, neutral and stone. Tailwind CSS v4.2 (February 2026) added four more grays with a slight tint: mauve, olive, mist and taupe. That makes 26 families in v4 and 22 in v3. Black and white are also built in as black and white, without shades.
Tailwind CSS v4 and v3 colors compared
| v4 | v3 | |
|---|---|---|
| Families | 26 (v4.2 and later) | 22 |
| Defined in | OKLCH, e.g. oklch(63.7% 0.237 25.331) | HEX, e.g. #ef4444 |
| Configured in | CSS, with @theme | tailwind.config.js |
| CSS variables | Each color you use, e.g. --color-red-500 (@theme static outputs all of them) | None by default |
Version 4.0 (January 2025) moved the whole palette from RGB to OKLCH so that colors can use more than the sRGB range where screens allow it. Comparing the two palettes in this tool, every v4 shade keeps its v3 lightness to within 0.9 percentage points, every shade keeps its v3 hue, and 214 of the 242 shared shades have more chroma (28 have slightly less), so v4 looks more saturated. For example, red-500 is #ef4444 in v3, which is oklch(63.68% 0.2078 25.33), and oklch(63.7% 0.237 25.331) in v4: same lightness and hue, more chroma.
Why v4 HEX values are approximate
OKLCH can describe colors that ordinary sRGB screens cannot show. Of the 286 v4 colors, 95 fall outside the sRGB gamut; they are marked with an asterisk in the grid. On a wide-gamut screen, such as a Display P3 laptop or phone, browsers can show those colors more vividly than any HEX value can. The HEX here is the nearest sRGB color, found with the gamut mapping method in CSS Color Module Level 4: keep the lightness and hue, and lower the chroma until clipping to sRGB changes the color by less than a just-noticeable amount (a deltaE OK of 0.02).
Red-500, oklch(63.7% 0.237 25.331), is inside sRGB and converts to #fb2c36. Red-600, oklch(57.7% 0.245 27.325), is outside it and maps to #e7000b. Converters that simply clip each channel to 0–255 can give different HEX values for out-of-gamut colors. If you need the exact v4 color, copy the OKLCH value, which every current major browser supports.
Using colors in Tailwind CSS v4
In v4 the theme lives in your CSS. Every color is a theme variable in the --color-* namespace, which creates the utilities and is output as a normal CSS variable when you use it:
@import "tailwindcss";
@theme {
--color-brand-500: oklch(62% 0.19 255);
--color-gray-50: oklch(98.5% 0.002 247); /* replaces a default */
}
.note { border-color: var(--color-sky-500); }
Defining --color-brand-500 gives you bg-brand-500, text-brand-500 and the rest. Reusing a default name such as --color-gray-50 replaces that shade. To remove a family, set --color-lime-*: initial in @theme. To drop the whole default palette and use only your own colors, start the block with --color-*: initial; this also removes black and white, so add them back if you need them.
Using colors in Tailwind CSS v3
In v3 the palette is a JavaScript object. Add colors under theme.extend.colors in tailwind.config.js to keep the defaults, or under theme.colors to replace them. To use only some defaults, import them with require('tailwindcss/colors') and list the ones you want, for example sky: colors.sky. In plain CSS, v3 reads a color with the theme() function, as in theme('colors.sky.500'); that is what the CSS variable option copies in v3 mode.
Opacity modifiers
Add a slash and a percentage to any color utility to make it see-through: bg-sky-500/50 is sky-500 at 50% opacity, and bg-black/75 is 75%. Both versions support this, and both accept arbitrary values, such as bg-sky-500/[.06] in v3 or bg-pink-500/[71.37%] in v4. In v4 the transparent color is built with the CSS color-mix() function, and in your own CSS you can write --alpha(var(--color-gray-950) / 10%).
Finding the nearest color
The finder converts your color to OKLab and measures its distance to all 11 shades of every family with deltaE OK, the straight-line distance in OKLab. For v4 it measures against the OKLCH values themselves, not their HEX approximations. A distance under 0.02 is below the just-noticeable difference that CSS Color 4 uses. For example, #1da1f2 is closest to sky-500 in both versions: #00a6f4 in v4 at a distance of 0.0205, and #0ea5e9 in v3 at 0.0195.
License
Tailwind CSS is open source under the MIT License, made by Tailwind Labs. The color values here are taken from the published packages (tailwindcss 4.3.5 and 3.4.19). Dev Kit Bag is not affiliated with or endorsed by Tailwind Labs.