Skip to main content
Version: 1.x

@microsoft/fast-colors > ColorLAB

ColorLAB class

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

Constructors

ConstructorModifiersDescription
(constructor)(l, a, b)Constructs a new instance of the ColorLAB class

Properties

PropertyModifiersTypeDescription
anumber
bnumber
epsilonstaticnumber
kappastaticnumber
lnumber

Methods

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