Creates a new HSL color.
The hue component, in the range [0, 360].
The saturation component, in the range [0, 100].
The lightness component, in the range [0, 100].
The alpha (opacity) component, in the range [0, 1]. Defaults to 1.
Returns the HSL color as an array of numbers.
An array containing the hue, saturation, lightness, and alpha components.
Converts the color to a hexadecimal string.
The hexadecimal representation of the color.
Returns the HSL color as a CSS-compatible string.
A string representing the HSL color in CSS format.
Adjusts the brightness of the color.
The brightness adjustment value.
A new RGB color with adjusted brightness.
Creates a copy of the current HSL color.
A new HSL color with the same components as the current color.
Adjusts the contrast of the color.
The contrast adjustment value.
A new RGB color with adjusted contrast.
Darkens the color by a given value.
The amount to darken the color.
A new RGB color that is darkened.
Decreases the alpha (opacity) of the HSL color by a given value.
The value by which to decrease the alpha.
A new HSL color with decreased alpha.
Applies gamma correction to the color.
The gamma correction value.
A new RGB color with gamma correction applied.
Inverts the lightness component of the HSL color.
A new HSL color with the lightness component inverted.
Lightens the color by a given value.
The amount to lighten the color.
A new RGB color that is lightened.
Rotates the hue component of the HSL color by a given offset.
The amount to rotate the hue by, in degrees.
A new HSL color with the hue rotated by the given offset.
Returns a new HSL color with rounded components.
A new HSL color with rounded hue, saturation, lightness, and alpha components.
Increases the saturation of the HSL color by a given ratio.
The ratio by which to increase the saturation.
A new HSL color with increased saturation.
Sets the hue of the color.
The new hue value.
A new HSV color with the hue set.
Static
parseReadonly
aThe alpha (opacity) component of the color, in the range [0, 1].
Readonly
hThe hue component of the color, in the range [0, 360].
Readonly
lThe lightness component of the color, in the range [0, 100].
Readonly
sThe saturation component of the color, in the range [0, 100].
Static
HSLThe HSL color model.
Static
HSVThe HSV color model.
Static
RGBThe RGB color model.
Represents a color in the HSL (Hue, Saturation, Lightness) color space. Extends the base
Color
class.