@tempots/color
HSL class
Represents a color in the HSL (Hue, Saturation, Lightness) color model.
Signature:
declare class HSL
Constructors
Constructor |
Modifiers |
Description |
---|---|---|
Constructs a new instance of the |
Properties
Property |
Modifiers |
Type |
Description |
---|---|---|---|
|
(other: HSL, tollerance?: number) => boolean |
Checks if the current HSL color is equal to another HSL color. | |
|
(s: string) => HSL |
Creates an HSL color object from a string representation. The string should be in the format "hsl(h, s%, l%)". | |
|
number |
The hue value of the HSL color. | |
|
number |
Represents the lightness value in the HSL color model. | |
|
([hue, saturation, lightness]: [hue: number, saturation: number, lightness: number]) => HSL |
Creates an HSL color instance from individual channel values. | |
|
number |
The saturation value of an HSL color. | |
|
() => [number, number, number] |
Converts the HSL color values to an array of channels. | |
|
() => string |
Returns a string representation of the HSL color in the format "hsl(hue, saturation%, lightness%)". | |
|
(hue: number) => HSL |
Returns a new HSL color with the specified hue. | |
|
(lightness: number) => HSL |
Returns a new HSL color with the specified lightness. | |
|
(saturation: number) => HSL |
Returns a new HSL color with the specified saturation. |