Create polarLUV (HCL) Color Object

Description

Creates a color object in the polar representation of the CIELUV color space, also known as the Hue-Chroma-Luminance (HCL) color space. Can be converted to: CIEXYZ, CIELUV, CIELAB, RGB, sRGB, polarLAB, and hexcols. Not allowed (ambiguous) are transformations to HSV and HLS.

Usage

HCL(H, C, L, alpha=None)

Arguments

Hint, float, list, numpy.array
Numeric value(s) for hue dimension ([-360., 360.]).
Cint, float, list, numpy.array
Numeric value(s) for chroma dimension ([0., 100.+]).
Lint, float, list, numpy.array
Numeric value(s) for luminance dimension ([0., 100.]).
alphaNone, float, list, numpy.array
Numeric value(s) for the alpha channel ([0., 1.]) where 0. equals full transparency, 1. full opacity. If None (default) no transparency is added.

Methods

HCL.colors(fixup=True, rev=False)
Extract Hex Colors
HCL.dropalpha()
Remove Alpha Channel
HCL.get(dimname=None)
Extracting Color Coordinates
HCL.get_whitepoint()
Get White Point
HCL.hasalpha()
Check for Alpha Channel
HCL.hclplot(**kwargs)
Palette Plot in HCL Space
HCL.length()
Get Number of Colors
HCL.set(**kwargs)
Set Coordinates/Manipulate Colors
HCL.set_whitepoint(**kwargs)
Set White Point
HCL.specplot(**kwargs)
Color Spectrum Plot
HCL.swatchplot(**kwargs)
Palette Swatch Plot
HCL.to(to, fixup=True)
Transform Color Space

Examples

from colorspace import polarLUV, HCL
# Constructing color object with one single color via float
polarLUV(100., 30, 50.)
polarLUV color object (1 colors)
            H       C       L
  1:   100.00   30.00   50.00
# polarLUV is the HCL color space, this
#  is equivalent to the command above.
HCL(100., 30, 50.)
polarLUV color object (1 colors)
            H       C       L
  1:   100.00   30.00   50.00
# Constructing object via lists
HCL([100, 80], [30, 50], [30, 80])
polarLUV color object (2 colors)
            H       C       L
  1:   100.00   30.00   30.00
        80.00   50.00   80.00
# Constructing object via numpy arrays
from numpy import asarray
HCL(asarray([100, 80]), asarray([30, 50]), asarray([30, 80]))
polarLUV color object (2 colors)
            H       C       L
  1:   100.00   30.00   30.00
        80.00   50.00   80.00