Color.HSVtoRGB()

<static> HSVtoRGB(h, s, v, out) → {object}

Converts an HSV (hue, saturation and value) color value to RGB.
Conversion forumla from http://en.wikipedia.org/wiki/HSL_color_space.
Assumes HSV 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.

v number

The value, 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 327)
doc_phaser
2017-02-14 10:42:06
Comments
Leave a Comment

Please login to continue.