Tailwind Color Generator
Turn one brand color into a full 50-950 Tailwind shade scale in OKLCH, with per-shade WCAG contrast, right in your browser.
The Tailwind Color Generator runs entirely in your browser. The brand color you enter and the generated shades are computed on your device and are never uploaded to ArrayKit.
Open the CSS Color Converter
About Tailwind Color Generator
The Tailwind Color Generator turns a single brand color into a complete 50, 100, 200 … 900, 950 shade scale you can drop straight into tailwind.config. Instead of guessing hex values, it interpolates lightness in OKLCH — a perceptually uniform space — so every step feels evenly spaced, and it snaps your input to its nearest step so the palette actually contains your exact brand color. Each swatch shows its hex plus the WCAG contrast ratio against black and against white, so you can tell at a glance which shades are safe for text. Copy the whole scale as a theme.colors block or as CSS custom properties. Paste any CSS color — hex, rgb(), hsl(), or a named color like rebeccapurple. Everything is computed on your device; the colors you enter never leave the browser.
Features
- Generate a full 50-950 Tailwind scale from one brand color
- Lightness interpolated in OKLCH for perceptually even steps
- Input color snapped and preserved at its nearest step
- Per-shade WCAG contrast vs black and white, with AA badges
- Accepts hex, rgb(), hsl(), and named CSS colors
- Copy a ready-to-paste tailwind.config theme.colors block
- Copy the same scale as :root CSS custom properties
- Click any swatch to copy its hex; live gradient preview of the ramp
How to use the Tailwind Color Generator
- Enter or pick your brand color (hex, rgb(), hsl(), or a name)
- Set a color name — it becomes the key, e.g. brand or accent
- Read the per-shade WCAG contrast badges to spot text-safe steps
- Toggle between tailwind.config and CSS variables output
- Copy the block, or click a single swatch to grab its hex
Example
Input
#7c3aed (name: brand)
Output
colors: { brand: { 50: '#faf5ff', 500: '#7c3aed', 950: '#2e1065' } }
One violet hex expands into an OKLCH-spaced 50-950 scale keyed as brand.
Common errors & troubleshooting
- The 500 shade does not exactly match my brand hex. — Your color is anchored to the nearest step by lightness, which may be 400 or 600 rather than 500. Look for the swatch whose hex equals your input — that is the anchor step that reproduces it faithfully.
- The 50 or 950 shade looks a little washed out or muddy. — Chroma is tapered toward the extremes so near-white and near-black stay believable. If you want more saturation at the ends, start from a slightly more chromatic brand color.
- Nothing generates after I type a color. — The value must be a parseable CSS color. Use a full hex like #7c3aed, an rgb()/hsl() function, or a CSS color name; partial hex like #7c is not yet valid.
- Light text on my mid shades fails the contrast check. — Use the per-shade badges: green meets WCAG AA (4.5:1) and amber meets AA large-text (3:1). Pick a darker step (700-900) for body text on a light background.
Frequently asked questions
- How does the Tailwind Color Generator build the 50-950 scale?
- It converts your color to OKLCH, keeps the hue, ramps lightness across the eleven Tailwind steps, and tapers chroma toward the extremes. OKLCH is perceptually uniform, so each step looks evenly spaced rather than clustering in the mids the way plain HSL ramps do.
- Why does my brand color land on 400 or 600 instead of 500?
- The generator snaps your input to the step whose target lightness is closest to it and preserves your exact color there. A lighter brand color anchors nearer 300-400 and a darker one nearer 600-700, so the scale always contains the color you typed.
- What do the contrast numbers on each swatch mean?
- They are WCAG 2.x contrast ratios of that shade against pure black and pure white. A green badge is at least 4.5:1 (AA for normal text) and amber is at least 3:1 (AA for large text or UI). Use them to choose text and background pairings.
- Can I paste rgb(), hsl(), or a named color instead of hex?
- Yes. Any CSS color string works — #7c3aed, rgb(124 58 237), hsl(262 83% 58%), or a name like rebeccapurple. The tool parses it, converts to OKLCH, and builds the scale the same way.
- How do I use the output in my project?
- Copy the tailwind.config block into theme.extend.colors and reference classes like bg-brand-500 or text-brand-800. Or copy the CSS variables version and use var(--brand-500) anywhere in plain CSS. Rename the key by changing the color name field.
- Are the colors I enter sent anywhere?
- No. The whole scale — parsing, the OKLCH math, contrast ratios, and both output formats — is computed in your browser. The brand color you type or pick never leaves your device and is not uploaded to ArrayKit.
Related tools
- CSS Color Converter — Convert between HEX, RGB and HSL with a live swatch.
- Contrast Checker — Check WCAG colour contrast ratio and AA/AAA pass for any two colours.
- Color Format Converter — Convert a color across HEX, RGB, HSL, HWB, LAB, LCH and OKLCH with a live swatch.
- Meta Tag Generator — Generate SEO, Open Graph and Twitter Card meta tags for your page from a simple form.
- CSS Grid Generator — Build CSS grid layouts visually and copy grid-template-columns, rows and gap.
- Open Graph Generator — Generate Open Graph & Twitter meta tags with a live social-card preview.
All ArrayKit tools