Color Palette Generator
Build a color palette from one color: matching harmonies and a full scale of tints and shades, each with a readable text color, ready for CSS or Tailwind.
- Free, no sign-up
- Runs in your browser
- Sources cited
Any CSS color, such as #2563eb, rgb(37 99 235) or oklch(55% 0.22 263).
- Complementary
- Analogous
- Triadic
- Split complementary
- Tetradic
- Monochromatic
Used in the CSS variable and Tailwind names.
Harmony
- 1#007bb2Text: white at 4.6:1
- 2#2563ebText: white at 5.1:1
- 3#7a49dfText: white at 5.4:1
Tints and shades
- 50#e9f6ffText: black at 19:1
- 100#d5e9ffText: black at 16.9:1
- 200#b7d5ffText: black at 13.9:1
- 300#8ab6ffText: black at 10.2:1
- 400#5b93ffText: black at 7:1
- 500#2f6ef7Text: black at 4.6:1
- 600#2459cbText: white at 6.2:1
- 700#1a45a1Text: white at 8.7:1
- 800#103179Text: white at 12:1
- 900#082158Text: white at 15.3:1
- 950#031239Text: white at 18.2:1
Export
CSS variables
:root {
--brand-50: #e9f6ff;
--brand-100: #d5e9ff;
--brand-200: #b7d5ff;
--brand-300: #8ab6ff;
--brand-400: #5b93ff;
--brand-500: #2f6ef7;
--brand-600: #2459cb;
--brand-700: #1a45a1;
--brand-800: #103179;
--brand-900: #082158;
--brand-950: #031239;
}Tailwind CSS theme
@theme {
--color-brand-50: oklch(97% 0.075 262.9);
--color-brand-100: oklch(93% 0.09 262.9);
--color-brand-200: oklch(87% 0.111 262.9);
--color-brand-300: oklch(78% 0.143 262.9);
--color-brand-400: oklch(68% 0.179 262.9);
--color-brand-500: oklch(58% 0.215 262.9);
--color-brand-600: oklch(50% 0.187 262.9);
--color-brand-700: oklch(42% 0.158 262.9);
--color-brand-800: oklch(34% 0.129 262.9);
--color-brand-900: oklch(27% 0.104 262.9);
--color-brand-950: oklch(20% 0.079 262.9);
}JSON
{
"brand": {
"50": "#e9f6ff",
"100": "#d5e9ff",
"200": "#b7d5ff",
"300": "#8ab6ff",
"400": "#5b93ff",
"500": "#2f6ef7",
"600": "#2459cb",
"700": "#1a45a1",
"800": "#103179",
"900": "#082158",
"950": "#031239"
}
}How to use the color palette generator
Choose a base color
Type any CSS color, pick one, or try a random color.
Pick a harmony
Complementary, analogous, triadic, split complementary, tetradic or monochromatic.
Read the scale
Eleven tints and shades from 50 (lightest) to 950 (darkest), each labelled with the text color that reads best on it.
Export
Name the palette and copy it as CSS variables, a Tailwind CSS theme or JSON. Copy any single color from its swatch.
How the palette is built
The generator works in OKLCH, a form of the OKLab color space that CSS Color 4 supports. Its three values are lightness, chroma (colorfulness) and hue. Because OKLab was designed so that equal steps look equally different, changing only the hue keeps colors equally light, and changing only the lightness keeps the hue steady, which older spaces such as HSL do not.
Harmonies rotate the base hue around the color wheel: 180 degrees for complementary, 30 degrees either side for analogous, thirds for triadic and quarters for tetradic. The scale keeps the base hue and sets lightness from very light to very dark, reducing chroma toward the ends where screens cannot show strong color. Colors outside the sRGB range of most screens are brought in by lowering chroma, as CSS Color 4 recommends.
Each swatch shows whether black or white text reads better on it, using the WCAG contrast ratio. The Tailwind export uses the theme variables of Tailwind CSS, so the scale becomes classes such as bg-brand-500.
Worked example
From the base color #2563eb, which is oklch(54.6% 0.215 262.9), the analogous harmony gives #007bb2, #2563eb, and #7a49df. The lightest step of the scale is #e9f6ff with black text, and the darkest is #031239 with white text.
The 600 step is #2459cb; white text on it has a contrast ratio of 6.2 to 1.
Understanding the result, and common mistakes
- Using the base color for text. Check its contrast first; mid-scale colors are often too light for small text on white.
- Mixing many saturated harmony colors. Use one as the main color and the rest as accents.
- Judging lightness by eye in HSL. Two colors with the same HSL lightness can look very different; OKLCH lightness matches what people see.
Frequently asked questions
Why OKLCH instead of HSL?
OKLCH keeps colors equally light as the hue changes, so scales and harmonies look even.
Can I use the scale in Tailwind?
Yes. Paste the Tailwind export into your CSS and use classes such as text-brand-700.
Is anything uploaded?
No. The palette is built in your browser.
Sources
- CSS Color Module Level 4World Wide Web Consortium · retrieved Nov 14, 2026
- A perceptual color space for image processingBjörn Ottosson · retrieved Nov 14, 2026
- Understanding Success Criterion 1.4.3: Contrast (Minimum)World Wide Web Consortium · retrieved Nov 14, 2026
- Theme variablesTailwind Labs · retrieved Nov 14, 2026
About these results
- The palette is built in your browser. Nothing you enter is sent anywhere.