ColorMap.from_palette

classmethod ColorMap.from_palette(name)[source]

Construct a color map from a named palette.

Parameters:
namestr

The name of the palette.

Returns:
compas.colors.ColorMap

A color map with 256 colors.

Raises:
FileNotFoundError

If the file containing the colors of the palette doesn’t exist.

Notes

The colormaps use the colors of the palettes available here https://www.fabiocrameri.ch/colourmaps/ and the python package https://pypi.org/project/cmcrameri/. See compas/colors/cmcrameri/LICENSE for more info.