Color.HSLtoRGB()

<static> HSLtoRGB(h, s, l, out) → {object}

Converts an HSL (hue, saturation and lightness) color value to RGB.
Conversion forumla from http://en.wikipedia.org/wiki/HSL_color_space.
Assumes HSL values are contained in the set [0, 1] and returns r, g and b values in the set [0, 255].
Based on code by Michael Jackson (https://github.com/mjijackson)

Parameters
Name Type Argument Description
h number

The hue, in the range 0 - 1.

s number

The saturation, in the range 0 - 1.

l number

The lightness, in the range 0 - 1.

out object <optional>

An object into which 3 properties will be created: r, g and b. If not provided a new object will be created.

Returns
object -

An object with the red, green and blue values set in the r, g and b properties.

Source code: utils/Color.js (Line 220)
doc_phaser
2017-02-14 10:42:05
Comments
Leave a Comment

Please login to continue.