Color Palette Generator
{{ summary.primary }}
{{ summary.line }}
{{ badge.label }}
Color palette generator inputs
Start from a brand, UI, or accent color such as #2563eb.
Use analogous for close UI families, complementary or split for contrast, and triadic/tetradic for broader accent sets.
Five works well for a UI palette; larger sets are useful for category colors and token libraries.
colors
{{ signedPercent(saturation_adjust) }}
Leave at 0 for a neutral harmony; reduce for calmer UI palettes or increase for sharper accents.
{{ signedPercent(lightness_adjust) }}
Use small shifts to tune swatches for light or dark interfaces.
Generated keeps the base first; hue and lightness are useful when building token ramps.
Example: palette creates --palette-1, --palette-2, and matching RGB/on-color tokens.
Token HEX RGB HSL On color Text contrast Copy
{{ row.token }} {{ row.hex }} {{ row.rgb }} {{ row.hsl }} {{ row.onColor }} {{ row.contrastLabel }}
Foreground Background Ratio Normal text Large/UI Copy
{{ row.foreground }} {{ row.background }} {{ row.ratio }} {{ row.normalLabel }} {{ row.largeLabel }}
{{ cssOutput }}
Customize
Advanced
:

Introduction

Color palettes turn one starting color into a small set of related swatches. They help a brand mark, interface, chart, or content system feel intentional instead of stitched together from unrelated colors. A useful palette is not only attractive; it also needs enough contrast for text, controls, labels, and repeated visual categories.

Palette relationships from one base hue A base color can generate nearby, opposite, split, triadic, tetradic, and same-hue palette relationships, then each swatch needs a readable text color. Base hue to usable swatches seed hue relationships HEX on white RGB on black HSL contrast CSS tokens usable output needs format and contrast checks

Harmony modes describe the relationship between hues. Analogous palettes stay near the base hue, complementary palettes move toward the opposite hue, split complementary palettes use two near-opposites, and triadic or tetradic palettes spread accents more widely around the color wheel. Monochrome and tint/shade palettes keep the hue closer and change lightness instead.

A palette still needs review after the colors look balanced. Similar hues can fail as foreground and background pairs, pale colors may need dark text, and a vivid accent can dominate if it is used too often. Contrast ratios, text-color choices, and reusable tokens make the palette easier to test before it reaches a page, chart, or style guide.

Technical Details:

HEX, RGB, and HSL are different ways to describe the same sRGB color. HEX stores red, green, and blue channels as hexadecimal values. RGB writes those channels as numbers from 0 to 255. HSL uses a hue angle from 0 to 360 degrees plus saturation and lightness percentages, which makes hue rotation and tint or shade changes easier to reason about.

Palette generation starts by normalizing the base HEX value, converting it to HSL, then deriving companion colors from hue offsets and lightness stops. The base color remains anchored as the first swatch. Saturation and lightness adjustments affect generated companion colors while preserving the starting color for comparison.

Harmony mode mechanics
Harmony mode Color relationship Practical use
Analogous Companion hues step near the base hue in both directions. Close interface families, calm accents, and brand-adjacent variants.
Complementary Companions include the opposite hue and related bridge accents. Strong callouts, status colors, and high-contrast accent planning.
Split complementary Two near-opposite hues replace the single direct complement. Contrast with less tension than a pure opposite pair.
Triadic or tetradic Hues spread around the wheel in three- or four-point patterns. Category colors, chart accents, and broader theme exploration.
Monochrome or shades and tints Hue stays fixed while lightness and saturation produce ramps. Token scales, background fills, borders, and single-brand systems.

Contrast uses relative luminance, not visual preference. Each sRGB channel is linearized, the luminance values are weighted, and the lighter color is compared with the darker color. The same formula is used for black-or-white on-color selection and for every foreground/background pair in the pair table.

L = 0.2126R+0.7152G+0.0722B contrast ratio = Llighter+0.05Ldarker+0.05
Contrast interpretation thresholds
Ratio Meaning used here Reading caution
Less than 3:1 Fails the large-text or user-interface control threshold. A pair this low should not carry essential text or control state.
3:1 to below 4.5:1 May work for large text or UI graphics, but not normal body text. Use the pair only where size, weight, and placement are controlled.
4.5:1 to below 7:1 Meets the common AA target for normal text. Still test small labels, thin fonts, hover states, and dim displays.
7:1 or higher Meets the stronger AAA contrast target for normal text. High contrast helps readability, but brand tone and hierarchy still matter.

CSS custom properties turn swatches into reusable names such as --palette-1, plus matching RGB, HSL, and on-color values. The prefix is cleaned before output, so unsafe characters are replaced and names that do not start like a valid custom property are made safer for reuse.

Everyday Use & Decision Guide:

Start with a real base color rather than a temporary favorite. A brand blue, product accent, or chart series color gives the generated palette a clear anchor. Keep the first pass to five colors unless you already know the palette needs more categories; larger sets are harder to name, test, and apply consistently.

