Skip to main content
Version: 1.x

@microsoft/fast-colors > ColorHSL

ColorHSL class

This uses Hue values in "degree" format. So expect a range of [0,360]. Some other implementations instead uses radians or a normalized Hue with range [0,1]. Be aware of this when checking values or using other libraries.

Signature:
export declare class ColorHSL 

Constructors

ConstructorModifiersDescription
(constructor)(hue, sat, lum)Constructs a new instance of the ColorHSL class

Properties

PropertyModifiersTypeDescription
hnumber
lnumber
snumber

Methods

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