Function __global->hsl_to_rgb
Definitions
sources/themes.php
- Converts an HSL color value to RGB. Conversion formula adapted from http://en.wikipedia.org/wiki/HSL_color_space.Inspired by https://stackoverflow.com/a/9493060/362006 .Assumes h, s, and l are contained in the set [0, 1] and returns r, g, and b in the set [0, 255].
- Visibility: public
- Is abstract?: No
- Is static?: No
- Is final?: No
- Returns: array
Parameters
| Name | Type | Passed by reference? | Variadic? | Default | Set | Range | Description |
|---|---|---|---|---|---|---|---|
| $hue | float | No | No | required parameter | N/A | N/A | Hue (0.0-1.0) |
| $sat | float | No | No | required parameter | N/A | N/A | Saturation (0.0-1.0) |
| $lht | float | No | No | required parameter | N/A | N/A | Lightness (0.0-1.0) |
Returns
- Triplet of components: R, G, B (0-255)
- Type: array
- Set: N/A
- Range: N/A
Preview
Code (PHP)
/**
* Converts an HSL color value to RGB. Conversion formula adapted from http://en.wikipedia.org/wiki/HSL_color_space.Inspired by https://stackoverflow.com/a/9493060/362006 .Assumes h, s, and l are contained in the set [0, 1] and returns r, g, and b in the set [0, 255].
*
* @param float $hue Hue (0.0-1.0)
* @param float $sat Saturation (0.0-1.0)
* @param float $lht Lightness (0.0-1.0)
* @return array Triplet of components: R, G, B (0-255)
*/
function hsl_to_rgb(float $hue, float $sat, float $lht) : array
* Converts an HSL color value to RGB. Conversion formula adapted from http://en.wikipedia.org/wiki/HSL_color_space.Inspired by https://stackoverflow.com/a/9493060/362006 .Assumes h, s, and l are contained in the set [0, 1] and returns r, g, and b in the set [0, 255].
*
* @param float $hue Hue (0.0-1.0)
* @param float $sat Saturation (0.0-1.0)
* @param float $lht Lightness (0.0-1.0)
* @return array Triplet of components: R, G, B (0-255)
*/
function hsl_to_rgb(float $hue, float $sat, float $lht) : array

