Color Palette Generator

Generate five harmonious colors, lock the shades you want to keep, fine-tune any swatch and export them as hex codes or CSS custom properties.

Your palette

Generate new colors, lock the ones you like, or edit any swatch. Click a hex code to copy it. Tip: press Space to generate when you are not typing in a field.

Export

The palette lives only in this tab. Copy or download it before you leave.

How to build a palette

  1. Press Generate palette (or the Space bar) to get five colors built around a random base hue.
  2. Lock any color you want to keep. Locked swatches stay put the next time you generate.
  3. Click the color box under a swatch to fine-tune it with your system color picker.
  4. Click a hex code to copy it, use Copy colors for the whole list, or export CSS variables.

How the colors are chosen

Each new palette starts from a random hue and places the other four colors at fixed offsets around the color wheel: next to it (analogous), opposite it (complementary) and a step either side of that. Lightness is varied from dark to light, so every palette has a deep color for text or backgrounds, mid tones for accents and a light color for surfaces. Saturation alternates slightly so the five colors do not all shout at once.

SwatchHue offsetLightnessTypical role
1base31%Text, dark backgrounds
2+25°55%Primary accent
3+180°76%Light surface
4+205°67%Secondary accent
5+325°43%Highlights, buttons

Using the palette in CSS

The export block is a set of CSS custom properties, --color-1 to --color-5, inside :root. Paste it into your stylesheet and use the colors anywhere with var(--color-2). Rename the variables to roles such as --brand or --surface once you settle on them; it makes later changes much easier.

Check text contrast before you ship. WCAG 2 asks for a contrast ratio of at least 4.5:1 for normal body text and 3:1 for large text. As a rule, put text in swatch 1 on swatch 3, and avoid putting body text on the mid tones.

Tips for better palettes

  • Start from a brand color. Edit swatch 1 to your existing color, lock it, and generate until the rest fit.
  • Use one accent. Most interfaces need one strong accent and several neutrals, not five loud colors.
  • Test on real content. Colors look different in a large block, a thin line and small text.
  • Need a background? Combine two swatches in the CSS gradient generator.

The palette exists only in this tab and is never sent anywhere. Copy or download it before closing the page.

Frequently asked questions

How do I keep a color while generating new ones?

Click Lock on that swatch. Locked colors stay the same each time you generate a new palette. Click again to unlock.

How do I copy a hex code?

Click the hex code on a swatch and it is copied to your clipboard. Copy colors copies all five as a comma-separated list.

Can I enter my own brand color?

Yes. Use the color box on any swatch to pick an exact color, then lock it and generate the rest.

What does the CSS export contain?

Five CSS custom properties named --color-1 to --color-5 inside a :root block, ready to paste into a stylesheet.

Is there a keyboard shortcut?

Press Space to generate a new palette when you are not typing in a field or focused on a button.

Are palettes saved?

No. The current palette stays only in this tab. Copy or download the CSS before you leave the page.

How do I check text contrast?

Use dark swatches for text on light ones. WCAG 2 recommends at least 4.5:1 for body text and 3:1 for large headings.

Is it free to use the colors commercially?

Yes. Colors are not owned by anyone, and the palettes you generate are yours to use.