By default, an array containing the red, green, and blue (and optionally alpha) components in that order, or if the format parameter was "hsl"
, the array will contain the hue, saturation and lightness (and optionally alpha) components in that order. Or if format is defined as "number"
, it’ll return a number like 0xFF0000
.
GreenSock Docs
PixiPlugin.parseColor()
Returns : Array | Number

Details
Parses a color (like "#9F0"
, "#FF9900"
, "rgb(255,51,153)"
, or "hsl(108, 50%, 10%)"
) into an array containing the red, green, and blue (and optionally alpha) components in that order, or if the format parameter was "hsl"
, the array will contain the hue, saturation and lightness (and optionally alpha) components in that order. Or if format is defined as "number"
, it’ll return a number like 0xFF0000
.
If a relative value is found in an hsl() or hsla() string, it will preserve those relative prefixes and all the values in the array will be strings instead of numbers (in all other cases the array will be populated with numbers). This is a useful method for converting color-related values into data that’s more useful. PixiJS, for example, requires numeric values for most of its color-related values so it would be cumbersome to use "purple"
or "#F00"
, for example, without this method.