Color Palette Generator
Build a harmonious palette from one color, an image, or a random seed. Lock what you like, check contrast, and export code in one click.
Shades 50-950
Select Shades on any swatch to build its 50 to 950 scale. Select a chip to copy its HEX. The outlined chip matches your color most closely.
Accessible pairs in this palette (4.5:1 or higher)
Live interface preview
Export
Saved palettes
What is a color palette generator?
A color palette generator builds a set of harmonious colors from one starting color, an image, or a random seed. This generator applies color-harmony rules in the OKLCH color space, lets you lock the swatches you like, scores every color for WCAG contrast, and exports the result as CSS variables, Tailwind code, SCSS, JSON, or a PNG.
Key takeaways
- Press Space to generate a new palette, and lock any swatch to keep it.
- Seven harmony modes and five styles cover brand, interface, and data-visualization work.
- The generator builds colors in OKLCH, so lightness steps look even to the human eye.
- Every swatch shows its WCAG contrast score, and the tool lists the accessible pairs.
- You export to CSS, SCSS, Tailwind v3 and v4, JSON, and PNG.
How to use the color palette generator
You can create a usable palette in under a minute. Follow these steps.
- Press Space or select GenerateCreate a fresh palette in one keystroke. The generator picks a random base color and builds the remaining swatches from it.
- Choose a harmony mode and stylePick Monochromatic, Analogous, Complementary, Split-complementary, Triadic, Tetradic, or Auto. Then choose Balanced, Pastel, Vibrant, Muted, or Dark.
- Lock the colors you likeSelect Lock on any swatch. Locked colors stay in place while the generator rebuilds the rest around them.
- Start from your own color or imageEnter a HEX code and select Build, or upload an image. The tool extracts the dominant colors in your browser.
- Check contrast and color-blind safetyRead the WCAG contrast score on each swatch, review the accessible pairs, and switch the simulator to protanopia, deuteranopia, tritanopia, or achromatopsia.
- Export your paletteCopy CSS variables, SCSS, Tailwind v3 or v4 code, or JSON. Download a PNG, save the palette, or copy a share link.
Color harmony modes explained
A harmony mode defines how the hues in your palette relate to each other on the color wheel. The generator measures those relationships in OKLCH hue degrees, then spreads lightness evenly across the swatches so the palette has a clear light-to-dark structure.
| Mode | Hue relationship | Best for |
|---|---|---|
| Monochromatic | One hue, varied lightness and chroma | Minimal interfaces, dashboards, editorial layouts |
| Analogous | Neighboring hues, about 30 degrees apart | Calm brands, backgrounds, wellness and lifestyle |
| Complementary | Opposite hues, 180 degrees apart | Strong calls to action and high-contrast accents |
| Split-complementary | Base hue plus hues at 150 and 210 degrees | Vivid palettes with less tension than complementary |
| Triadic | Three hues, 120 degrees apart | Playful brands, illustrations, children products |
| Tetradic | Four hues, 90 degrees apart | Rich editorial work and categorical charts |
| Auto | Picks a mode at random each time | Inspiration when you have no starting point |
Palette styles
Styles change the lightness range and color intensity. Balanced suits general interfaces. Pastel raises lightness and softens chroma for gentle, friendly designs. Vibrant boosts chroma for bold campaigns. Muted lowers chroma for sophisticated, quiet palettes. Dark shifts the whole range toward dark surfaces for dark-mode themes.
Why this generator builds palettes in OKLCH
Most palette tools shift colors in HSL or RGB. Those models do not match human vision: two colors with the same HSL lightness can look very different in brightness. OKLCH fixes this. It describes a color with lightness, chroma (color intensity), and hue, and it keeps equal numeric steps visually equal.
This generator converts your base color to OKLCH, assigns a lightness ladder across the swatches, rotates the hue according to your harmony mode, and converts each result back to sRGB. When a color falls outside the sRGB gamut, the tool lowers chroma until the color fits while it preserves lightness and hue. You get palettes that feel balanced and print valid HEX codes.
Björn Ottosson created the OKLab color space, and the CSS Color Module Level 4 specification defines the oklch() function. Read the sources at the end of this page for details. To explore the space directly, open the OKLCH Color Picker.
How to build a palette for a website or app
A good interface palette assigns each color a job. The live preview above maps your swatches to the roles below, so you can judge the palette on real components instead of flat squares.
| Role | Job | Typical choice |
|---|---|---|
| Background | Page surface | Lightest swatch (darkest in dark mode) |
| Surface | Cards and panels | A subtle tint of the background |
| Text | Headings and body copy | Darkest swatch (lightest in dark mode) |
| Primary | Buttons, links, key actions | The most saturated mid-tone |
| Accent | Badges, highlights, charts | A second saturated color |
Apply the 60-30-10 guideline when you place these colors: use about 60 percent neutral background, 30 percent secondary surfaces, and 10 percent accent. Designers treat this ratio as a starting point. Adjust it to fit your content.
Next, turn your primary color into a full scale. Select Shades on the primary swatch, open the Scale 50-950 export tab, and paste the result into your Tailwind v4 theme. You can also refine the scale in the Tailwind Shade Generator.
Create a color palette from an image
Select Palette from image and choose a photo, product shot, logo, or screenshot. The tool shrinks the image to 64 by 64 pixels, groups similar pixels with k-means clustering, and returns the dominant colors sorted from light to dark. All processing happens in your browser, and the tool never uploads your image.
Use image palettes to match a brand to a hero photo, build a mood board, or pull a scheme from a painting. For exact pixel values, switch to the Image Color Picker. For brand work, try Logo to Palette.
Check accessibility before you ship a palette
Beautiful palettes still fail users when text contrast is low. This tool scores each swatch against white and black and shows the better result with its WCAG level. It also lists every pair in your palette that reaches 4.5:1.
- 4.5:1 is the WCAG 2.2 AA minimum for normal text.
- 3:1 is the AA minimum for large text and for interface components such as input borders and icons.
- 7:1 is the AAA target for normal text.
Contrast is only one part of accessibility. Use the color vision simulator to test how your palette looks with protanopia, deuteranopia, tritanopia, and achromatopsia. If two swatches look identical in the simulation, change their lightness, not just their hue. For perceptual contrast, compare your pairs in the APCA Contrast Checker, and for a full WCAG audit use the Color Contrast Checker.
Export formats and when to use them
| Format | Use it for |
|---|---|
| CSS variables | Any website. Includes HEX and OKLCH versions. |
| SCSS | Sass projects with variables and maps. |
| Tailwind v4 | An @theme block with OKLCH values. |
| Tailwind v3 | A colors object for tailwind.config.js. |
| Scale 50-950 | A full brand scale for the selected swatch. |
| JSON | Design tokens, scripts, and APIs. Includes HEX, RGB, OKLCH, and name. |
| PNG | Presentations, mood boards, and client approvals. |
Example of the Tailwind v4 output:
@theme {
--color-palette-1: oklch(0.940 0.031 281.4);
--color-palette-2: oklch(0.654 0.232 28.7);
--color-palette-3: oklch(0.470 0.241 277.0);
}
Need the same colors in other formats? Convert them with HEX to RGB or HEX to OKLCH, or turn two swatches into a smooth blend with the OKLCH Gradient Generator.
Common palette mistakes
- Using too many saturated colors. Keep one primary and one accent. Let neutrals do the rest.
- Choosing colors by hue only. Check lightness contrast, because two colors with different hues can still look the same to a color-blind user.
- Skipping real text tests. Preview your colors on headings, body copy, and buttons before you approve them.
- Forgetting dark mode. Use the dark preview to confirm that your text and surface colors still work together.
- Relying on color alone. Pair status colors with text or icons so every user understands them.
Frequently asked questions
What is a color palette generator?
A color palette generator builds a set of harmonious colors from one starting color, an image, or a random seed. This tool applies color-harmony rules in the OKLCH color space, lets you lock swatches, checks WCAG contrast, and exports the result as CSS, Tailwind, SCSS, JSON, or PNG.
How do I generate a color palette from one color?
Enter a HEX code in the Base color field and select Build. The generator keeps your color exactly and creates the other swatches with the harmony mode and style you selected.
How many colors should a palette have?
Five colors cover most projects: a background, a surface, a text color, a primary color, and an accent. Use three colors for minimal designs and seven or eight for dashboards and data visualization.
What is the 60-30-10 rule?
The 60-30-10 rule assigns about 60 percent of a layout to a dominant neutral, 30 percent to a secondary color, and 10 percent to an accent. Designers use it as a starting guideline, not a strict law.
Can I create a color palette from an image?
Yes. Select Palette from image and upload a photo or logo. The tool shrinks the image, clusters its pixels with k-means, and returns the dominant colors. The image never leaves your device.
What is OKLCH and why does this generator use it?
OKLCH describes a color with lightness, chroma, and hue. Equal lightness steps in OKLCH look equal to the human eye, so generated palettes feel balanced. HSL does not guarantee that. All current major browsers support the oklch() CSS function.
How do I use the palette in Tailwind CSS?
Open the Tailwind v4 tab to copy an @theme block with OKLCH values, or open the Tailwind v3 tab to copy a colors object for tailwind.config.js. Use the Scale tab to export a full 50 to 950 scale for one swatch.
Is the color palette generator free?
Yes. The tool is free, needs no account, and runs in your browser. Saved palettes stay in your own browser storage.
How do I check whether my palette is accessible?
Read the contrast score on each swatch and the Accessible pairs list. WCAG 2.2 AA requires 4.5:1 for normal text and 3:1 for large text and interface components. For a deeper check, test your pairs in the APCA Contrast Checker.
How do I keep some colors while I generate new ones?
Select Lock on the swatches you want to keep, then press Space or select Generate. The generator uses your first locked color as the base and rebuilds only the unlocked swatches.
Which color harmony works best for a brand?
Analogous palettes feel calm and cohesive, complementary palettes create strong calls to action, and triadic palettes feel energetic. Start with Analogous or Split-complementary if you are unsure, then test contrast on real text.
Are the generated palettes color-blind safe?
The generator does not guarantee color-blind safety, but it lets you check it. Switch the simulator to protanopia, deuteranopia, tritanopia, or achromatopsia, and confirm that your swatches still differ in lightness.