diplomat.utils.colormaps.to_colormap

diplomat.utils.colormaps.to_colormap(cmap: None | str | list | Colormap | DiplomatColormap = None) DiplomatColormap[source]

Convert any colormap like object to a DiplomatColormap.

Parameters:

cmap – The colormap-like object, can be a list of colors, the name of a matplotlib colormap, a matplotlib colormap, a DiplomatColormap, or None. None indicates that the default matplotlib colormap should be converted to a DiplomatColormap and returned.

Returns:

A DiplomatColormap object.