PerceptualColormap.from_color

classmethod PerceptualColormap.from_color(*args, **kwargs)[source]

Return a simple monochromatic “sequential” colormap that blends from white or near-white to the input color.

Parameters
  • color (color-spec) – RGB tuple, hex string, or named color string.

  • name (str, optional) – The colormap name. This can also be passed as the first positional string argument. Default is '_no_name'.

  • space ({'hsl', 'hpl', 'hcl', 'hsv'}, optional) – The hue, saturation, luminance-style colorspace to use for interpreting the channels. See this page for a full description. Default is 'hsl'.

  • l, s, a, c – Shorthands for luminance, saturation, alpha, and chroma.

  • luminance (float or color-spec, optional) – If float, this is the luminance channel strength on the left-hand side of the colormap (default is 100). If RGB[A] tuple, hex string, or named color string, the luminance is inferred from the color.

  • saturation, alpha (float or color-spec, optional) – As with luminance, except the default saturation and the default alpha are the channel values taken from color.

  • chroma – Alias for saturation.

Other Parameters

**kwargs – Passed to PerceptualColormap.from_hsl.

Returns

PerceptualColormap – The colormap.