Color Palette Generator
Build five-color harmonies, lock swatches, check text contrast and export CSS or JSON.
This tool runs entirely in your browser. Your data is never uploaded, never stored, and never leaves your device.
Generate five-color harmonies from a base color, preserve locked swatches, inspect text contrast and export CSS or JSON.
How to use it
- 1Choose an opaque base color and harmony.
- 2Lock colors to retain, then generate the palette.
- 3Choose a text color and inspect each contrast ratio.
- 4Copy CSS or download CSS/JSON for the current palette.
Example
- Input
- #ff0000, Triadic, unlocked
- Output
- First three: #ff0000, #00ff00, #7070ff
What happens to your data
Palette generation and exports run locally; no account, upload or remote color service is used.
Last updated October 2026
Build a five-color palette around an existing brand color instead of starting from unrelated random swatches. Choose an analogous, complementary, triadic or monochromatic relationship, lock colors you want to retain, and regenerate the remaining positions. Export the current result as CSS custom properties or JSON with measured text-contrast values.
A visually related palette is not automatically suitable for readable text. The page previews a chosen text color on every swatch and calculates its WCAG contrast ratio. These checks help you separate decorative colors from combinations that can work for text, while leaving the final design decision in your hands.
How it works
The base is an opaque sRGB color supplied as HEX, RGB or HSL. Analogous colors use hue offsets of ±30° and ±60°. Complementary uses a 180° partner with light/dark variants; triadic uses 120° and 240° partners with variants. Monochromatic keeps the hue and uses lightness steps. The first position uses the base unless locked. Locked positions retain their exact HEX values even when the seed or harmony changes.
The process is deterministic: the same base, harmony and locks produce the same result. Gray seeds remain gray because they have no saturation; black and white can produce repeated swatches in some harmonies. HSL spacing is not perceptually uniform, and these relationships are starting points rather than proof that a palette is unique, balanced or accessible. Changing the seed or harmony pauses exports until you generate the updated palette.
Contrast compares the selected opaque text color with each opaque background using WCAG 2 relative luminance. Normal-size AA text needs 4.5:1; large text needs 3:1. Large means at least 24 CSS pixels, or approximately 18.67 pixels when bold. Pass/fail uses the full ratio rather than a rounded display. JSON includes the ratios and AA/AAA flags; the CSS export contains only the five color variables. Neither export is a complete accessibility audit of your interface. Processing and downloads stay on your device.
Worked example: start a triadic palette from red
- Input
- Base #ff0000; Triadic; all colors unlocked
- Result
- First three swatches: #ff0000, #00ff00, #7070ff
The third position is a lighter blue variant. Locked positions override the harmony.
Common use cases
- Extending a brand color into an initial interface palette
- Preserving approved colors while exploring alternatives
- Checking a text color against several backgrounds
- Exporting CSS variables and a contrast report for implementation
Frequently asked questions
Why do the colors not change when I generate again?+
Generation is based on the selected base color, harmony and locks, not a random shuffle. Change the base or relationship to explore a new result. Locked swatches deliberately stay unchanged.
Does an AA label mean the whole page is accessible?+
No. It evaluates one opaque text/background pairing at the WCAG contrast threshold. Font size, states, images, focus indicators, content structure and other accessibility requirements still need checking.
Why did a locked color break the harmony?+
A lock is an explicit instruction to retain that color. It takes priority over the mathematical relationship. Unlock the position and generate again if you want every position to follow the selected harmony.
What is included in the downloads?+
CSS contains five custom properties named --palette-1 through --palette-5. JSON contains the colors, chosen text color, contrast ratios and threshold flags. There are no remote image URLs or uploaded inputs.
Standards and limitations
Used in these workflows
Related tools
Color Contrast Checker
Audit layered text, UI controls and palettes against WCAG 2.2, then apply a safer accessible shade.
Color Converter & Picker
Convert HEX, RGB and HSL colors with alpha, preview transparency and copy complete CSS values.
Image Color Picker
Pick original image pixels by coordinates, inspect HEX and RGBA, and export local swatches.
Color Shades Generator
Generate tints and shades of any base color.