Free tool · Design and colour
Color palette generator
Pick a base color and a color rule and get five colors that go together. The blue #2A6F97 with the complementary rule gives #2A6F97, #6EA4C3, #97522A, #C38D6E, #122E3F.
- Free
- No sign-up
- Runs in your browser
#2A6F97Tap a swatch to copy its code
| HEX | RGB | HSL | On white | On black |
|---|---|---|---|---|
| #2A6F97 | rgb(42, 111, 151) | hsl(202, 56%, 38%) | 5.5:1 | 3.82:1 |
| #6EA4C3 | rgb(110, 164, 195) | hsl(202, 41%, 60%) | 2.71:1 | 7.76:1 |
| #97522A | rgb(151, 82, 42) | hsl(22, 56%, 38%) | 5.91:1 | 3.56:1 |
| #C38D6E | rgb(195, 141, 110) | hsl(22, 41%, 60%) | 2.85:1 | 7.36:1 |
| #122E3F | rgb(18, 46, 63) | hsl(203, 56%, 16%) | 14.11:1 | 1.49:1 |
:root {
--color-1: #2A6F97;
--color-2: #6EA4C3;
--color-3: #97522A;
--color-4: #C38D6E;
--color-5: #122E3F;
}How to use the Color Palette Generator
- Choose a Base color with the picker, or type a HEX code such as #2A6F97. Press Random base color for a surprise.
- Pick a Color rule. The line under the rule names how the colors are found.
- Tap a swatch to copy its HEX code. The table shows HEX, RGB, HSL and the contrast against white and black.
- Use Copy as CSS variables to paste the five colors into a stylesheet.
How does a color palette generator work?
It converts your base color to hue, saturation and lightness, then moves the hue around the color wheel by a fixed rule. Colors a set number of degrees apart tend to look balanced, which is why designers use these rules. The tool turns every result back into a HEX code you can paste anywhere.
The first swatch is always your own color. The other four come from the rule, with a few of them made lighter or less saturated so that the palette has quiet tones next to the strong ones. For pure red, the complementary rule gives #FF0000, #F47B7B, #00FFFF, #7BF4F4, #8F0000.
Colors can be typed with 3 or 6 digits, with or without the hash sign. A code the page cannot read gets a message instead of a guess.
Which color rule should I pick?
Complementary pairs strong contrast, so it suits a button on a calm background. Analogous colors sit next to each other and feel smooth and quiet. Triadic and tetradic palettes use hues spread evenly around the wheel and look lively. Split complementary softens the contrast of the plain complementary rule. Monochromatic keeps one hue and varies only the lightness, which is the safest choice for text, borders and backgrounds on one page.
The table runs every rule on pure red so that you can compare the codes.
| Rule | How the colors are found | The five colors |
|---|---|---|
| Complementary | the base and the color opposite it on the wheel | #FF0000, #F47B7B, #00FFFF, #7BF4F4, #8F0000 |
| Analogous | neighbors 30 and 60 degrees either side | #FF00FF, #FF0080, #FF0000, #FF8000, #FFFF00 |
| Triadic | three hues 120 degrees apart | #FF0000, #00FF00, #0000FF, #F58484, #84F584 |
| Split complementary | the base and the two colors beside its opposite | #FF0000, #00FF80, #0080FF, #F58484, #8F0000 |
| Tetradic | four hues 90 degrees apart | #FF0000, #80FF00, #00FFFF, #8000FF, #F58484 |
| Monochromatic | one hue in five lightness steps | #660000, #B30000, #FF0000, #FF4D4D, #FF9999 |
How do I check that text is readable on a color?
The table of results lists the contrast ratio of each color against white and against black. The ratio runs from 1:1 (no difference) to 21:1 (black on white). WCAG, the web accessibility guidelines, set 4.5:1 as the minimum for normal body text, so a color that scores above 4.5 against white can carry white text.
A mid gray such as #767676 is just over that line on white, and #595959 is well above it. A yellow such as #FFD500 has very little contrast on white but plenty on black. The swatches already use black or white text, whichever contrasts more.
| Color | On white | On black |
|---|---|---|
| #767676 | 4.54:1 | 4.62:1 |
| #595959 | 7:1 | 3:1 |
| #2A6F97 | 5.5:1 | 3.82:1 |
| #FFD500 | 1.42:1 | 14.77:1 |
How do I use the palette in a design or a stylesheet?
Press Copy as CSS variables to get the five colors as custom properties named --color-1 to --color-5. Paste them into your stylesheet's :root block and refer to them with var(--color-1). Rename them to roles, such as --brand or --accent, once you decide which swatch does what.
A good rule of thumb is to use one color for most of the page, a second for emphasis and the lightest swatch for backgrounds. Check text pairs in the contrast column before you ship.
Use it with
- Palette from Image: extract colors from a photo.
- Color Mixer: mix two or more colors and get the result codes.
- HEX Color Name Finder: nearest color name for a HEX.
Questions
How do I generate a color palette from one color?
Pick or type the base color, then choose a rule. The blue #2A6F97 with the complementary rule gives #2A6F97, #6EA4C3, #97522A, #C38D6E, #122E3F.
What is a complementary color?
The color directly opposite on the color wheel, 180 degrees away in hue. The complement of red #FF0000 is cyan #00FFFF.
What contrast ratio do I need for text?
WCAG sets 4.5:1 for normal text. The table shows the ratio of each color against white and black.
Can I type a short HEX code?
Yes. A 3 digit code such as 0f0 is read as #00FF00. The hash sign is optional.
Can I get the colors as CSS?
Yes. Press Copy as CSS variables to get five custom properties for your :root block.
Are my colors stored or sent anywhere?
No. The base color and the palette stay in your browser tab, and neither is saved or transmitted.
The tool's results are computed in your browser by the code on this page, using the sources listed above; the explanations are checked against the tool's own output.