Color Palette Generator
Generate complementary, analogous, triadic and tetradic color palettes from any base color
Base color
Color scheme
Generated palette
What Is a Color Palette?
A color palette is a fixed set of colors chosen to work together in a design. When you pick a single base color for a brand, website, or illustration, you need companion colors that sit well beside it. Color palette generation automates that choice by applying rules from color theory, specifically the geometric relationships on the standard HSL color wheel.
The HSL (Hue, Saturation, Lightness) color wheel arranges hues in a 360-degree circle. Red sits at 0 degrees, green at 120 degrees, and blue at 240 degrees. Every color harmony scheme works by selecting hues at specific angular distances from the base color. A complementary pair, for example, uses two colors 180 degrees apart. An analogous set picks colors within 30 degrees on either side. These geometric rules produce balanced combinations because the selected hues spread around the wheel rather than clustering in one region.
This tool takes any hex color as input, converts it to HSL, rotates the hue by the angles defined by the selected scheme, and converts the results back to hex. It supports six schemes: complementary, analogous, triadic, split-complementary, tetradic, and monochromatic. Each scheme produces a different number of output colors, from 2 to 5.
Why Use This Color Palette Generator?
Picking colors that work together by trial and error is slow and inconsistent. A palette generator applies color theory rules instantly, giving you mathematically balanced results from any starting point.
Color Palette Generator Use Cases
Color Harmony Schemes Comparison
Every harmony scheme picks colors based on hue rotation angles from the base color on the HSL wheel. The table below lists each scheme, the number of colors it produces, the rotation angles, and the design context where it works best.
| Scheme | Colors | Hue angles | Best for |
|---|---|---|---|
| Complementary | 2 | 180 | High contrast, call-to-action buttons |
| Analogous | 3 | -30, 0, +30 | Harmonious, low-tension backgrounds |
| Triadic | 3 | 0, 120, 240 | Balanced variety, dashboards |
| Split-Complementary | 3 | 0, 150, 210 | Softer contrast than complementary |
| Tetradic (Rectangle) | 4 | 0, 90, 180, 270 | Rich palettes, complex UIs |
| Monochromatic | 5 | Same hue, varied lightness | Subtle, single-brand pages |
How HSL Color Wheel Rotation Works
All palette generation in this tool relies on the HSL color model. Understanding its three axes helps you predict how a base color will transform under each scheme.
Code Examples
Generate color palettes programmatically using HSL conversion and hue rotation.
// Generate a complementary color by rotating hue 180 degrees
function hexToHsl(hex) {
let r = parseInt(hex.slice(1,3), 16) / 255;
let g = parseInt(hex.slice(3,5), 16) / 255;
let b = parseInt(hex.slice(5,7), 16) / 255;
const max = Math.max(r,g,b), min = Math.min(r,g,b);
let h = 0, s = 0, l = (max + min) / 2;
if (max !== min) {
const d = max - min;
s = l > 0.5 ? d / (2 - max - min) : d / (max + min);
if (max === r) h = ((g - b) / d + (g < b ? 6 : 0)) / 6;
else if (max === g) h = ((b - r) / d + 2) / 6;
else h = ((r - g) / d + 4) / 6;
}
return [Math.round(h * 360), Math.round(s * 100), Math.round(l * 100)];
}
function hslToHex(h, s, l) {
s /= 100; l /= 100;
const a = s * Math.min(l, 1 - l);
const f = n => {
const k = (n + h / 30) % 12;
return Math.round(255 * (l - a * Math.max(-1, Math.min(k - 3, 9 - k, 1))));
};
return '#' + [f(0), f(8), f(4)].map(v => v.toString(16).padStart(2, '0')).join('');
}
const base = '#6366f1';
const [h, s, l] = hexToHsl(base);
const comp = hslToHex((h + 180) % 360, s, l);
console.log(comp); // β "#f1ee63"import colorsys
def hex_to_hsl(hex_color: str):
r, g, b = (int(hex_color[i:i+2], 16) / 255 for i in (1, 3, 5))
h, l, s = colorsys.rgb_to_hls(r, g, b)
return round(h * 360), round(s * 100), round(l * 100)
def hsl_to_hex(h: int, s: int, l: int) -> str:
r, g, b = colorsys.hls_to_rgb(h / 360, l / 100, s / 100)
return '#{:02x}{:02x}{:02x}'.format(round(r * 255), round(g * 255), round(b * 255))
def complementary(hex_color: str) -> str:
h, s, l = hex_to_hsl(hex_color)
return hsl_to_hex((h + 180) % 360, s, l)
def triadic(hex_color: str) -> list[str]:
h, s, l = hex_to_hsl(hex_color)
return [hex_color, hsl_to_hex((h + 120) % 360, s, l), hsl_to_hex((h + 240) % 360, s, l)]
print(complementary('#6366f1')) # β #f1ee63
print(triadic('#6366f1')) # β ['#6366f1', '#66f163', '#f16366']package main
import (
"fmt"
"math"
)
func hexToHSL(hex string) (float64, float64, float64) {
var r, g, b uint8
fmt.Sscanf(hex, "#%02x%02x%02x", &r, &g, &b)
rf, gf, bf := float64(r)/255, float64(g)/255, float64(b)/255
max := math.Max(rf, math.Max(gf, bf))
min := math.Min(rf, math.Min(gf, bf))
l := (max + min) / 2
if max == min {
return 0, 0, l * 100
}
d := max - min
s := d / (2 - max - min)
if l <= 0.5 {
s = d / (max + min)
}
var h float64
switch max {
case rf:
h = (gf - bf) / d
if gf < bf { h += 6 }
case gf:
h = (bf-rf)/d + 2
case bf:
h = (rf-gf)/d + 4
}
return h * 60, s * 100, l * 100
}
func hslToHex(h, s, l float64) string {
s /= 100; l /= 100
a := s * math.Min(l, 1-l)
f := func(n float64) uint8 {
k := math.Mod(n+h/30, 12)
return uint8(255 * (l - a*math.Max(-1, math.Min(math.Min(k-3, 9-k), 1))))
}
return fmt.Sprintf("#%02x%02x%02x", f(0), f(8), f(4))
}
func main() {
h, s, l := hexToHSL("#6366f1")
comp := hslToHex(math.Mod(h+180, 360), s, l)
fmt.Println(comp) // β #f1ee63
}