Skip to main content
Version: 1.x

@microsoft/fast-colors > ColorXYZ

ColorXYZ class

XYZ color space

This implementation uses the D65 constants for 2 degrees. That determines the constants used for the pure white point of the XYZ space of 0.95047, 1.0, 1.08883. https://en.wikipedia.org/wiki/Illuminant_D65 These constants determine how the XYZ, LCH and LAB colors convert to/from RGB.

Signature:
export declare class ColorXYZ 

Constructors

ConstructorModifiersDescription
(constructor)(x, y, z)Constructs a new instance of the ColorXYZ class

Properties

PropertyModifiersTypeDescription
whitePointstaticColorXYZD65 2 degree white point
xnumber
ynumber
znumber

Methods

MethodModifiersDescription
equalValue(rhs)Determines if a color is equal to another
fromObject(data)staticConstruct a ColorXYZ from a config object.
roundToPrecision(precision)Returns a new ColorXYZ rounded to the provided precision
toObject()Returns the ColorXYZ formatted as an object.