Optionalred: numberThe red color value. A number between 0 and 255. Default 0.
Optionalgreen: numberThe green color value. A number between 0 and 255. Default 0.
Optionalblue: numberThe blue color value. A number between 0 and 255. Default 0.
Optionalalpha: numberThe alpha value. A number between 0 and 255. Default 255.
The alpha color value, normalized to the range 0 to 255.
The alpha color value, normalized to the range 0 to 1.
The blue color value, normalized to the range 0 to 255.
The blue color value, normalized to the range 0 to 1.
ReadonlycolorThe color of this Color component, not including the alpha channel.
Readonlycolor32The color of this Color component, including the alpha channel.
An array containing the calculated color values for WebGL use.
The green color value, normalized to the range 0 to 255.
The green color value, normalized to the range 0 to 1.
The hue color value. A number between 0 and 1. This is the base color.
The red color value, normalized to the range 0 to 255.
The red color value, normalized to the range 0 to 1.
ReadonlyrgbaThe color of this Color component as a string which can be used in CSS color values.
The saturation color value. A number between 0 and 1. This controls how much of the hue will be in the final color, where 1 is fully saturated and 0 will give you white.
The lightness color value. A number between 0 and 1. This controls how dark the color is. Where 1 is as bright as possible and 0 is black.
Sets the color based on the hue, saturation and lightness values given.
The hue, in the range 0 - 1. This is the base color.
The saturation, in the range 0 - 1. This controls how much of the hue will be in the final color, where 1 is fully saturated and 0 will give you white.
The value, in the range 0 - 1. This controls how dark the color is. Where 1 is as bright as possible and 0 is black.
Sets the color based on the color object given.
An object containing r, g, b and optionally a values in the range 0 to 255.
Sets the red, green, blue and alpha GL values of this Color component.
The red color value. A number between 0 and 1.
The green color value. A number between 0 and 1.
The blue color value. A number between 0 and 1.
Optionalalpha: numberThe alpha value. A number between 0 and 1. Default 1.
Sets the color of this Color component.
The red color value. A number between 0 and 255.
The green color value. A number between 0 and 255.
The blue color value. A number between 0 and 255.
Optionalalpha: numberThe alpha value. A number between 0 and 255. Default 255.
OptionalupdateHSV: booleanUpdate the HSV values after setting the RGB values? Default true.
StaticColorReturn an array of Colors in a Color Spectrum.
The spectrum colors flow in the order: red, yellow, green, blue.
By default this function will return an array with 1024 elements in.
However, you can reduce this to a smaller quantity if needed, by specitying the limit parameter.
Optionallimit: numberHow many colors should be returned? The maximum is 1024 but you can set a smaller quantity if required. Default 1024.
StaticColorConverts the given color value into an Object containing r,g,b and a properties.
A color value, optionally including the alpha value.
StaticComponentReturns a string containing a hex representation of the given color component.
The color channel to get the hex value for, must be a value between 0 and 255.
StaticGetGiven 3 separate color values this will return an integer representation of it.
The red color value. A number between 0 and 255.
The green color value. A number between 0 and 255.
The blue color value. A number between 0 and 255.
StaticGetGiven an alpha and 3 color values this will return an integer representation of it.
The red color value. A number between 0 and 255.
The green color value. A number between 0 and 255.
The blue color value. A number between 0 and 255.
The alpha color value. A number between 0 and 255.
StaticHexConverts 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.
The hex color value to convert, such as #0033ff or the short-hand format: #03f.
StaticHSLStaticHSVGenerates an HSV color wheel which is an array of 360 Color objects, for each step of the wheel.
Optionals: numberThe saturation, in the range 0 - 1. Default 1.
Optionalv: numberThe value, in the range 0 - 1. Default 1.
StaticHSVConverts a HSV (hue, saturation and value) color set to RGB.
Conversion formula from https://en.wikipedia.org/wiki/HSL_and_HSV
Assumes HSV values are contained in the set [0, 1].
The hue, in the range 0 - 1. This is the base color.
The saturation, in the range 0 - 1. This controls how much of the hue will be in the final color, where 1 is fully saturated and 0 will give you white.
The value, in the range 0 - 1. This controls how dark the color is. Where 1 is as bright as possible and 0 is black.
Optionalout: Display.Color | ColorObjectA Color object to store the results in. If not given a new ColorObject will be created.
StaticHueConverts a hue to an RGB color. Based on code by Michael Jackson (https://github.com/mjijackson)
StaticIntegerStaticIntegerReturn the component parts of a color as an Object with the properties alpha, red, green, blue.
Alpha will only be set if it exists in the given color (0xAARRGGBB)
The color value to convert into a Color object.
StaticObjectConverts an object containing r, g, b and a properties into a Color class instance.
An object containing r, g, b and a properties in the range 0 to 255.
StaticRandomCreates a new Color object where the r, g, and b values have been set to random values based on the given min max values.
Optionalmin: numberThe minimum value to set the random range from (between 0 and 255) Default 0.
Optionalmax: numberThe maximum value to set the random range from (between 0 and 255) Default 255.
StaticRGBStaticRGBConverts an RGB color value to HSV (hue, saturation and value). Conversion formula from http://en.wikipedia.org/wiki/HSL_color_space. Assumes RGB values are contained in the set [0, 255] and returns h, s and v in the set [0, 1]. Based on code by Michael Jackson (https://github.com/mjijackson)
The red color value. A number between 0 and 255.
The green color value. A number between 0 and 255.
The blue color value. A number between 0 and 255.
Optionalout: Display.Color | HSVColorObjectAn object to store the color values in. If not given an HSV Color Object will be created.
StaticRGBConverts the color values into an HTML compatible color string, prefixed with either # or 0x.
The red color value. A number between 0 and 255.
The green color value. A number between 0 and 255.
The blue color value. A number between 0 and 255.
Optionala: numberThe alpha value. A number between 0 and 255. Default 255.
Optionalprefix: stringThe prefix of the string. Either # or 0x. Default #.
StaticValueConverts the given source color value into an instance of a Color class.
The value can be either a string, prefixed with rgb or a hex string, a number or an Object.
The source color value to convert.
The Color class holds a single color value and allows for easy modification and reading of it.