aryagraph.style.colors.Colormap#

class aryagraph.style.colors.Colormap(name: str, stops: tuple[str, ...])[source]#

Bases: object

A continuous color scale over [0, 1], interpolated in OKLab between stops.

>>> cmap = Colormap("heat", ["#fff5eb", "#d94801"])
>>> cmap(0.5)
sample(n: int) → list[str][source]#

n evenly spaced colors from the start to the end of the map.

truncated(lo: float = 0.0, hi: float = 1.0, n: int = 9) → Colormap[source]#

The sub-range [lo, hi] of this map, re-sampled with n stops.