seaborn.hls_palette#

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

Return hues with constant lightness and saturation in the HLS 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.

Note

While the separation of the resulting colors will be mathematically constant, the HLS system does not construct a perceptually-uniform space, so their apparent intensity will vary.

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

husl_palette

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

Examples

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

sns.hls_palette()

Increase the number of colors:

sns.hls_palette(8)

Decrease the lightness:

sns.hls_palette(l=.3)

Decrease the saturation:

sns.hls_palette(s=.3)

Change the start-point for hue sampling:

sns.hls_palette(h=.5)

Return a continuous colormap. Notice the perceptual discontinuities, especially around yellow, cyan, and magenta:

sns.hls_palette(as_cmap=True)
hls color map