Create Polar LAB Color Object

Description

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

Usage

polarLAB(L, A, B, alpha=None)

Arguments

Lint, float, list, numpy.array
Numeric value(s) for L dimension.
Aint, float, list, numpy.array
Numeric value(s) for A dimension.
Bint, float, list, numpy.array
Numeric value(s) for B dimension.
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

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

Examples

from colorspace import polarLAB
cols = polarLAB([50, 80, 30], [100, 120, 140], [40, 130, 300])
cols
polarLAB color object (3 colors)
            L       A       B
  1:    50.00  100.00   40.00
        80.00  120.00  130.00
        30.00  140.00  300.00
# Convert to hex colors
cols.to("hex")
cols
  • #F00000
  • #3AE500
  • #0027FF