The hsla() function is an inbuilt function in CSS which is used to define the colors using the Hue Saturation Lightness Alpha (HSLA) model.
hsla( hue, saturation, lightness, alpha )
Parameters: This function accepts four 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 the saturation where 0% represents shade of gray and 100% represents full color.
- lightness: This parameter is used to define the lightness where 0% represents black, 50% represents normal, and 100% represents white.
- alpha: This parameter is used to defines the opacity and the value lies between 0.0 (fully transparent) and 1.0 (fully opaque).
Below program illustrates the hsla() function in CSS:
Supported Browsers: The browser supported by hsla() function are listed below:
- Chrome 1.0 and above
- Internet Explorer 9.0 and above
- Firefox 3.0 and above
- Safari 3.1 and above
- Opera 10.0 and above
- PHP | pow( ) Function
- PHP | pi( ) Function
- p5.js | hex() function
- p5.js | box() Function
- p5.js | arc() Function
- PHP | key() Function
- p5.js | log() function
- D3.js | d3.map.set() Function
- PHP | Ds\Set add() Function
- D3.js | d3.max() function
- p5.js | tan() function
- PHP | min( ) Function
- PHP | Ds\Set contains() Function
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to firstname.lastname@example.org. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.