Color Palette Generator
Color Palette Generator
Generate, lock and contrast-check palettes. Free, no sign-up, and nothing leaves your browser.
Tap a color to copy it. Lock colors you like, then generate again. On desktop, press Space with the tool focused.
Contrast check
Text AA = 4.5:1 · Text AAA = 7:1 · Large text AA = 3:1 (18pt, or 14pt bold) · UI components = 3:1
Color-blindness preview
Export
Extract from image
Or drop or paste an image here. Colors are extracted entirely in your browser. The image is never uploaded.
Saved palettes
Free Color Palette Generator with Built-In Contrast Checker
This color palette generator creates palettes of 2 to 8 colors, lets you lock the ones you like, and checks every pair of colors for readable contrast before you use them. Start from random colors, from a HEX color you already have, or from a photo. Then copy each color as HEX, RGB, HSL or OKLCH, or export the whole palette as CSS variables, a Tailwind config snippet, JSON or a PNG image.
It is built for web designers and developers choosing interface colors, small business owners and creators starting a brand look, students working on projects, and anyone who needs text and background colors that people can actually read. A palette can look good as a row of swatches and still produce hard-to-read text. The contrast results sit right next to the palette so you can catch that early.
Private by design. The tool does not upload your colors or images. Palette generation, image color extraction and saving all happen in your browser.
How to Use the Color Palette Generator
- Generate a palette. Choose how many colors you want (2 to 8) and a harmony mode, then press Generate. On a desktop keyboard you can also click or tab to the palette area and press Space.
- Lock what you like. Press Lock under any color to keep it. When you generate again, only the unlocked colors change.
- Optional: start from your own color. Type a HEX code such as #0E5A68 in the “Build around a color” field and press Build. That color becomes color 1, is locked, and the rest of the palette is built around it.
- Fine-tune and copy. Use Edit to open a color picker for any swatch. Tap or click a swatch to copy its value in the format you selected (HEX, RGB, HSL or OKLCH). Undo and Redo step through your last 50 changes.
- Check contrast. Open Contrast check to see the ratio and pass/fail result for every pair of colors. If a pair fails, press Suggest fix and then Apply to accept the suggested change.
- Preview color-blindness. Open Color-blindness preview to see how the palette may look with protanopia, deuteranopia and tritanopia.
- Export, save or share. Use Export to copy or download the palette, Save to keep it in your browser, or Share link to copy a link that reopens the same palette.
Main Features
Color locking
Keep a brand color or a favorite and keep exploring around it. Locked colors never change when you generate again.
Five harmony modes
Random uses any hue. Analogous stays near a base hue. Complementary pairs a hue with its opposite. Triadic spreads hues roughly 120° apart. Monochromatic stays in one hue and varies lightness and saturation.
WCAG contrast checker
Every pair of palette colors gets a contrast ratio plus pass/fail chips for normal text, enhanced (AAA) text, large text and UI components. A filter can hide pairs that fail AA text.
Nearest passing color
For a failing pair, the tool suggests a small lightness change to one unlocked color to reach 4.5:1. It never changes a locked color.
Color-blindness preview
See your palette next to simulated protanopia, deuteranopia and tritanopia versions to check that colors stay distinguishable.
Extract colors from an image
Choose, drop or paste a photo and get a palette from its dominant colors. The image is processed on your device and never uploaded.
Developer-ready export
Copy or download a plain color list, CSS variables, a Tailwind config snippet or JSON. You can also download the palette as a PNG image.
Save, import and share
Save palettes in your browser, export them as a backup file, import them later, or share a link that rebuilds the palette.
Four color formats
Switch between HEX, RGB, HSL and OKLCH. The swatches, copy buttons and exports all follow your choice.
Practical Uses and Examples
Pick colors for a website or app
Build around your brand color, generate until the supporting colors feel right, then open the contrast check. Look for a pair that reaches at least 4.5:1 for body text and 3:1 for buttons and borders. Export as CSS variables and paste the result into your stylesheet:
:root {
--palette-1: #0E5A68;
--palette-2: #F2F6F4;
--palette-3: #A9D94B;
}
Add a custom palette to Tailwind CSS
The Tailwind export adds your colors under theme.extend.colors as a group named palette with numbered keys, so you can use classes such as bg-palette-1 and text-palette-2. This is a simple numbered set of your palette colors, not a full 50–950 shade scale.
Create a palette from a photo
Upload a product shot, a landscape or a mood image to get colors that already belong together. This is useful for matching a website, slide deck or social graphic to a photo. Photos with only a few distinct colors will return fewer colors than you asked for.
Check whether two specific colors work together
Set the number of colors to 2, enter your first color in “Build around a color,” then use Edit on the second swatch to set your text or background color. The contrast check shows the ratio and which levels the pair passes.
Test colors for color-blind readers
If your design uses color alone to separate states such as success and error, the color-blindness preview shows whether those colors become hard to tell apart. Pair color with text labels or icons where the preview looks risky.
Understanding Color Contrast Ratios
Contrast ratio compares the brightness of two colors, from 1:1 (identical) to 21:1 (black on white). The thresholds below come from the Web Content Accessibility Guidelines (WCAG), which the checker in this tool follows.
| Use | Level | Minimum ratio |
|---|---|---|
| Normal text | AA | 4.5:1 |
| Large text | AA | 3:1 |
| Normal text | AAA | 7:1 |
| Large text | AAA | 4.5:1 |
| UI components and meaningful graphics | AA | 3:1 |
Large text means at least 18pt (about 24px), or 14pt (about 18.66px) if bold. Logos and brand names are exempt from these requirements. In the tool, the “Large” chip shows the 3:1 large-text threshold and “UI” shows the 3:1 component threshold. Sources: WebAIM: Understanding WCAG 2 contrast and W3C: Understanding contrast (minimum).
Which Color Format Should You Use?
- HEX (for example #0E5A68) is the most widely supported format and the safest default for websites, design tools and documents.
- RGB expresses the red, green and blue values. It is handy when a tool or code library asks for separate channels.
- HSL describes hue, saturation and lightness, which makes manual adjustments easier to reason about.
- OKLCH is a perceptual format, so equal lightness changes look more even to the eye. It works in modern CSS, but check browser support if you need to support older browsers.
Limitations to Know About
- Palettes are generated algorithmically with a random element. The tool does not use AI, does not learn your taste, and cannot guarantee a result fits your brand.
- Contrast is checked between the colors in your palette. To test against pure white or black, change one swatch to #FFFFFF or #000000 with Edit.
- Transparency (alpha) is not supported. Use 6-digit colors, or 3-digit shorthand such as #0AF.
- Suggest fix only changes lightness and targets 4.5:1. For some pairs no lightness change is enough, and the tool will say so.
- Color-blindness previews are approximations. Treat them as a quick check, not a replacement for testing with real users.
- Colors look different across screens, and printed colors differ from on-screen colors. Always proof important print work.
- Image extraction accepts images up to 15 MB. Some formats, such as HEIC, may not open in every browser. JPG, PNG and WebP are the safest choices.
- Saved palettes live only in the browser you saved them in. Use Export saved to keep a backup.
Color Palette Generator FAQ
How does this color palette generator choose colors?
It picks colors in the OKLCH color space using hue rules for the harmony mode you select, spreads lightness across the palette, and avoids near-duplicate colors. It then converts the result to HEX. There is randomness in every run, so each press of Generate gives a different palette.
Is it free, and do I need an account?
The tool is free to use and does not ask you to sign up or log in. Saved palettes are stored in your own browser rather than in an account.
How do I keep one color and change the rest?
Press Lock on the color you want to keep and press Generate again. To start from a specific color, enter its HEX code under “Build around a color” and press Build. That color is placed first and locked automatically.
How do I know if my color palette is accessible?
Open Contrast check. Each pair shows its ratio and chips for AA text (4.5:1), AAA text (7:1), large text (3:1) and UI components (3:1). Use text colors from pairs that pass AA, and add the color-blindness preview as a second check.
What does “Suggest fix” do?
For a pair below 4.5:1, it looks for the smallest lightness change to one of the two colors that reaches 4.5:1, keeping its hue and color intensity as close as possible. Nothing changes until you press Apply. If both colors are locked, unlock one first.
Can I extract a color palette from an image?
Yes. Open Extract from image, then choose, drop or paste an image. The tool groups similar pixels and returns up to the number of colors currently selected. Transparent areas are ignored. Everything runs in your browser, so the image is not uploaded.
Which export format should I choose?
Use CSS variables for plain websites and stylesheets, Tailwind config for Tailwind projects, JSON for scripts or design tokens, the color list for quick pasting, and PNG to share the palette as an image.
Why does my HEX code with transparency get rejected?
Palettes in this tool are opaque colors, so 4-digit and 8-digit HEX codes with an alpha channel are not accepted. Enter the 6-digit color (or a 3-digit shorthand) and handle transparency in your own CSS.
Why did my saved palettes disappear?
Saved palettes are kept in your browser’s local storage. Clearing site data, switching browsers or devices, or using private browsing can remove them or prevent saving. Use Export saved to download a backup file and Import saved to restore it.
What does the share link contain?
The link stores the palette’s colors, which colors are locked and the harmony mode at the end of the page address. Anyone who opens it sees the same palette. Your saved palettes are not included.
Why does a pair that looks fine fail the contrast check?
Contrast is calculated from the relative brightness of the two colors, not from how pleasant or distinct they look. Two colors with different hues can still have similar brightness and fail. A pair that fails 4.5:1 may still pass the 3:1 threshold for large text or UI components.
Does it work on phones and tablets?
Yes. Use the Generate button instead of the Space shortcut, tap a swatch to copy it, and use Edit to open your device’s color picker. Image extraction also works with photos from your device.
Are the color-blindness previews exact?
No. They are approximate simulations of protanopia, deuteranopia and tritanopia and vary between individuals and screens. They are a quick way to spot colors that blend together, not a clinical or compliance test.
What keyboard shortcuts are available?
With focus on the tool (not inside a text field), press Space to generate a new palette, Ctrl or Cmd + Z to undo, and Ctrl or Cmd + Shift + Z (or Ctrl + Y) to redo.