One click draws a palette of 3 to 15 colors, and you can lock the ones you like
The random palette generator is a quick way to find a starting point for a color scheme. Every time you press New palette or hit the Space key, the colors change. A color whose lock you have pressed stays put, and only the rest are redrawn. There are four modes. Random draws red, green and blue each from 0 to 255. Harmony, Pastel and Vivid work in OKLCH, a color space matched to the lightness people perceive, and draw lightness and chroma from set ranges.
The colors you draw are applied to a sample screen right away. The lightest color becomes the background, the darkest becomes the text, and the most saturated colors go to buttons and accents. The tool also judges whether the body-text contrast clears 4.5:1, the WCAG 2.2 threshold. Of 10,000 five-color palettes, only 55.0% of Random ones contain a text and background pair that clears it, against 99.6% of Harmony ones.
When to use it
- When you are stuck on a color scheme: flip through combinations with no colors decided in advance and find a direction. When a color appeals to you, lock it and keep drawing.
- When you need colors to go with one brand color: open that color from a link or the history, lock it, and draw in Harmony mode. The other colors follow the rule, based on the hue angle of the locked color.
- When you pick colors for slides, charts or thumbnails: the sample screen and the contrast verdict screen out combinations that cannot carry text. The HEX list and CSS variables copy straight out.
How the colors are drawn
- Random: red, green and blue are each drawn separately from 0 to 255. This is the old method unchanged, so surprising combinations come up, but colors of similar lightness tend to cluster and muddy colors are easy to get.
- Why OKLCH: CSS Color 4 explains that HSL lightness does not match human perception. Yellow (#FFFF00) and blue (#0000FF), both at 50% HSL lightness, have OkLCh lightness of 0.968 and 0.452, so the fact that yellow looks far brighter shows up in the numbers. That is why Harmony, Pastel and Vivid set their ranges with OKLCH lightness (L), chroma (C) and hue angle (H).
- Harmony: pick one rule among analogous, complementary, triadic, split-complementary and monochromatic, then make colors by turning the base hue by the rule's angles (each angle shaken by ±6°). If a chromatic color is locked, its hue angle is the base. Lightness is divided evenly by the number of colors and then shuffled, so light and dark colors come out together.
- Pastel and Vivid: lightness and chroma are drawn from set ranges, and the hue turns by 137.5° from one color to the next so the colors spread out without overlapping.
- Colors the screen cannot show: if the chosen lightness and chroma fall outside sRGB, lightness and hue are kept and only chroma is reduced to fit. CSS Color 4 §14 (gamut mapping) goes in the same direction, bringing colors into range by reducing chroma.
- Random numbers: the browser's Crypto.getRandomValues() supplies them. MDN describes this function as providing cryptographically strong random values.
| Mode | Lightness L | Chroma C | Hue angle |
|---|---|---|---|
| Random | — | — | Red, green and blue drawn separately |
| Harmony | 0.30–0.92 | 0.05–0.16 | Rule angle ±6° (monochromatic uses chroma 0.03–0.12) |
| Pastel | 0.82–0.93 | 0.04–0.09 | 137.5° steps |
| Vivid | 0.55–0.75 | 0.14–0.24 | 137.5° steps |
| Harmony rule | Angles turned from the base |
|---|---|
| Analogous | 0°, 30°, −30°, 60°, −60° |
| Complementary | 0°, 180° |
| Triadic | 0°, 120°, 240° |
| Split-complementary | 0°, 150°, 210° |
| Monochromatic | 0° |
When there are more colors than the rule has angles, the angles start over from the beginning and lightness tells the colors apart. For example, a complementary rule with 5 colors puts colors of different lightness alternately at the two hue angles.
How often each mode can carry text
For each mode, 10,000 palettes were drawn and the share was counted in which the color with the highest relative luminance and the one with the lowest (the pair with the most contrast in the palette) have a contrast of at least the body-text threshold of 4.5:1. A fixed random seed makes the numbers repeatable.
| Colors | Random | Harmony | Pastel | Vivid |
|---|---|---|---|---|
| 3 colors | 27.3% | 65.3% | 0.0% | 0.0% |
| 5 colors | 55.0% | 99.6% | 0.0% | 0.0% |
| 8 colors | 79.8% | 100.0% | 0.0% | 0.0% |
Basis: palettes drawn on 2026-10-12 with this tool's generation method (the ranges in the table above) from seed 2026, 10,000 per cell; contrast uses the WCAG 2.2 formula. The WCAG 2.2 and CSS Color 4 wording was checked the same day.
A random 3-color palette has no pair usable as a text color about three times in four. Harmony deliberately spreads lightness wide, so from 5 colors on it almost always has such a pair. Pastel and Vivid pack every color's lightness into a narrow range and never once cleared the threshold. Use those two modes for backgrounds and decoration, and keep a dark color from outside the palette for text.
How contrast is judged
| WCAG 2.2 criterion | Minimum contrast | Applies to |
|---|---|---|
| 1.4.3 Contrast (Minimum), AA | 4.5:1 | Body text. Large text: 3:1 |
| 1.4.6 Contrast (Enhanced), AAA | 7:1 | Body text. Large text: 4.5:1 |
| 1.4.11 Non-text Contrast, AA | 3:1 | Parts that are not text, such as button borders, icons and graphs |
Large text means 18 point or larger, or 14 point or larger when bold. WCAG does not round ratios, so this tool shows contrast rounded down to one decimal place and judges on that value (4.48:1 shows as 4.4:1 and fails). The sample screen judges body text on the background and button text on the primary color at 4.5:1, and the accent color on the background at 3:1. For button text and badge text the tool picks white or black, whichever has the higher contrast on the primary and accent colors. The "Aa" figure on each color card is likewise the higher contrast of white or black text on that color.
Walking through the first example palette
| HEX | RGB | Lightness L | Chroma C | Hue angle | Text on it · contrast |
|---|---|---|---|---|---|
| #F3EBDD | 243, 235, 221 | 94.3% | 0.0205 | 81.8° | Black 17.7:1 |
| #2E3A59 | 46, 58, 89 | 35.3% | 0.0566 | 267.3° | White 11.2:1 |
| #D9734E | 217, 115, 78 | 66.5% | 0.1378 | 40.3° | Black 6.5:1 |
| #5F8F84 | 95, 143, 132 | 61.2% | 0.0547 | 178.4° | Black 5.7:1 |
| #E9B949 | 233, 185, 73 | 80.9% | 0.1379 | 85.2° | Black 11.5:1 |
In this palette the lightest color, #F3EBDD, is the background and the darkest, #2E3A59, is the text, so body contrast is 9.5:1. Among the remaining colors, the most saturated is #E9B949 (0.1379, against 0.1378 for #D9734E), so it becomes the main button, with black text on it at 11.5:1. The accent #5F8F84 against the background is 3.09:1, which shows as 3.0:1 and still clears the 3:1 graphics threshold.
Common mistakes
- Matching lightness in HSL: even with the same HSL lightness, yellow looks bright and blue looks dark. If lightness has to match, look at the OKLCH lightness (the L value on each card).
- Using a color you like for text as well: a pretty color is not necessarily readable as text. If the sample screen's verdict falls short, change the text to the palette's darkest color or to a black-ish one.
- Too many colors: use 15 colors when you want a wide field of candidates. On a real screen, trimming down to background, text, primary, secondary and accent keeps things tidier.
- A locked color with no chroma: grays and whites have almost no chroma, so they have no defined hue angle. They do not serve as the base in Harmony mode, and drawing starts from a random angle.
- Not checking color vision differences: this tool does not simulate color vision deficiency. For colors where the difference matters, such as red and green, check separately with the simulation in the color palette tool linked below.
Limits and cautions
- The colors are chosen at random, so even Harmony mode does not guarantee a good-looking result. The rules only organize the starting point, and the choosing is up to you.
- The sample screen's role assignment is an automatic rule that looks only at lightness and chroma. In real design, change the roles to suit brand meaning or use.
- Colors export only as sRGB HEX. The same HEX can look different on a monitor and in print, and conversion to CMYK for print is not done.
- Recent palettes stay only in this browser's storage. To see one on another device, use Copy link.
Sources
- 01W3C: CSS Color Module Level 4§7 how HSL lightness differs from perception (OkLCh lightness of yellow and blue, 0.968 and 0.452), the oklch() definition, §14 gamut mapping (out-of-range colors are shown with reduced chroma)
- 02Björn Ottosson: A perceptual color space for image processing (2020-12-23)The Oklab definition and the sRGB conversion matrices
- 03W3C: WCAG 2.21.4.3 contrast 4.5:1 (large text 3:1), 1.4.6 7:1, 1.4.11 non-text 3:1, large text 18pt (14pt bold), the contrast ratio formula
- 04MDN: Crypto.getRandomValues()A browser function that fills an array with cryptographically strong random values
- 05W3C — Understanding SC 1.4.3 Contrast (Minimum)Computed ratios are not rounded (4.499:1 does not meet 4.5:1)
Frequently asked questions
Can I keep the colors I like and redraw the rest?
Yes. Press the lock at the top right of a color card and that color stays fixed. When you press New palette or the Space key, only the other colors change. In Harmony mode, the matching colors are chosen around the hue angle of the locked chromatic color.
How do Random and Harmony modes differ?
Random draws red, green and blue separately from 0 to 255. Harmony sets hues in the OKLCH color space by the angles of one rule (analogous, complementary, triadic, split-complementary or monochromatic) and divides lightness evenly across the colors. Of 10,000 five-color palettes, the share containing a text and background pair at 4.5:1 or more body-text contrast was 55.0% for Random and 99.6% for Harmony.
Can I choose text colors from a Pastel palette?
Hardly. Pastel draws lightness only between 0.82 and 0.93, so its colors differ little in lightness, and among 10,000 palettes not one had a pair above 4.5:1 for body text. Use it for backgrounds and decoration, and keep a dark color from outside the palette for text.
Why OKLCH instead of HSL?
Because HSL lightness does not match the lightness people perceive. CSS Color 4 gives the example of yellow and blue at the same 50% HSL lightness, whose OkLCh lightness is 0.968 and 0.452, very different. When lightness ranges are set in OKLCH, colors drawn from a narrow range, as in Pastel and Vivid, actually look similar in lightness, while Harmony divides a wide range evenly so that light and dark colors come out together.
How are the sample screen roles assigned?
The lightest color (the one with the highest relative luminance) becomes the background and the darkest the body text. The rest go to the main button, secondary and accent in order of chroma. Button text is white or black, whichever has the higher contrast on the primary color. Body text and the button are judged at 4.5:1, and the accent color at 3:1.
What is the "Aa" figure on a color card?
It is the higher of the contrasts you would get with white text and with black text on that color. WCAG 2.2 asks for 4.5:1 for body text and at least 3:1 for large text, meaning 18 point or larger (14 point or larger if bold).
Can I save or share a palette?
Copy link puts an address containing the color codes on the clipboard, and opening it brings the palette back. New palettes are kept in the recent list, up to 50, only in this browser, and Clear all removes them. You can also copy the HEX list or CSS variables and paste them into design tools and code.
I pressed Space and the page scrolled.
The Space key draws a new palette only when the palette is on screen and no input field or button has focus. While you are reading the article, the page scrolls as usual. Click an empty spot where the palette is visible, then press Space.