ColorMap.from_mpl

classmethod ColorMap.from_mpl(name)

Construct a color map from matplotlib.

Parameters

name (Literal[‘magma’, ‘inferno’, ‘plasma’, ‘viridis’]) – The name of the mpl colormap.

Returns

compas.colors.ColorMap

Raises

KeyError – If the color is not available.

Notes

The palettes available through this function are from https://github.com/BIDS/colormap, but with the dependency on matplotlib removed to ensure compatibility with RhinoGH. See compas/colors/mpl_colormap.py for more info and license information.