adjustHsl()
The adjustHsl
function allows you to adjust the HSL (Hue, Saturation, Lightness) values of a color object.
This function returns a new Spectrum
instance with the updated HSL values.
Usage
Parameters
adjustHsl(colorObj, options)
Parameter | Type | Required | Valid range | Description |
---|---|---|---|---|
colorObj | Spectrum instance | true | - | The Spectrum instance representing the color you want to adjust |
options.hue | number | false | [-360; 360] | The amount by which to adjust the hue value |
options.saturation | string | false | ['-100%'; '100%'] | The amount by which to adjust the saturation value. Should be provided as a percentage string. |
options.lightness | string | false | ['-100%'; '100%'] | The amount by which to adjust the lightness value. Should be provided as a percentage string. |
options.alpha | number | false | [-1; 1] | The amount by which to adjust the alpha value |
Return Value
The adjustHsl
function returns a new Spectrum
instance with the adjusted HSL values.