Spectrum Plot

specplot.specplot(hex_, rgb = True, hcl = True, palette = True, fix = True, **kwargs)[source]

Visualization of the RGB and HCL spectrum given a set of hex colors. As the hues for low-chroma colors are not (or poorly) identified, by default a smoothing is applied to the hues (fix = TRUE). Also, to avoid jumps from 0 to 360 or vice versa, the hue coordinates are shifted suitably.

No return, creates an interactive figure.

Parameters:
  • hex (list or numpy.ndarray) – hex color codes.
  • hcl (bool) – whether or not to plot the HCL color spectrum.
  • palette (bool) – whether or not to plot the colors as a color map.
  • fix (bool) – should the hues be fixed to be on a smooth(er) curve? Details in the method description.
  • rgb (bool) – whether or not to plot the RGB color spectrum. Default is False.
  • kwargs – Currently not used.

Example

>>> from colorspace import rainbow_hcl
>>> from colorspace import specplot
>>> pal = rainbow_hcl(100)
>>> specplot(pal.colors())
>>> specplot(pal.colors(), rgb = False, hcl = True, palette = False)

Todo

Implement the smoothings to improve the look of the plots. Only partially implemented, the spline smoother is missing.