Color.HSVColorWheel()

<static> HSVColorWheel(s, v) → {array} Get HSV color wheel values in an array which will be 360 elements in size. Parameters Name Type Argument Default Description s number <optional> 1 The saturation, in the range 0 - 1. v number <optional> 1 The value, in the range 0 - 1. Returns array - An array containing 360 elements corresponding to the HSV color wheel. Source code: utils/Color.js (Line 710)

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

Color.HSLColorWheel()

<static> HSLColorWheel(s, l) → {array} Get HSL color wheel values in an array which will be 360 elements in size. Parameters Name Type Argument Default Description s number <optional> 0.5 The saturation, in the range 0 - 1. l number <optional> 0.5 The lightness, in the range 0 - 1. Returns array - An array containing 360 elements corresponding to the HSL color wheel. Source code: utils/Color.js (Line 735)

Color.hexToRGB()

<static> hexToRGB(hex) → {number} Converts a hex string into an integer color value. Parameters Name Type Description hex string The hex string to convert. Can be in the short-hand format #03f or #0033ff. Returns number - The rgb color value in the format 0xAARRGGBB. Source code: utils/Color.js (Line 545)

Color.hexToColor()

<static> hexToColor(hex, out) → {object} Converts a hex string into a Phaser Color object. The hex string can supplied as '#0033ff' or the short-hand format of '#03f'; it can begin with an optional "#" or "0x", or be unprefixed. An alpha channel is not supported. Parameters Name Type Argument Description hex string The color string in a hex format. out object <optional> An object into which 3 properties will be created or set: r, g and b. If not provided a new object wil

Color.getWebRGB()

<static> getWebRGB(color) → {string} Returns a CSS friendly string value from the given color. Parameters Name Type Description color number | Object Color in RGB (0xRRGGBB), ARGB format (0xAARRGGBB) or an Object with r, g, b, a properties. Returns string - A string in the format: 'rgba(r,g,b,a)' Source code: utils/Color.js (Line 908)

Color.getRGB()

<static> getRGB(color) → {object} Return the component parts of a color as an Object with the properties alpha, red, green, blue. Alpha will only be set if it exist in the given color (0xAARRGGBB) Parameters Name Type Description color number Color in RGB (0xRRGGBB) or ARGB format (0xAARRGGBB). Returns object - An Object with properties: alpha, red, green, blue (also r, g, b and a). Alpha will only be present if a color value > 16777215 was given. Source code: utils/Color

Color.getRed()

<static> getRed(color) → {number} Given a native color value (in the format 0xAARRGGBB) this will return the Red component, as a value between 0 and 255. Parameters Name Type Description color number In the format 0xAARRGGBB. Returns number - The Red component of the color, will be between 0 and 255 (0 being no color, 255 full Red). Source code: utils/Color.js (Line 954)

Color.getRandomColor()

<static> getRandomColor(min, max, alpha) → {number} Returns a random color value between black and whiteSet the min value to start each channel from the given offset.Set the max value to restrict the maximum color used per channel. Parameters Name Type Argument Default Description min number <optional> 0 The lowest value to use for the color. max number <optional> 255 The highest value to use for the color. alpha number <optional> 255 The alpha value o

Color.getGreen()

<static> getGreen(color) → {number} Given a native color value (in the format 0xAARRGGBB) this will return the Green component, as a value between 0 and 255. Parameters Name Type Description color number In the format 0xAARRGGBB. Returns number - The Green component of the color, will be between 0 and 255 (0 being no color, 255 full Green). Source code: utils/Color.js (Line 966)