pyboxbuilder.preview.stable_color

pyboxbuilder.preview.stable_color(label: str) → Color[source]

Assign a distinct, stable preview colour to a box label.

The same label always produces the same colour, across runs and processes, so a preview does not reshuffle its palette between renders.

Parameters:
label: str

The box label to derive a colour from.

Returns:

A saturated pybosl2.Color whose hue is derived from the label.