function
hsl() — CSS reference
HSL is a cylindrical representation of sRGB. Hue wraps around the circle; saturation controls distance from gray; lightness is not measured luminance or perceptual brightness. Full saturation at 50% lightness yields vivid colors. At zero saturation hue does not affect the resulting gray.
Formal Syntax & Structure
css syntaxcss
hsl(H S L [ / alpha ]); legacy: hsl(H, S, L [, alpha])Working Example
Example Snippetcss
<!doctype html><html lang="en"><meta charset="utf-8"><title>CSS color lab</title><style>body {margin:0} .sample {height:12px;background:#006050}p {padding:12px;background:white;color:black;border:2px solid currentColor} #a{color:hsl(480 100% 50%)} #b{color:hsl(0 0% 50%)}
</style><body><p id="a">First color sample</p><p id="b">Second color sample</p></body></html>