Skip to content

palette

palette #

The colours every guidance figure shares, so one reading carries across charts.

CAPTURE = '#085c56' module-attribute #

One capture.

COVERED = '#128a80' module-attribute #

What the captures so far already cover.

INK = '#212529' module-attribute #

Marks and their labels.

NEEDED = '#ec6812' module-attribute #

What still needs capturing.

SATISFIED = '#a0a6ac' module-attribute #

What is coming but already covered.

need_colors(need) #

Each 0–1 need as an RGBA row from SATISFIED (0) to NEEDED (1).

Source code in capturegraph-recipes/capturegraph_recipes/scheduling/guidance/palette.py
def need_colors(need: np.ndarray) -> np.ndarray:
    """Each 0–1 ``need`` as an RGBA row from ``SATISFIED`` (0) to ``NEEDED`` (1)."""
    from matplotlib.colors import to_rgba

    low, high = np.array(to_rgba(SATISFIED)), np.array(to_rgba(NEEDED))
    weight = np.clip(np.asarray(need, dtype=np.float64), 0.0, 1.0)[..., None]
    return low + (high - low) * weight