Color palette generator

Enter a base color as HEX, RGB or HSL or pick one with the color picker, then choose a color harmony. The generator rotates the hue around the HSL color wheel and shows each color as a swatch with HEX, RGB and HSL values ready to copy.

e.g. #3B82F6, rgb(59, 130, 246) or hsl(217, 91%, 60%)
Your inputs are saved in this browser only.

Swatches

  • Base color#3B82F6
  • +120°#F63B82
  • +240°#82F63B

Result

Color palette
ColorHEXRGBHSL
Base color#3B82F6rgb(59, 130, 246)hsl(217, 91%, 60%)
+120°#F63B82rgb(246, 59, 130)hsl(337, 91%, 60%)
+240°#82F63Brgb(130, 246, 59)hsl(97, 91%, 60%)

How it is calculated

How the color harmonies are built

The generator converts the base color to the HSL model (hue H in degrees, saturation S and lightness L in percent, as defined in CSS Color Module Level 4). For each harmony only the hue is rotated; saturation and lightness stay the same. Each color is then converted back to sRGB and rounded to whole values from 0 to 255.

HarmonyHue rotationColors
Complementary0°, 180°2
Analogous−30°, 0°, +30°3
Triadic0°, 120°, 240°3
Split-complementary0°, 150°, 210°3
Tetradic (rectangle)0°, 60°, 180°, 240°4
Square0°, 90°, 180°, 270°4
Monochromeno rotation; lightness in 5 steps5

Example: pure red #FF0000 has H = 0°, S = 100%, L = 50%. Rotated by 180° it becomes H = 180° – that is cyan #00FFFF, its complementary color. A triadic palette adds 120° (green #00FF00) and 240° (blue #0000FF).

Monochrome palette

With “Monochrome” the hue stays the same. Lightness moves in two equal steps toward black and two steps toward white. For the default color #3B82F6 (L ≈ 60%) the steps land at roughly 20%, 40%, 60%, 73% and 87%.

Readable text on the swatches

The label on each swatch is black or white – whichever gives the higher contrast according to the WCAG relative luminance formula. That way the text always reaches at least 4.58:1. To check whether two colors from your palette work together as text and background, use the contrast checker.

Limitations

HSL is a simple geometric model, not a perceptually uniform one: at the same L, yellow looks much lighter than blue. Treat the calculated harmonies as a starting point and fine-tune by eye. Grays have no hue, so rotating them returns the same color.

Frequently asked questions

What is the complementary color of blue?

It sits 180° opposite on the HSL color wheel. For blue #0000FF (H = 240°) that is yellow #FFFF00 (H = 60°); for #3B82F6 (H ≈ 217°) it is an orange around #F6AF3B.

Which input formats does the generator accept?

HEX with 3, 4, 6 or 8 digits (with or without #), rgb() and rgba(), hsl() and hsla(), hsv()/hsb(), hwb() and three plain numbers such as “59, 130, 246” (read as RGB). Both the comma and the space syntax from CSS Color 4 work.

How do I use the colors in CSS or a design app?

Each swatch has a copy button for its HEX value. “Copy as CSS variables” puts a :root block with --farbe-1, --farbe-2 … on your clipboard. RGB and HSL values are listed in the table below.

Why do some harmonies look unbalanced?

HSL measures lightness purely mathematically. At the same L value, yellow and cyan look much brighter than blue or violet. Adjust the lightness of individual colors if needed, or start from a less saturated base color.

Sources and legal basis

As of:

Related tools