Analogous is a good first mode for interface surfaces and subtle accents. Complementary or split complementary is better when the palette needs a clear opposing accent. Triadic and tetradic modes can produce stronger category sets, but they need more contrast review because the colors may compete for attention. Monochrome and shades/tints are better for ramps, backgrounds, dividers, and neutral-adjacent tokens.

  • Use Base color for a 3- or 6-digit HEX value. The picker and text field stay aligned, and invalid text stops output until the HEX value is fixed.
  • Set Color count from 3 to 10. The tool reports an error outside that range rather than silently treating an extreme value as a reliable palette.
  • Use small Saturation adjustment and Lightness adjustment changes first. Big swings can make companion colors feel unrelated to the seed.
  • Change Sort order only after the palette is generated. Hue and lightness order help inspect ramps, while best text contrast brings the most readable on-color swatches forward.
  • Set the CSS variable prefix before copying tokens so names match the project vocabulary.

The black-or-white on-color shown on each swatch is a text-color recommendation for that single swatch. It does not mean every palette color can sit on every other palette color. Open Contrast Pairs when one swatch will be text, an icon, or a button label on another swatch.

Palette generation and export actions run in the browser session. The tool does not need server-side calculation for the base color, generated swatches, contrast ratios, CSS tokens, or JSON payload.

Step-by-Step Guide:

  1. Enter a valid HEX base color, or use the color picker to choose one.
  2. Choose the harmony mode that matches the job: close family, opposite accent, wider category spread, or same-hue ramp.
  3. Set a color count from 3 to 10. Five is a useful first pass for UI palettes.
  4. Open Advanced only when the first output needs tuning. Adjust saturation or lightness, pick a sort order, and set the CSS prefix.
  5. Review Palette Swatches for role labels, HEX values, and the chosen on-color for each swatch.
  6. Open Color Specs to compare HEX, RGB, HSL, on-color, and text contrast values.
  7. Open Contrast Pairs before using one palette color on another. Treat Review or Fail rows as blockers for text unless the final design has been tested carefully.
  8. Use Hue Lightness Map to inspect hue spread and lightness distribution, then copy CSS tokens or JSON when the palette passes the checks you need.

Interpreting Results:

The summary line reports the palette size, harmony mode, seed color, and how many swatches have readable black-or-white on-color tokens. A clean summary means the input is valid, not that every color pair is accessible. Pairwise contrast needs its own check because two attractive colors can be too close in luminance.

Result areas and how to read them
Result area What to trust What to double-check
Palette Swatches Generated order, token name, HEX value, role label, and black-or-white on-color. Whether the role label matches how the color will be used.
Color Specs HEX, RGB, HSL, on-color, and text contrast for each swatch. Round-trip consistency if another design tool rewrites color values.
Contrast Pairs Foreground/background ratios for every distinct palette pair. Rows marked Review or Fail before using text, icons, or controls.
Hue Lightness Map Hue on the horizontal axis, lightness on the vertical axis, and saturation by point size. Clusters that look different as hues but sit too close in lightness.
CSS Tokens and JSON Reusable color values, channel values, on-color choices, and contrast data. Token prefix and naming order before handoff to a style system.

Do not read AAA on an on-color token as an approval for all palette combinations. It only says black or white has strong contrast on that swatch. A colored foreground on a colored background can still fall below 3:1.

Worked Examples:

With base #2563EB, analogous mode, five colors, and no advanced adjustment, the first swatch stays #2563EB. The next generated swatches are #0A83B4, #756AEE, #077A6D, and #C9A1F4. The on-color choices alternate between white and black depending on relative luminance.

In that same run, the pale purple swatch #C9A1F4 receives black as its on-color with a 9.89:1 ratio, while the blue seed receives white with a 5.17:1 ratio. Those are single-swatch text recommendations. The pair table still flags some palette-on-palette combinations for review because the colors are not far enough apart in luminance.

For a token ramp, switch to monochrome or shades and tints, keep the count near 5, then sort by lightness. That makes it easier to choose a background, border, hover, active, and text-support color without mixing unrelated hues into a single-purpose scale.

FAQ:

Can a generated palette replace a design review?

No. The generator provides deterministic swatches, specs, contrast ratios, and exportable values. It cannot judge brand fit, emotional tone, print behavior, or whether a color carries the right meaning in your product.

Why does the same color have HEX, RGB, and HSL values?

They are different notations for the same sRGB color. HEX is compact, RGB shows channel values directly, and HSL makes hue, saturation, and lightness easier to inspect.

Why are some contrast pairs marked Review or Fail?

Those labels compare two palette colors as foreground and background. Similar luminance can produce low contrast even when the hues look different. Use those rows to avoid unreadable text and weak control states.

What prefix should CSS tokens use?

Use a short project term such as brand, accent, or chart. The output then becomes names such as --brand-1, with related RGB, HSL, and on-color tokens.

Glossary:

Base color
The starting HEX color used as the first swatch and hue anchor.
Harmony mode
The hue relationship used to derive companion colors.
HSL
Hue, saturation, and lightness notation for an sRGB color.
On-color
The black or white text color with stronger contrast on a specific swatch.
Contrast ratio
A relative luminance comparison between foreground and background colors.
CSS custom property
A reusable CSS value name that begins with two dashes, such as --palette-1.