HCL Based Heat Color Palette

Description

heat_hcl is an implementation of the base R ‘heat.colors’ palette but constructed in HCL space based on a call to sequential_hcl.

See also: qualitative_hcl, sequential_hcl, diverging_hcl, divergingx_hcl, rainbow_hcl, terrain_hcl, diverging_hsv, and rainbow.

Usage

heat_hcl(h=[0, 90], c=[100, 30], l=[50, 90],
power=[0.2, 1.0], fixup=True, rev=False,
*args, **kwargs)

Arguments

hlist of int
Hue parameters (h1/h2).
clist of int
Chroma parameters (c1/c2).
lint
Luminance parameters (l1/l2).
powerlist of float
Power parameters (p1/p2).
fixupbool
Only used when converting the HCL colors to hex. Should RGB values outside the defined RGB color space be corrected?
revbool
Should the color map be reversed.
*args
Currently unused.
**kwargs
Additional arguments to overwrite the h/c/l settings. Allowed: h1, h2, c1, c2, l1, l2, p1, p2.

Return

Initialize new object, no return. Raises a set of errors if the parameters are misspecified. Note that the object is callable, the default object call can be used to return hex colors (identical to the .colors() method), see examples.

Methods

heat_hcl.cmap(n=256, name='custom_hcl_cmap')
Create Matplotlib Compatible Color Map
heat_hcl.colors(n=11, fixup=None, alpha=None, **kwargs)
Get Colors
heat_hcl.get(key)
Get Specific Palette Setting
heat_hcl.hclplot(n=7, **kwargs)
Palette Plot in HCL Space
heat_hcl.name()
Get Palette Name
heat_hcl.show_settings()
Show Palette Settings
heat_hcl.specplot(n=180, *args, **kwargs)
Color Spectrum Plot
heat_hcl.swatchplot(n=7, **kwargs)
Palette Swatch Plot

Examples

from colorspace.palettes import heat_hcl
pal = heat_hcl()
pal.colors(3)
['#D33F6A', '#E99A2C', '#E2E6BD']
pal.swatchplot(show_names = False, figsize = (5.5, 0.5));

# The standard call of the object also returns hex colors
heat_hcl()(10)
['#D33F6A',
 '#DA565E',
 '#E06B50',
 '#E57E41',
 '#E89132',
 '#EAA428',
 '#E9B62D',
 '#E8C842',
 '#E5D961',
 '#E2E6BD']