Function __global->rgb_to_hsl

Definitions

sources/themes.php

  • Converts an RGB color value to HSL. Conversion formula adapted from http://en.wikipedia.org/wiki/HSL_color_space.Inspired by https://stackoverflow.com/a/9493060/362006 .Assumes r, g, and b are contained in the set [0, 255] and returns h, s, and l in the set [0, 1].
  • Is abstract?: No
  • Is static?: No
  • Is final?: No
  • Return: array

Parameters

Name Type Default Set Range Description
$red integer required parameter N/A N/A Red colour (0-255)
$green integer required parameter N/A N/A Green colour (0-255)
$blue integer required parameter N/A N/A Blue colour (0-255)

Return

  • Triplet of components: H, S, L (0.0-1.0)
  • Type: array
  • Set: N/A
  • Range: N/A