How to use the color palette generator
- Pick a base colour or type a hex value. Use Random base for inspiration.
- Choose a harmony: complementary, analogous, triadic, split complementary, tetradic, square, monochromatic, shades or tints.
- Choose the colour math. HSL follows the classic colour wheel; OKLCH keeps perceived lightness more even.
- Read each swatch's HEX, RGB, HSL and OKLCH values and its contrast on white and black, and copy any value.
- Copy the palette as CSS custom properties or download it as JSON.
Worked example
Teal base colour #0f766e
In HSL, #0f766e is hsl(175, 77%, 26%). Its complementary colour is #760f17, the triadic palette is #0f766e, #6e0f76, #766e0f, and the analogous palette (±30°) is #0f763b, #0f766e, #0f4b76. The base colour has a 5.47:1 contrast ratio on white, which passes WCAG AA for normal text.
How it works
Harmonies rotate the hue by fixed angles (complementary 180°, analogous ±30°, triadic 120°, split complementary 150° and 210°, tetradic 60°, 180° and 240°, square 90° steps) in HSL or in OKLCH. OKLCH colours outside the sRGB gamut are brought in by reducing chroma with a binary search. Shades, tints and monochrome vary lightness only. Contrast uses the WCAG 2 relative luminance formula.
Frequently asked questions
Is my data uploaded?
No. This tool runs entirely in your browser. Your input is processed on your device and is not sent to our server or stored.
What is the difference between HSL and OKLCH here?
HSL is the traditional colour wheel, but equal HSL lightness can look very different between hues (yellow looks much lighter than blue). OKLCH is designed so that equal lightness looks equally light, which gives more balanced palettes.
How do I use the contrast badges?
They show whether the swatch passes WCAG 2 as text on white or on black: AAA needs 7:1, AA 4.5:1, and "AA large" means it only passes for large text (3:1).
Can I export to Tailwind or design tools?
The CSS export gives custom properties you can reference from Tailwind theme config or any stylesheet. The JSON export includes every format for use in scripts or design tokens.
Limitations
- Colour harmony rules are a starting point, not a guarantee of a good design.
- Palettes are generated in sRGB; wide-gamut (Display P3) colours are not produced.