seaborn.husl_palette#

seaborn.husl_palette(n_colors=6, h=0.01, s=0.9, l=0.65, as_cmap=False)#

Return hues with constant lightness and saturation in the HUSL system.

The hues are evenly sampled along a circular path. The resulting palette will be appropriate for categorical or cyclical data.

The h, l, and s values should be between 0 and 1.

This function is similar to hls_palette(), but it uses a nonlinear color space that is more perceptually uniform.

Parameters:
n_colorsint

Number of colors in the palette.

hfloat

The value of the first hue.

lfloat

The lightness value.

sfloat

The saturation intensity.

as_cmapbool

If True, return a matplotlib colormap object.

Returns:
palette

list of RGB tuples or matplotlib.colors.ListedColormap

See also

hls_palette

Make a palette using evenly spaced hues in the HSL system.

Examples

By default, return 6 colors with identical lightness and saturation and evenly-sampled hues:

sns.husl_palette()

Increase the number of colors:

sns.husl_palette(8)

Decrease the lightness:

sns.husl_palette(l=.4)

Decrease the saturation:

sns.husl_palette(s=.4)

Change the start-point for hue sampling:

sns.husl_palette(h=.5)

Return a continuous colormap:

sns.husl_palette(as_cmap=True)
hsl color map