PerceptualColormap.from_hsl¶
- classmethod PerceptualColormap.from_hsl(*args, **kwargs)[source]¶
Make a
PerceptualColormap
by specifying the hue, saturation, and luminance transitions individually.- Parameters
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.name (
str
, default:'_no_name'
) – The colormap name. This can also be passed as the first positional string argument.ratios (sequence of
float
, optional) – Relative extents of each color transition. Must have lengthlen(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 luminance100
to50
taking twice as long as the transition from luminance50
to0
.h, s, l, a, c – Shorthands for
hue
,saturation
,luminance
,alpha
, andchroma
.hue (
float
orcolor-spec
or sequence, default:0
) – Hue channel value or sequence of values. The shorthand keywordh
is 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.
saturation (
float
orcolor-spec
or sequence, default:50
) – As withhue
, but for the saturation channel.luminance (
float
orcolor-spec
or sequence, default: :class:`(100`, :class:`20)`
) – As withhue
, but for the luminance channel.alpha (
float
orcolor-spec
or sequence, default:1
) – As withhue
, but for the alpha (opacity) channel.chroma – Alias for
saturation
.
- Other Parameters
**kwargs – Passed to
PerceptualColormap
.- Returns
PerceptualColormap
– The colormap.