{"class":{"name":"Phaser.Color","extends":"","static":true,"constructor":false,"parameters":[],"help":"The Phaser.Color class is a set of static methods that assist in color manipulation and conversion."},"consts":[],"methods":{"public":[{"name":"HSLColorWheel","static":true,"returns":{"types":["array"],"help":"An array containing 360 elements corresponding to the HSL color wheel."},"help":"Get HSL color wheel values in an array which will be 360 elements in size.","line":667,"public":true,"protected":false,"private":false,"parameters":[{"name":"s","type":["number"],"help":"The saturation, in the range 0 - 1.","optional":true,"default":"0.5"},{"name":"l","type":["number"],"help":"The lightness, in the range 0 - 1.","optional":true,"default":"0.5"}],"inherited":false,"inheritedFrom":""},{"name":"HSLtoRGB","static":true,"returns":{"types":["object"],"help":"An object with the red, green and blue values set in the r, g and b properties."},"help":"Converts an HSL (hue, saturation and lightness) color value to RGB.\\nConversion forumla from http:\/\/en.wikipedia.org\/wiki\/HSL_color_space.\\nAssumes HSL values are contained in the set [0, 1] and returns r, g and b values in the set [0, 255].\\nBased on code by Michael Jackson (https:\/\/github.com\/mjijackson)","line":217,"public":true,"protected":false,"private":false,"parameters":[{"name":"h","type":["number"],"help":"The hue, in the range 0 - 1.","optional":false,"default":null},{"name":"s","type":["number"],"help":"The saturation, in the range 0 - 1.","optional":false,"default":null},{"name":"l","type":["number"],"help":"The lightness, in the range 0 - 1.","optional":false,"default":null},{"name":"out","type":["object"],"help":"An object into which 3 properties will be created: r, g and b. If not provided a new object will be created.","optional":true,"default":null}],"inherited":false,"inheritedFrom":""},{"name":"HSVColorWheel","static":true,"returns":{"types":["array"],"help":"An array containing 360 elements corresponding to the HSV color wheel."},"help":"Get HSV color wheel values in an array which will be 360 elements in size.","line":642,"public":true,"protected":false,"private":false,"parameters":[{"name":"s","type":["number"],"help":"The saturation, in the range 0 - 1.","optional":true,"default":"1"},{"name":"v","type":["number"],"help":"The value, in the range 0 - 1.","optional":true,"default":"1"}],"inherited":false,"inheritedFrom":""},{"name":"HSVtoRGB","static":true,"returns":{"types":["object"],"help":"An object with the red, green and blue values set in the r, g and b properties."},"help":"Converts an HSV (hue, saturation and value) color value to RGB.\\nConversion forumla from http:\/\/en.wikipedia.org\/wiki\/HSL_color_space.\\nAssumes HSV values are contained in the set [0, 1] and returns r, g and b values in the set [0, 255].\\nBased on code by Michael Jackson (https:\/\/github.com\/mjijackson)","line":324,"public":true,"protected":false,"private":false,"parameters":[{"name":"h","type":["number"],"help":"The hue, in the range 0 - 1.","optional":false,"default":null},{"name":"s","type":["number"],"help":"The saturation, in the range 0 - 1.","optional":false,"default":null},{"name":"v","type":["number"],"help":"The value, in the range 0 - 1.","optional":false,"default":null},{"name":"out","type":["object"],"help":"An object into which 3 properties will be created: r, g and b. If not provided a new object will be created.","optional":true,"default":null}],"inherited":false,"inheritedFrom":""},{"name":"RGBtoHSL","static":true,"returns":{"types":["object"],"help":"An object with the hue, saturation and lightness values set in the h, s and l properties."},"help":"Converts an RGB color value to HSL (hue, saturation and lightness).\\nConversion forumla from http:\/\/en.wikipedia.org\/wiki\/HSL_color_space.\\nAssumes RGB values are contained in the set [0, 255] and returns h, s and l in the set [0, 1].\\nBased on code by Michael Jackson (https:\/\/github.com\/mjijackson)","line":158,"public":true,"protected":false,"private":false,"parameters":[{"name":"r","type":["number"],"help":"The red color component, in the range 0 - 255.","optional":false,"default":null},{"name":"g","type":["number"],"help":"The green color component, in the range 0 - 255.","optional":false,"default":null},{"name":"b","type":["number"],"help":"The blue color component, in the range 0 - 255.","optional":false,"default":null},{"name":"out","type":["object"],"help":"An object into which 3 properties will be created, h, s and l. If not provided a new object will be created.","optional":true,"default":null}],"inherited":false,"inheritedFrom":""},{"name":"RGBtoHSV","static":true,"returns":{"types":["object"],"help":"An object with the hue, saturation and value set in the h, s and v properties."},"help":"Converts an RGB color value to HSV (hue, saturation and value).\\nConversion forumla from http:\/\/en.wikipedia.org\/wiki\/HSL_color_space.\\nAssumes RGB values are contained in the set [0, 255] and returns h, s and v in the set [0, 1].\\nBased on code by Michael Jackson (https:\/\/github.com\/mjijackson)","line":268,"public":true,"protected":false,"private":false,"parameters":[{"name":"r","type":["number"],"help":"The red color component, in the range 0 - 255.","optional":false,"default":null},{"name":"g","type":["number"],"help":"The green color component, in the range 0 - 255.","optional":false,"default":null},{"name":"b","type":["number"],"help":"The blue color component, in the range 0 - 255.","optional":false,"default":null},{"name":"out","type":["object"],"help":"An object into which 3 properties will be created, h, s and v. If not provided a new object will be created.","optional":true,"default":null}],"inherited":false,"inheritedFrom":""},{"name":"RGBtoString","static":true,"returns":{"types":["string"],"help":"A string containing the color values. If prefix was '#' it will be in the format `#RRGGBB` otherwise `0xAARRGGBB`."},"help":"Converts the given color values into a string.\\nIf prefix was '#' it will be in the format `#RRGGBB` otherwise `0xAARRGGBB`.","line":513,"public":true,"protected":false,"private":false,"parameters":[{"name":"r","type":["number"],"help":"The red color component, in the range 0 - 255.","optional":false,"default":null},{"name":"g","type":["number"],"help":"The green color component, in the range 0 - 255.","optional":false,"default":null},{"name":"b","type":["number"],"help":"The blue color component, in the range 0 - 255.","optional":false,"default":null},{"name":"a","type":["number"],"help":"The alpha color component, in the range 0 - 255.","optional":true,"default":"255"},{"name":"prefix","type":["string"],"help":"The prefix used in the return string. If '#' it will return `#RRGGBB`, else `0xAARRGGBB`.","optional":true,"default":"'#'"}],"inherited":false,"inheritedFrom":""},{"name":"componentToHex","static":true,"returns":null,"help":"Return a string containing a hex representation of the given color component.","line":626,"public":true,"protected":false,"private":false,"parameters":[{"name":"color","type":["number"],"help":"The color channel to get the hex value for, must be a value between 0 and 255.","optional":false,"default":null}],"inherited":false,"inheritedFrom":""},{"name":"createColor","static":true,"returns":{"types":["object"],"help":"The resulting object with r, g, b, a properties and h, s, l and v."},"help":"A utility function to create a lightweight 'color' object with the default components.\\nAny components that are not specified will default to zero.\\n\\nThis is useful when you want to use a shared color object for the getPixel and getPixelAt methods.","line":440,"public":true,"protected":false,"private":false,"parameters":[{"name":"r","type":["number"],"help":"The red color component, in the range 0 - 255.","optional":true,"default":"0"},{"name":"g","type":["number"],"help":"The green color component, in the range 0 - 255.","optional":true,"default":"0"},{"name":"b","type":["number"],"help":"The blue color component, in the range 0 - 255.","optional":true,"default":"0"},{"name":"a","type":["number"],"help":"The alpha color component, in the range 0 - 1.","optional":true,"default":"1"},{"name":"h","type":["number"],"help":"The hue, in the range 0 - 1.","optional":true,"default":"0"},{"name":"s","type":["number"],"help":"The saturation, in the range 0 - 1.","optional":true,"default":"0"},{"name":"l","type":["number"],"help":"The lightness, in the range 0 - 1.","optional":true,"default":"0"},{"name":"v","type":["number"],"help":"The value, in the range 0 - 1.","optional":true,"default":"0"}],"inherited":false,"inheritedFrom":""},{"name":"fromRGBA","static":true,"returns":{"types":["object"],"help":"A color object."},"help":"A utility to convert an integer in 0xRRGGBBAA format to a color object.\\nThis does not rely on endianness.","line":108,"public":true,"protected":false,"private":false,"parameters":[{"name":"rgba","type":["number"],"help":"An RGBA hex","optional":false,"default":null},{"name":"out","type":["object"],"help":"The object to use, optional.","optional":true,"default":null}],"inherited":false,"inheritedFrom":""},{"name":"getAlpha","static":true,"returns":null,"help":"Given a native color value (in the format 0xAARRGGBB) this will return the Alpha component, as a value between 0 and 255.","line":861,"public":true,"protected":false,"private":false,"parameters":[{"name":"color","type":["number"],"help":"In the format 0xAARRGGBB.","optional":false,"default":null}],"inherited":false,"inheritedFrom":""},{"name":"getAlphaFloat","static":true,"returns":null,"help":"Given a native color value (in the format 0xAARRGGBB) this will return the Alpha component as a value between 0 and 1.","line":873,"public":true,"protected":false,"private":false,"parameters":[{"name":"color","type":["number"],"help":"In the format 0xAARRGGBB.","optional":false,"default":null}],"inherited":false,"inheritedFrom":""},{"name":"getBlue","static":true,"returns":null,"help":"Given a native color value (in the format 0xAARRGGBB) this will return the Blue component, as a value between 0 and 255.","line":909,"public":true,"protected":false,"private":false,"parameters":[{"name":"color","type":["number"],"help":"In the format 0xAARRGGBB.","optional":false,"default":null}],"inherited":false,"inheritedFrom":""},{"name":"getColor","static":true,"returns":null,"help":"Given 3 color values this will return an integer representation of it.","line":494,"public":true,"protected":false,"private":false,"parameters":[{"name":"r","type":["number"],"help":"The red color component, in the range 0 - 255.","optional":false,"default":null},{"name":"g","type":["number"],"help":"The green color component, in the range 0 - 255.","optional":false,"default":null},{"name":"b","type":["number"],"help":"The blue color component, in the range 0 - 255.","optional":false,"default":null}],"inherited":false,"inheritedFrom":""},{"name":"getColor32","static":true,"returns":null,"help":"Given an alpha and 3 color values this will return an integer representation of it.","line":478,"public":true,"protected":false,"private":false,"parameters":[{"name":"a","type":["number"],"help":"The alpha color component, in the range 0 - 255.","optional":false,"default":null},{"name":"r","type":["number"],"help":"The red color component, in the range 0 - 255.","optional":false,"default":null},{"name":"g","type":["number"],"help":"The green color component, in the range 0 - 255.","optional":false,"default":null},{"name":"b","type":["number"],"help":"The blue color component, in the range 0 - 255.","optional":false,"default":null}],"inherited":false,"inheritedFrom":""},{"name":"getGreen","static":true,"returns":null,"help":"Given a native color value (in the format 0xAARRGGBB) this will return the Green component, as a value between 0 and 255.","line":897,"public":true,"protected":false,"private":false,"parameters":[{"name":"color","type":["number"],"help":"In the format 0xAARRGGBB.","optional":false,"default":null}],"inherited":false,"inheritedFrom":""},{"name":"getRGB","static":true,"returns":null,"help":"Return the component parts of a color as an Object with the properties alpha, red, green, blue.\\n\\nAlpha will only be set if it exist in the given color (0xAARRGGBB)","line":799,"public":true,"protected":false,"private":false,"parameters":[{"name":"color","type":["number"],"help":"Color in RGB (0xRRGGBB) or ARGB format (0xAARRGGBB).","optional":false,"default":null}],"inherited":false,"inheritedFrom":""},{"name":"getRandomColor","static":true,"returns":null,"help":"Returns a random color value between black and white\\nSet the min value to start each channel from the given offset.\\nSet the max value to restrict the maximum color used per channel.","line":769,"public":true,"protected":false,"private":false,"parameters":[{"name":"min","type":["number"],"help":"The lowest value to use for the color.","optional":false,"default":null},{"name":"max","type":["number"],"help":"The highest value to use for the color.","optional":false,"default":null},{"name":"alpha","type":["number"],"help":"The alpha value of the returning color (default 255 = fully opaque).","optional":false,"default":null}],"inherited":false,"inheritedFrom":""},{"name":"getRed","static":true,"returns":null,"help":"Given a native color value (in the format 0xAARRGGBB) this will return the Red component, as a value between 0 and 255.","line":885,"public":true,"protected":false,"private":false,"parameters":[{"name":"color","type":["number"],"help":" In the format 0xAARRGGBB.","optional":false,"default":null}],"inherited":false,"inheritedFrom":""},{"name":"getWebRGB","static":true,"returns":null,"help":"Returns a CSS friendly string value from the given color.","line":839,"public":true,"protected":false,"private":false,"parameters":[{"name":"color","type":["number","object"],"help":"Color in RGB (0xRRGGBB), ARGB format (0xAARRGGBB) or an Object with r, g, b, a properties.","optional":false,"default":null}],"inherited":false,"inheritedFrom":""},{"name":"hexToColor","static":true,"returns":{"types":["object"],"help":"An object with the red, green and blue values set in the r, g and b properties."},"help":"Converts a hex string into a Phaser Color object.","line":557,"public":true,"protected":false,"private":false,"parameters":[{"name":"hex","type":["string"],"help":"The hex string to convert. Can be in the short-hand format `#03f` or `#0033ff`.","optional":false,"default":null},{"name":"out","type":["object"],"help":"An object into which 3 properties will be created or set: r, g and b. If not provided a new object will be created.","optional":true,"default":null}],"inherited":false,"inheritedFrom":""},{"name":"hexToRGB","static":true,"returns":{"types":["number"],"help":"The rgb color value in the format 0xAARRGGBB."},"help":"Converts a hex string into an integer color value.","line":537,"public":true,"protected":false,"private":false,"parameters":[{"name":"hex","type":["string"],"help":"The hex string to convert. Can be in the short-hand format `#03f` or `#0033ff`.","optional":false,"default":null}],"inherited":false,"inheritedFrom":""},{"name":"hueToColor","static":true,"returns":{"types":["number"],"help":"The color component value."},"help":"Converts a hue to an RGB color.\\nBased on code by Michael Jackson (https:\/\/github.com\/mjijackson)","line":390,"public":true,"protected":false,"private":false,"parameters":[{"name":"p","type":["number"],"help":"","optional":false,"default":null},{"name":"q","type":["number"],"help":"","optional":false,"default":null},{"name":"t","type":["number"],"help":"","optional":false,"default":null}],"inherited":false,"inheritedFrom":""},{"name":"interpolateColor","static":true,"returns":null,"help":"Interpolates the two given colours based on the supplied step and currentStep properties.","line":695,"public":true,"protected":false,"private":false,"parameters":[{"name":"color1","type":["number"],"help":"The first color value.","optional":false,"default":null},{"name":"color2","type":["number"],"help":"The second color value.","optional":false,"default":null},{"name":"steps","type":["number"],"help":"The number of steps to run the interpolation over.","optional":false,"default":null},{"name":"currentStep","type":["number"],"help":"The currentStep value. If the interpolation will take 100 steps, a currentStep value of 50 would be half-way between the two.","optional":false,"default":null},{"name":"alpha","type":["number"],"help":"The alpha of the returned color.","optional":false,"default":null}],"inherited":false,"inheritedFrom":""},{"name":"interpolateColorWithRGB","static":true,"returns":null,"help":"Interpolates the two given colours based on the supplied step and currentStep properties.","line":722,"public":true,"protected":false,"private":false,"parameters":[{"name":"color","type":["number"],"help":"The first color value.","optional":false,"default":null},{"name":"r","type":["number"],"help":"The red color value, between 0 and 0xFF (255).","optional":false,"default":null},{"name":"g","type":["number"],"help":"The green color value, between 0 and 0xFF (255).","optional":false,"default":null},{"name":"b","type":["number"],"help":"The blue color value, between 0 and 0xFF (255).","optional":false,"default":null},{"name":"steps","type":["number"],"help":"The number of steps to run the interpolation over.","optional":false,"default":null},{"name":"currentStep","type":["number"],"help":"The currentStep value. If the interpolation will take 100 steps, a currentStep value of 50 would be half-way between the two.","optional":false,"default":null}],"inherited":false,"inheritedFrom":""},{"name":"interpolateRGB","static":true,"returns":null,"help":"Interpolates the two given colours based on the supplied step and currentStep properties.","line":747,"public":true,"protected":false,"private":false,"parameters":[{"name":"r1","type":["number"],"help":"The red color value, between 0 and 0xFF (255).","optional":false,"default":null},{"name":"g1","type":["number"],"help":"The green color value, between 0 and 0xFF (255).","optional":false,"default":null},{"name":"b1","type":["number"],"help":"The blue color value, between 0 and 0xFF (255).","optional":false,"default":null},{"name":"r2","type":["number"],"help":"The red color value, between 0 and 0xFF (255).","optional":false,"default":null},{"name":"g2","type":["number"],"help":"The green color value, between 0 and 0xFF (255).","optional":false,"default":null},{"name":"b2","type":["number"],"help":"The blue color value, between 0 and 0xFF (255).","optional":false,"default":null},{"name":"steps","type":["number"],"help":"The number of steps to run the interpolation over.","optional":false,"default":null},{"name":"currentStep","type":["number"],"help":"The currentStep value. If the interpolation will take 100 steps, a currentStep value of 50 would be half-way between the two.","optional":false,"default":null}],"inherited":false,"inheritedFrom":""},{"name":"packPixel","static":true,"returns":{"types":["number"],"help":"The packed color as uint32"},"help":"Packs the r, g, b, a components into a single integer, for use with Int32Array.\\nIf device is little endian then ABGR order is used. Otherwise RGBA order is used.","line":27,"public":true,"protected":false,"private":false,"parameters":[{"name":"r","type":["number"],"help":"The red color component, in the range 0 - 255.","optional":false,"default":null},{"name":"g","type":["number"],"help":"The green color component, in the range 0 - 255.","optional":false,"default":null},{"name":"b","type":["number"],"help":"The blue color component, in the range 0 - 255.","optional":false,"default":null},{"name":"a","type":["number"],"help":"The alpha color component, in the range 0 - 255.","optional":false,"default":null}],"inherited":false,"inheritedFrom":""},{"name":"toRGBA","static":true,"returns":{"types":["number"],"help":"A RGBA-packed 32 bit integer"},"help":"A utility to convert RGBA components to a 32 bit integer in RRGGBBAA format.","line":138,"public":true,"protected":false,"private":false,"parameters":[{"name":"r","type":["number"],"help":"The red color component, in the range 0 - 255.","optional":false,"default":null},{"name":"g","type":["number"],"help":"The green color component, in the range 0 - 255.","optional":false,"default":null},{"name":"b","type":["number"],"help":"The blue color component, in the range 0 - 255.","optional":false,"default":null},{"name":"a","type":["number"],"help":"The alpha color component, in the range 0 - 255.","optional":false,"default":null}],"inherited":false,"inheritedFrom":""},{"name":"unpackPixel","static":true,"returns":{"types":["object"],"help":"An object with the red, green and blue values set in the r, g and b properties."},"help":"Unpacks the r, g, b, a components into the specified color object, or a new\\nobject, for use with Int32Array. If little endian, then ABGR order is used when\\nunpacking, otherwise, RGBA order is used. The resulting color object has the\\n`r, g, b, a` properties which are unrelated to endianness.\\n\\nNote that the integer is assumed to be packed in the correct endianness. On little-endian\\nthe format is 0xAABBGGRR and on big-endian the format is 0xRRGGBBAA. If you want a\\nendian-independent method, use fromRGBA(rgba) and toRGBA(r, g, b, a).","line":59,"public":true,"protected":false,"private":false,"parameters":[{"name":"rgba","type":["number"],"help":"The integer, packed in endian order by packPixel.","optional":false,"default":null},{"name":"out","type":["object"],"help":"An object into which 3 properties will be created: r, g and b. If not provided a new object will be created.","optional":true,"default":null},{"name":"hsl","type":["boolean"],"help":"Also convert the rgb values into hsl?","optional":true,"default":"false"},{"name":"hsv","type":["boolean"],"help":"Also convert the rgb values into hsv?","optional":true,"default":"false"}],"inherited":false,"inheritedFrom":""},{"name":"updateColor","static":true,"returns":null,"help":"Takes a color object and updates the rgba property.","line":459,"public":true,"protected":false,"private":false,"parameters":[{"name":"out","type":["object"],"help":"The color object to update.","optional":false,"default":null}],"inherited":false,"inheritedFrom":""},{"name":"webToColor","static":true,"returns":{"types":["object"],"help":"An object with the red, green and blue values set in the r, g and b properties."},"help":"Converts a CSS 'web' string into a Phaser Color object.","line":597,"public":true,"protected":false,"private":false,"parameters":[{"name":"web","type":["string"],"help":"The web string in the format: 'rgba(r,g,b,a)'","optional":false,"default":null},{"name":"out","type":["object"],"help":"An object into which 3 properties will be created: r, g and b. If not provided a new object will be created.","optional":true,"default":null}],"inherited":false,"inheritedFrom":""}],"protected":[],"private":[],"static":[]},"properties":{"public":[],"protected":[],"private":[]}}