CSS hsl() Function (original) (raw)
Last Updated : 30 Aug, 2024
The **hsl() function is an inbuilt function in CSS that is used to define the colors using the Hue-saturation-lightness model (HSL).
**Syntax:
hsl( hue, saturation, lightness )
**Parameters: This function accepts three parameters as mentioned above and described below:
- **hue: This parameter is used to define the degree on the color wheel. Its value lies between 0 to 360 where 0 or 360 represents red, 120 represents green and 240 represents blue.
- **saturation: This parameter is used to define saturation where 0% represents a shade of gray and 100% represents a full color.
- **lightness: This parameter is used to define lightness where 0% represents black, 50% represents normal, and 100% represents white.
**Example: The below program illustrates the hsl() function in CSS:
html `
hsl() function