CSS Color Palette
Generate a palette, lock the colors you like and copy them as CSS custom properties. Uses the same palette as the home generator.
Press Space to generate · click 🔓 to lock a color · click a code to copy HEX, RGB, HSL, CSS or Tailwind
Last updated:
From swatches to :root variables
Press Copy CSS above and you get a block like this, ready to paste:
:root {
--color-1: #E879F9;
--color-2: #8B5CF6;
--color-3: #5EEAD4;
}
.button { background: var(--color-1); }Rename the variables to match your design system (--brand, --accent, --surface) once you settle on a set. Tailwind copies the same colors as a colors object for tailwind.config.
Steps
- Generate a palette and lock the colors you want to keep.
- Press Copy CSS (or Tailwind) and paste into your stylesheet.
- Check text and background pairs with the contrast checker.
- Export a PNG for reviews or moodboards.
Frequently asked questions
What does Copy CSS paste?
A :root block with --color-1 through --color-5 set to the current HEX values, for example --color-1: #E879F9;. Paste it into a stylesheet and use the colors with var(--color-1).
Why use CSS custom properties for a palette?
Custom properties keep each color in one place. Change the value in :root and every rule that uses var(--color-1) updates, which makes themes and dark modes easier.
Can I rename the variables?
Yes. Rename them to match your design system, for example --brand, --accent and --surface. The names are up to you; only the values come from the palette.