PerceptuallyUniformColormap.from_hsl¶
- classmethod PerceptuallyUniformColormap.from_hsl(name, *, ratios=None, **kwargs)[source]¶
Make a
PerceptuallyUniformColormapby specifying the hue, saturation, and luminance transitions individually.- Parameters
name (str) – The colormap name.
h, s, l, a, c – Shorthands for
hue,saturation,luminance,alpha, andchroma.hue (float, color-spec, or list thereof, optional) – Hue channel value or list of values. The shorthand keyword
his also acceptable. Values can be any of the following.Numbers, within the range 0 to 360 for hue and 0 to 100 for saturation and luminance.
Color string names or hex strings, in which case the channel value for that color is looked up.
If scalar, the hue does not change across the colormap. Default is
0(i.e., red).saturation, luminance, alpha (float, color-spec, or list thereof, optional) – As with
hue, but for the saturation, luminance, and alpha (opacity) channels, respectively. The defaultsaturationis50, luminance is(100, 20), and alpha is1(i.e., no transparency).chroma – Alias for
saturation.ratios (list of float, optional) – Relative extents of each color transition. Must have length
len(colors) - 1. Larger numbers indicate a slower transition, smaller numbers indicate a faster transition.For example,
luminance=(100, 50, 0)withratios=(2, 1)results in a colormap with the transition from luminance100to50taking twice as long as the transition from luminance50to0.space ({‘hsl’, ‘hpl’, ‘hcl’}, optional) – The colorspace in which hue, luminance, and/or saturation are varied.
- Other Parameters
**kwargs – Passed to
PerceptuallyUniformColormap.- Returns
PerceptuallyUniformColormap– The colormap.