How to use the Color Palette Generator
- Press the spacebar or Randomize to generate a palette. Lock any colour you want to keep before generating again.
- Pick a harmony mode, such as complementary or analogous, to generate colours that relate to each other.
- Open a colour's shades to see its full scale from 50 (lightest) to 950 (darkest) and contrast ratios against white and black.
- Preview the palette on sample buttons, cards, and inputs, then export the format you need.
How it works
Harmony modes rotate around the colour wheel in HSL: complementary uses the opposite hue (180°), triadic uses three hues 120° apart, analogous uses neighbouring hues, and monochromatic varies lightness and saturation of one hue.
Contrast is calculated with the WCAG 2.1 formula from relative luminance. WCAG AA requires 4.5:1 for normal text and 3:1 for large text; AAA requires 7:1 and 4.5:1.
Contrast ratio = (L1 + 0.05) ÷ (L2 + 0.05) where L1 is the lighter colour
AA normal text ≥ 4.5 AA large text ≥ 3 AAA normal text ≥ 7Worked example: checking a brand violet for button text
White text on #725AC1 has a contrast ratio of 5.32:1, which passes AA for normal text. On the lighter #8D86C9 it drops to 3.29:1, which only passes for large text, so that shade suits backgrounds and borders better than text buttons.
Mid-grey #777777 on white is 4.48:1, just below the 4.5:1 needed for body text, a common accidental failure.
| Text on background | Contrast |
|---|---|
| White on #725AC1 | 5.32:1 (AA) |
| White on #8D86C9 | 3.29:1 (large text only) |
| #242038 on #F7ECE1 | 13.48:1 (AAA) |
| #777777 on white | 4.48:1 (fails AA body text) |
Limitations
- Harmony rules are starting points. A palette can follow a rule and still look wrong for your brand; adjust by eye.
- Colours look different on different screens, and in print. Check important colours on several devices.
- WCAG 2.1 contrast is a minimum. Thin fonts and small sizes can still be hard to read at passing ratios.
Frequently asked questions
What contrast ratio do I need for accessible text?
4.5:1 for normal body text and 3:1 for large text (about 24 px regular or 19 px bold) to meet WCAG 2.1 AA.
What is a 50 to 950 colour scale?
A set of tints and shades of one colour, numbered from lightest (50) to darkest (950), as used by Tailwind CSS and many design systems.
How do I use the Tailwind export?
Paste the colours into the theme section of your Tailwind configuration, then use classes such as bg-primary-500 in your markup.
Can I lock a colour and regenerate the rest?
Yes. Locked colours stay fixed while the others change when you generate a new palette.