hsl(hue, saturation, lightness)
Create color value from HSL components
@function hsl($hue, $saturation, $lightness, $alpha: 1.0)
Parameters
- hue
Hue color component. Can be defined as plain number (treated the same as degrees) or as a number with an angle measurement (deg
,rad
,grad
,turn
). - saturation
Saturation color component. Can either be a0.0
to1.0
value, or a0%
to100%
value. - lightness
Lightness color component. Can either be a0.0
to1.0
value, or a0%
to100%
value. - alpha (Optional)
Alpha color component. This parameter is optional, if it’s omitted, a value of1.0
is used.
This parameter only accepts plain numbers in range0.0
to1.0
.
Returns
A color value made of of the specified hue, saturation, lightness and alpha values.
Notes
- The
hsla
function is an alias forhsl
. As such, they are identical functions. - The
hsl(H S L[ / A])
syntax is not supported. - The relative RGB color syntax (
hsl(from <color> H S L[ / A])
) is not supported.