What it does
The generator builds palettes of 2 to 10 colors. Every calculation runs in your browser in the OKLCH color space, where lightness and hue are closer to how the eye judges them than in HSL. Each swatch shows its HEX value in black or white text, whichever has the higher WCAG contrast against it, so the label stays readable. The current palette, locks and mode are kept in the page address, so the link reopens the same palette, and your last palette and settings are saved in this browser's local storage.
How each mode works
Harmony modes take a base color, read its OKLCH hue, and add fixed angles to it. The base is the first locked color, or a random mid-lightness color when nothing is locked. If a mode has fewer anchor hues than the palette has colors, it repeats the anchors as lighter and darker variants.
| Mode | Hues relative to the base | Character |
|---|---|---|
| Random | Steps of 20° to 70° from the previous hue | Lightness spread from dark to light in random order, softer chroma near black and white |
| Analogous | Within 30° either side of the base: −30°, +30°, then −15°, +15° | Neighbors on the wheel; calm and low-contrast in hue |
| Complementary | 0° and 180° | Opposite hues; strongest hue contrast |
| Split complementary | 0°, 150° and 210° | The two neighbors of the complement; contrast with less tension |
| Triadic | 0°, 120° and 240° | Three hues evenly spaced |
| Tetradic | 0°, 90°, 180° and 270° | A square of four hues: two complementary pairs |
| Monochromatic | 0° only | One hue at varied lightness and chroma |
| Shades of one hue | 0° only | One hue ordered from light to dark, chroma tapering at the ends |
The harmony colors keep the base's lightness and chroma, with a small random nudge to lightness so repeated generations differ. Some hues cannot reach the same chroma inside sRGB at that lightness. Those colors are gamut mapped the CSS Color 4 way: chroma is lowered until the color fits, and the final clip can move the hue by a few degrees.
Worked example
Lock #4F46E5 and choose Triadic. Its OKLCH value is oklch(51.06% 0.2301 276.97), so the triad hues are 276.97 + 120 = 36.97° and 276.97 + 240 = 156.97° (wrapped past 360).
- At the base's lightness and chroma, 36.97° is outside sRGB. Gamut mapping gives
#BE1B00, which measuresoklch(51.29% 0.1976 31.39): a red-orange. - 156.97° maps to
#007E41,oklch(51.99% 0.1342 152.88): a green. - Those are the anchor colors. The generator then nudges each lightness slightly at random, so the swatches you get are close variations, for example
#C31D00instead of#BE1B00. - With five colors, the fourth and fifth are lighter variants of the base and the red-orange, because triadic has only three anchors.
The label on #4F46E5 is white because white text scores 6.29:1 against it and black only 3.34:1. Exported with the prefix brand, a CSS block starts :root { --brand-1: #4f46e5; … and the Tailwind v4 block starts @theme { --color-brand-1: #4f46e5; …, which gives you utilities such as bg-brand-1.
Export formats
| Format | Output |
|---|---|
| CSS variables | :root { --color-1: #4f46e5; } |
| Tailwind v4 | @theme { --color-palette-1: #4f46e5; }. Tailwind theme colors must use the --color- namespace, so the default prefix becomes palette here, and a prefix such as brand gives --color-brand-1. |
| SCSS | $color-1: #4f46e5; |
| JSON | ["#4f46e5", …] |
| HEX list | #4f46e5, #f59e0b |
Common mistakes
- Taking the HSL complement. HSL's hue wheel is not perceptual. The HSL complement of
#4F46E5(hue 243° + 180°) is#DDE548, a light, vivid yellow-green far lighter than the original, while the OKLCH complement at the same lightness is the olive#7B6500. - Using every color for text. A harmonious palette is not automatically accessible. Check text and background pairs with the contrast checker before shipping.
- Forgetting the lock. Generate replaces every unlocked color, including ones you edited by hand. Lock them first, or press Undo.
- Too many saturated colors. Most interfaces use one or two strong colors and neutrals. Shades of one hue is a good source for the neutral steps.