Create CIELAB Color Object

Description

Creates a color object in 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

CIELAB(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

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

Examples

from colorspace import CIELAB
# Constructing color object with one single color via float
CIELAB(-30, 10, 10)
CIELAB color object (1 colors)
            L       A       B
  1:   -30.00   10.00   10.00
# Constructing object via lists
CIELAB([-30, 30], [20, 80], [40, 40])
CIELAB color object (2 colors)
            L       A       B
  1:   -30.00   20.00   40.00
        30.00   80.00   40.00
# Constructing object via numpy arrays
from numpy import asarray
CIELAB(asarray([-30, 30]), asarray([20, 80]), asarray([40, 40]))
CIELAB color object (2 colors)
            L       A       B
  1:   -30.00   20.00   40.00
        30.00   80.00   40.00