@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
| Constructor | Modifiers | Description |
|---|---|---|
| (constructor)(hue, sat, lum) | Constructs a new instance of the ColorHSL class |
Properties
| Property | Modifiers | Type | Description |
|---|---|---|---|
| h | number | ||
| l | number | ||
| s | number |
Methods
| Method | Modifiers | Description |
|---|---|---|
| equalValue(rhs) | Determines if a color is equal to another | |
| fromObject(data) | static | Construct 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. |