Understanding Classic Color Wheel Harmonies
- • Color harmony theory establishes mathematical relationships across the standard 360° color wheel:
- • Complementary (180°): High-contrast pairs on opposite sides of the wheel; ideal for call-to-action buttons against calm backgrounds.
- • Analogous (±30°): Neighboring hues creating soothing, cohesive visual experiences common in nature.
- • Triadic (120°): Three equidistant hues providing vibrant balance while maintaining visual diversity.
- • Tetradic / Double-Complementary (90°): Four hues arranged into two complementary pairs, offering rich palette complexity.
- • Monochromatic: Variations in lightness and saturation along a single hue angle; the foundation of clean minimalist UI design.
// Calculating Color Harmonies in HSL Color Space
export function calculateHarmonies(h: number, s: number, l: number) {
const normalizeHue = (val: number) => (val % 360 + 360) % 360;
return {
base: { h, s, l },
complementary: { h: normalizeHue(h + 180), s, l },
analogous: [
{ h: normalizeHue(h - 30), s, l },
{ h: normalizeHue(h + 30), s, l },
],
triadic: [
{ h: normalizeHue(h + 120), s, l },
{ h: normalizeHue(h + 240), s, l },
],
splitComplementary: [
{ h: normalizeHue(h + 150), s, l },
{ h: normalizeHue(h + 210), s, l },
],
};
}