Create CIEXYZ Color Object

Description

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

Usage

CIEXYZ(X, Y, Z, alpha=None)

Arguments

Xint, float, list, numpy.array
Numeric value(s) for X dimension.
Yint, float, list, numpy.array
Numeric value(s) for Y dimension.
Zint, float, list, numpy.array
Numeric value(s) for Z 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

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

Examples

from colorspace import CIEXYZ
# Constructing color object with one single color via float
CIEXYZ(80, 30, 10)
CIEXYZ color object (1 colors)
            X       Y       Z
  1:    80.00   30.00   10.00
# Constructing object via lists
CIEXYZ([10, 0], [20, 80], [40, 40])
CIEXYZ color object (2 colors)
            X       Y       Z
  1:    10.00   20.00   40.00
         0.00   80.00   40.00
# Constructing object via numpy arrays
from numpy import asarray
CIEXYZ(asarray([10, 0]), asarray([20, 80]), asarray([40, 40]))
CIEXYZ color object (2 colors)
            X       Y       Z
  1:    10.00   20.00   40.00
         0.00   80.00   40.00