Skip to content

Color Harmony

Color harmony schemes provide a framework for deriving colors that are chromatically related and aesthetically balanced. All schemes operate on the hue component of the color wheel.

Polychromos implements three harmony schemes:

Scheme Description
Complementary One color shifted 180° (opposite on the wheel)
Triadic Two colors that form an equilateral triangle with the reference (±120°)
Split complementary Two colors halfway between the complementary and triadic positions (±150°)

All methods accept optional mute_saturation and mute_lightness deltas for convenience when building full color schemes.

Complementary

from polychromos.color import HSLColor
from polychromos.palette import Palette

ref = HSLColor(0.25, 1.0, 0.5)  # hsl(90deg 100% 50%)

comp = Palette.complementary(ref)
comp = Palette.complementary(ref, mute_saturation=0.3)   # 30% less saturated
comp = Palette.complementary(ref, mute_lightness=0.2)    # 20% darker
comp = Palette.complementary(ref, mute_lightness=-0.15)  # 15% brighter

Triadic

t1, t2 = Palette.triadic(ref)
t1, t2 = Palette.triadic(ref, mute_saturation=0.3)
t1, t2 = Palette.triadic(ref, mute_lightness=0.2)
t1, t2 = Palette.triadic(ref, mute_lightness=-0.15)

Split complementary

s1, s2 = Palette.split_complementary(ref)
s1, s2 = Palette.split_complementary(ref, mute_saturation=0.3)
s1, s2 = Palette.split_complementary(ref, mute_lightness=0.2)
s1, s2 = Palette.split_complementary(ref, mute_lightness=-0.15)

Notes

  • Tetradic and rectangular schemes are not implemented.
  • The analogous scheme is not implemented as a dedicated method, but can be approximated using sequence_from_deltas with small hue shifts and zero lightness/saturation deltas.