Color Palette Generator
Turn one color into a 50–950 shade scale or a color harmony, then export it for CSS, Tailwind or JSON.
Any CSS colour: #hex, rgb(), hsl(), hwb() or a name.
50
black text · AA
100
black text · AA
200
black text · AA
300
black text · AA
400
black text · AA
500●
black text · AA
600
white text · AA
700
white text · AA
800
white text · AA
900
white text · AA
950
white text · AA
:root {
--primary-50: #F0F6FF;
--primary-100: #DEEBFF;
--primary-200: #C3DBFF;
--primary-300: #9BC2FF;
--primary-400: #69A2FF;
--primary-500: #3B82F6;
--primary-600: #226ADB;
--primary-700: #1153B9;
--primary-800: #074095;
--primary-900: #033075;
--primary-950: #001F54;
}What the palette generator is for
A brand usually starts with one color, but an interface needs many: pale tints for backgrounds and hover states, a solid tone for buttons, darker shades for text and borders. Design systems such as Tailwind CSS organise these as a numbered scale from 50 (lightest) to 950 (darkest). This tool builds that scale from any color you give it, and can also suggest companion hues using classic color-wheel harmonies.
The scale uses fixed lightness levels in OKLCH, a color space designed so that equal changes in lightness look equal to the eye. That keeps steps evenly spaced and guarantees the order is always light to dark, whatever the input. A simple HSL lightness ramp, by comparison, makes yellows look washed out and blues look too dark at the same numeric lightness.
How to use it
- Enter a color in Base color (for example
#3B82F6,hsl(160 84% 39%)ortomato) or pick one with the swatch. - Choose a Palette type: Shade scale 50–950 or one of the six harmonies.
- Click any swatch to copy its hex value. The small ratio under the hex tells you how readable text is on it.
- Set a Palette name such as
primaryorbrand; it is used in variable names. - Pick CSS variables, Tailwind or JSON and use Copy or Download.
Worked example
With the base color #3B82F6 and the name primary, the shade scale places the base on step 500 and the CSS export is:
:root {
--primary-50: #F0F6FF;
--primary-100: #DEEBFF;
--primary-200: #C3DBFF;
--primary-300: #9BC2FF;
--primary-400: #69A2FF;
--primary-500: #3B82F6;
--primary-600: #226ADB;
--primary-700: #1153B9;
--primary-800: #074095;
--primary-900: #033075;
--primary-950: #001F54;
}Switching to Triadic gives #3B82F6, #F63B82 and #82F63B — the same saturation and lightness rotated 120° and 240° around the wheel.
Palette types explained
- Shade scale — 11 tints and shades of one hue for a complete UI color ramp.
- Complementary — the opposite hue. Maximum contrast; best kept for small accents.
- Analogous — neighbours on the wheel. Calm and cohesive, good for illustrations and backgrounds.
- Triadic — three evenly spaced hues. Lively; usually one dominates and two accent.
- Split-complementary — the two hues beside the complement. Contrast with less tension than a direct complement.
- Tetradic — four hues in a square. Rich but hard to balance; mute two of them.
- Monochromatic — one hue at five lightness levels 15 points apart, shifted to stay within 4–96% lightness.
The Tailwind export contains both an @theme block for Tailwind v4 and a theme.extend.colors object for v3. The JSON export is a plain name → hex map for design-token pipelines.
Limitations
The scale is generated by a formula, not tuned by hand, so it will not match Tailwind's built-in palettes exactly. Very saturated hues lose some chroma at the extremes because sRGB cannot display them. Harmonies are rotated in HSL, which is not perceptually uniform: a rotated yellow or cyan can look much lighter than the base. Alpha in the input is ignored, and all output is 6-digit sRGB hex.
Tips
- Use 50–200 for backgrounds, 500–600 for buttons and 700–900 for text on light backgrounds — then confirm with the ratio shown.
- If your brand color lands on 300 or 700 instead of 500, that is expected: it reflects how light the color really is.
- Check final text/background pairs in the contrast checker, and convert any swatch to OKLCH or RGB with the color converter.
Frequently Asked Questions
How are the 50–950 shades calculated?
Each step has a fixed lightness in the OKLCH color space, from 97% for 50 down to about 26% for 950, and uses the hue of your base color. Chroma is reduced at the light and dark ends and whenever a color would fall outside sRGB, so every hex is valid and the scale always goes from light to dark.
Where does my base color end up in the scale?
It replaces the step whose lightness is closest to it and is marked with a dot. A mid-tone blue lands on 500, a pale yellow on 50, and a near-black on 950.
Which color harmonies are available?
Complementary (180°), analogous (±30° and ±60°), triadic (120° apart), split-complementary (150° and 210°), tetradic (90° apart) and monochromatic (same hue, five lightness levels). Hues are rotated on the HSL color wheel, keeping the base saturation and lightness.
How do I use the palette in Tailwind CSS?
Choose the Tailwind export. It contains an @theme block for Tailwind v4, which creates utilities like bg-primary-500, and an equivalent theme.extend.colors object for a v3 tailwind.config.js.
What does the ratio on each swatch mean?
It is the WCAG 2 contrast ratio of the better of white or black text on that swatch. 4.5:1 or more passes AA for normal text; 3:1 is enough only for large text.
Is my data sent to a server?
No. The palette is computed in your browser with JavaScript, and nothing you enter is uploaded or stored.
Related tools
- Color ConverterConvert colors between HEX, RGB, HSL and HSV formats
- Color Contrast CheckerCheck WCAG 2.1 color contrast ratio between foreground and background colors. Shows AA/AAA pass/fail for normal and large text. Essential for accessible design.
- CSS Shadow GeneratorGenerate CSS box-shadow and text-shadow visually with live preview. Adjust offset, blur, spread, color, and opacity. Copy ready-to-use CSS code.
- Random Color GeneratorGenerate random colors with live preview. Lock individual channels, copy HEX/RGB/HSL values, and generate multiple colors at once for palettes.
- CSS Gradient GeneratorCreate beautiful CSS gradients visually with live preview. Linear, radial, and conic gradients with unlimited color stops.
All Color & Design tools · Found a bug or a wrong result? Report it.