Color Palette Generator
Build complementary, analogous, triadic, tetradic, square and monochromatic palettes from any CSS color on an HSL or OKLCH wheel. Copy as CSS, Tailwind or JSON.
- Runs in your browser
- Tool input is not uploaded to ZeroTool servers
- Free · No Sign-Up
Scan with WeChat to share this tool
Examples, details and FAQ Worked examples, how it compares with other tools, and answers to common questions.
What each scheme means
Every scheme except monochromatic keeps the saturation and lightness (or OKLCH lightness and chroma) of the base and only turns the hue. Tetradic is the rectangle (two complementary pairs); square is a separate card. HSL results for #3B82F6, the blue-500 of the Tailwind CSS v3 palette:
| Scheme | Hue offsets | Result for #3B82F6 (HSL wheel) |
|---|---|---|
| Complementary | 0°, 180° | #3B82F6, #F6AF3B |
| Split complementary | 0°, 150°, 210° | #3B82F6, #F6523B, #E0F63B |
| Analogous | −30°, 0°, +30° | #3BE0F6, #3B82F6, #523BF6 |
| Triadic | 0°, 120°, 240° | #3B82F6, #F63B82, #82F63B |
| Tetradic (rectangle) | 0°, 60°, 180°, 240° | #3B82F6, #AF3BF6, #F6AF3B, #82F63B |
| Square | 0°, 90°, 180°, 270° | #3B82F6, #F63BE0, #F6AF3B, #3BF652 |
| Monochromatic | same hue, lightness 15 / 32.5 / 50 / 67.5 / 85% | #031E49, #07419E, #0B64F4, #3B82F6, #B6D0FC |
Monochromatic uses five fixed lightness steps; the step closest to the base (67.5% here, because the base is at 59.8%) is replaced by the base itself, so the base always appears exactly once. The HSL math follows CSS Color 4 §7; channels that land exactly on .5 round up, as CSS specifies. For an 11-step scale (50–950) of one color, use the Color Shades Generator.
HSL wheel or OKLCH wheel
HSL hue is cheap to compute but not perceptually even: turning the same blue by 180° gives #F6AF3B, which is much lighter than the base. On white it reaches only 1.89:1, while the base reaches 3.68:1. The OKLCH wheel turns the hue in Oklab's polar form and keeps lightness and chroma, so the complement becomes #B57A00 at almost the same lightness (OKLCH L 62.5% against 62.3%).
Equal lightness is useful for tags, chart series and buttons that share one text color: the OKLCH triad #3B82F6, #E24956, #3BA01B gives 3.68, 3.95 and 3.37:1 against white, while the HSL triad gives 3.68, 3.58 and 1.38:1. The same property has a cost: #E24956 and #3BA01B are only 1.17:1 apart, so a red/green pair that differs in hue alone is hard to tell apart for people with red-green color vision deficiency. Check such pairs with the Color Blindness Simulator and do not use color as the only signal (WCAG 1.4.1).
A turned OKLCH color can fall outside sRGB. The tool then runs the CSS Color 4 gamut mapping (binary search on chroma with local MINDE, JND 0.02), marks the swatch with ◆ and tells you how many colors were mapped. For #3B82F6, 11 of the 24 OKLCH swatches are mapped. An oklch() base outside sRGB is mapped the same way, so the Base swatch shows the nearest displayable color and the status line says so. The swatch labels use WCAG 2.2 relative luminance to pick black or near-white text, whichever has more contrast.
Input formats and error messages
The input reads CSS Color 4 syntax for hex (with or without #), rgb(), hsl(), oklch() and the 148 named colors, and ignores a trailing semicolon or quotes. For a valid input that is not a 6-digit hex value (with or without #), the status line shows what it was read as. While the input is not a color, the palettes and the code are removed and the copy buttons are off, so nothing from the previous color can be copied. Errors appear on Enter or after a short pause in typing:
| Input | Result |
|---|---|
rgb(59 130 246 / 50%) | Read as #3B82F6; transparency is ignored |
oklch(62.3% 0.214 259.815) | Read as #2B7FFF; outside sRGB, chroma reduced |
#3b82f | A hex color has 3, 4, 6 or 8 digits. This one has 5. |
#3b82fg | “g” (character 7) is not a hex digit |
lab(50% 20 30) | lab() is not supported |
The second row is Tailwind CSS v4's blue-500 from the v4 color reference; its chroma is beyond sRGB, so the tool maps it first.
Copy as CSS, SCSS, Tailwind or JSON
Variable names are the scheme name plus a position, such as --complementary-2. On the OKLCH wheel, with OKLCH values and Tailwind v4 selected, the complementary card copies:
@theme {
--color-complementary-1: oklch(62.31% 0.188 259.81);
--color-complementary-2: oklch(62.47% 0.1317 75.15);
}
Paste that block after @import "tailwindcss"; and Tailwind v4 creates utilities such as bg-complementary-2; the --color-* namespace is how Tailwind adds custom colors. The other formats are a value list, CSS variables in :root, SCSS $variables, a Tailwind v3 config and JSON. HSL and OKLCH values keep enough decimals to convert back to the same hex, because integer HSL loses colors: hsl(217, 100%, 61%) is #3884FF, not #3A86FF.
How it differs from Adobe Color and Coolors
Tested on 2026-10-01 with base #3B82F6:
- Adobe Color uses a different wheel. Its Triad rule put #C5F53B and #F5533B next to the base, and its Complementary rule put #F5B83B there (each with two muted variants added). On the HSL wheel the triad is #F63B82 and #82F63B. Neither result is wrong; they come from different wheels, and this tool states which one it uses.
- Coolors exports CSS variables without a selector (lines such as
--azure-blue: #3a86ffff;), so the block is not valid on its own in a .css file, and its HSL export rounds to integers (hsla(217, 100%, 61%, 1)for #3A86FF converts back to #3884FF). Its Tailwind export builds a 50–950 scale whose 500 step is #0062ff, not the palette color. This tool wraps CSS in:root, keeps decimals and exports the palettes it computed. The test suite parses the CSS and@themeoutput with css-tree, runs the v3 config as CommonJS and reads the JSON withJSON.parse; an optional toolchain run compiles the SCSS with Dart Sass and the@themeblock with Tailwind v4.
Both can lock colors while shuffling the rest, start from an image and save palettes to an account; this tool does none of that. To pull colors from a photo, use the Image Color Palette Extractor.
FAQ
Should I use the HSL wheel or the OKLCH wheel?
Use HSL when you want the classic color-wheel result that most tools and tutorials show. Use OKLCH when the colors should look equally light: OKLCH keeps the perceived lightness of the base, so text that is readable on one swatch is usually readable on the others. OKLCH rotations often leave the sRGB gamut; the tool then lowers chroma and marks those swatches with ◆.
What does the ◆ mark on a swatch mean?
The rotated color does not exist in sRGB at the base color's chroma. The tool reduces chroma with the CSS Color 4 gamut mapping algorithm (binary search with local MINDE, JND 0.02), so lightness and hue stay close to the target. It happens only on the OKLCH wheel.
Why does every card show the same gray?
A gray such as #808080 has no hue, so rotating the hue changes nothing. The status line says so. The monochromatic card still gives five different grays. Very low-chroma colors give swatches that differ only slightly, and the tool shows that chroma value.
Which input formats are accepted?
Hex with or without # (3, 4, 6 or 8 digits), rgb() and rgba(), hsl() and hsla() in comma or space syntax, oklch(), and the 148 CSS color names. Alpha is ignored because palettes are opaque. Full-width characters from an IME are converted. Other functions such as lab() or color() show an error.
Does the tool upload or store my colors?
No. The palettes are computed in the page with JavaScript, and the colors are not sent. The tool saves only three settings in your browser (wheel, color format and code format) so they are the same on your next visit; the base color is not saved. Remove them by clearing this site's data in your browser; Ctrl/⌘+L empties the color field but keeps the settings. The tool's usage events record only the tool name and the action: generate when you commit a color (leave the text field or close the color picker), random, and each copy. If you open the page from a link with ?color=, that color is part of the page address, which the analytics page view records like any other address.