Skip to content

Polychromos

πολύχρωμος

Greek; adjective

From πολύ- ("many", "much") and -χρωμος (from χρῶμα, "color").

Multicolored.

Color and palette utility library.

Polychromos provides utilities for working with colors and palettes from an artistic perspective, using color theory and the human-friendly HSL (hue-saturation-lightness) color model.

Modules

The library provides three modules:

  • color — the HSLColor class, encapsulating a single color in HSLA format.
    • web — a submodule containing the standard web colors.
  • paletteHSLColorSequence (an alias for list[HSLColor]) and the Palette class with utilities to generate and manipulate sets of colors.
  • easing — easing functions and their IDs, used when building color scales.

Imports

The main classes can be imported directly from the package root:

from polychromos import HSLColor, Palette

Or from their respective modules:

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