Color Palette Generator

Pick a base color and generate a palette that follows color-wheel rules. Every swatch also shows the best text color and its contrast ratio.

Click a swatch to copy its HEX code. The ratio inside each swatch is for whichever of white or black text reads better on that color.

The color wheel and HSL: how a palette is built

The generator converts your base color to HSL, which describes a color by hue, saturation and lightness, and then rotates only the hue by fixed angles. The color wheel is a 360-degree circle: red sits at 0°, yellow near 60°, green near 120°, cyan near 180°, blue near 240° and magenta near 300°. Because saturation and lightness stay the same, the results look like members of one family with a similar brightness and vividness. Behind the scenes there are three steps: HEX to RGB to HSL, a hue rotation, and then HSL to RGB to HEX. Rounding at each step can shift a value by one, so the base color is always shown exactly as you entered it.

One caveat is that HSL lightness does not match perceived brightness. At the same 50% lightness, yellow looks very bright and blue looks dark. If a palette color will carry text or sit behind text, check it with a contrast ratio, as shown below, rather than trusting your eyes.

Scheme rules and when to use each

Example 1: a palette built from the gold #c9a961

The base #c9a961 is about 41.5° hue, 49% saturation and 58.4% lightness in HSL. Rotating only the hue gives the colors below; the table is calculated with the same formulas when the page is built.

SchemeHue ruleResulting colors (HEX)
Complementarybase hue + 180°#c9a961#6181c9
Analogous-30°, 0°, +30°#c97561#c9a961#b5c961
Triadic0°, +120°, +240°#c9a961#61c9a9#a961c9
Split-complementary0°, +150°, +210°#c9a961#61b5c9#7561c9
Tetradic (square)0°, +90°, +180°, +270°#c9a961#61c975#6181c9#c961b5

The complement of this gold is the blue #6181c9 at roughly 221.5°. Used for links or secondary buttons on a gold-led brand, it adds a cool counterweight to the warm base.

Reading text contrast with WCAG

The Web Content Accessibility Guidelines (WCAG) compute a relative luminance L for each color and define the contrast ratio as (L of the lighter color + 0.05) ÷ (L of the darker color + 0.05). The scale runs from 1:1 (no difference) to 21:1 (black on white). For normal body text the AA level asks for at least 4.5:1; for large text (roughly 24 px and up, or 18.66 px and up in bold) the minimum is 3:1. The stricter AAA level asks for 7:1 for normal text and 4.5:1 for large text. For every swatch, this tool picks white or black text, whichever gives the higher ratio, and shows that number.

Example 2: white and black text on #c9a961

White text on #c9a961 has a contrast ratio of 2.25:1, below the AA threshold of 4.5:1, while black text reaches 9.33:1, which clears even AAA (7:1). On a gold button, dark text is the more readable choice. Here is the monochromatic ladder for the same hue:

LightnessHEXWhite textBlack textBetter text color
20%#4c3d1a10.55:11.99:1White (passes AA)
35%#856a2d5.13:14.10:1White (passes AA)
50%#be98412.71:17.76:1Black (passes AA)
65%#d2b77a1.95:110.79:1Black (passes AA)
80%#e5d6b31.44:114.60:1Black (passes AA)

In this table the dark gold at 35% lightness (#856a2d) gives 5.13:1 with white text, which passes AA. Around 50% lightness (#be9841) neither choice is comfortable: white gives 2.71:1 and black 7.76:1, so it is effectively a black-text-only color. Mid-lightness colors are the hardest to use behind text. For checking any two colors you choose yourself, use the Contrast Checker.

A practical ratio: the 60-30-10 guideline

When a fresh palette leaves you unsure where to start, decide the proportions first. A widely used rule of thumb is 60% for the dominant color (backgrounds and large areas), 30% for a secondary color and 10% for an accent. With the five-step monochromatic palette you can use the lightest step as the background, a slightly darker step for cards and dividers, the darkest step for text and the base color as the accent, and it will rarely look off. The “Copy as CSS variables” button copies lines like --color-1: #...;, ready to paste inside a :root block.

Common mistakes and limits

What to do with the result

For a website, copy the CSS variables, define them in :root, and reference only the variables in buttons, links and backgrounds so the colors live in one place. If you need the same colors as RGB or HSL, the swatches already show those values, or use the Color Converter. For a smooth transition between two analogous colors, feed them into the CSS Gradient Generator. To train your eye for the differences these palettes depend on, the Color Matching Game is a quick exercise.

Frequently Asked Questions

How do I use the generated color codes?

Click a swatch to copy its HEX code to the clipboard and paste it into a design tool or stylesheet. “Copy as CSS variables” copies the whole current palette as variable declarations in one go.

Which scheme is best?

There is no single answer. Complementary and split-complementary suit designs that need emphasis; analogous and monochromatic suit calm, unified looks. Choose by how the colors will be used, and verify with the contrast numbers.

Can I enter the base color as a HEX code?

Yes. Type a 6-digit code such as #c9a961, or a 3-digit shorthand like #abc, into the HEX field and the color picker syncs and the palette refreshes. If the format is wrong, an error message appears.

Is a ratio below 4.5 always unacceptable?

For normal-size body text, aim for AA (4.5:1). Large headings (3:1 minimum), decorative elements and logos are treated more leniently in the guidelines. Whether accessibility rules are legally required depends on your site and region, so check the relevant requirements.

Which is easier to use, complementary or split-complementary?

Complementary has the strongest contrast and is easier to overdo. Split-complementary softens that same contrast, which makes it the safer starting point for beginners.

Does the monochromatic row include my base color?

The five steps are fixed at 20, 35, 50, 65 and 80% lightness, so none of them may match your base exactly. The base color is therefore shown as its own swatch at the front of the row.

Related tools