Package | starling.utils |
Class | public class Color |
Inheritance | Color Object |
Method | Defined By | ||
---|---|---|---|
argb(alpha:int, red:int, green:int, blue:int):uint [static] Creates an ARGB color, stored in an unsigned integer. | Color | ||
getAlpha(color:uint):int [static] Returns the alpha part of an ARGB color (0 - 255). | Color | ||
getBlue(color:uint):int [static] Returns the blue part of an (A)RGB color (0 - 255). | Color | ||
getGreen(color:uint):int [static] Returns the green part of an (A)RGB color (0 - 255). | Color | ||
getRed(color:uint):int [static] Returns the red part of an (A)RGB color (0 - 255). | Color | ||
interpolate(startColor:uint, endColor:uint, ratio:Number):uint [static] Calculates a smooth transition between one color to the next. | Color | ||
multiply(color:uint, factor:Number):uint [static] Multiplies all channels of an (A)RGB color with a certain factor. | Color | ||
rgb(red:int, green:int, blue:int):uint [static] Creates an RGB color, stored in an unsigned integer. | Color | ||
setAlpha(color:uint, alpha:int):uint [static] Sets the alpha part of an ARGB color (0 - 255). | Color | ||
setBlue(color:uint, blue:int):uint [static] Sets the blue part of an (A)RGB color (0 - 255). | Color | ||
setGreen(color:uint, green:int):uint [static] Sets the green part of an (A)RGB color (0 - 255). | Color | ||
setRed(color:uint, red:int):uint [static] Sets the red part of an (A)RGB color (0 - 255). | Color | ||
toVector(color:uint, out:Vector.<Number> = null):Vector.<Number> [static] Converts a color to a vector containing the RGBA components (in this order) scaled
between 0 and 1. | Color |
Constant | Defined By | ||
---|---|---|---|
AQUA : uint = 0x00ffff [static] | Color | ||
BLACK : uint = 0x000000 [static] | Color | ||
BLUE : uint = 0x0000ff [static] | Color | ||
FUCHSIA : uint = 0xff00ff [static] | Color | ||
GRAY : uint = 0x808080 [static] | Color | ||
GREEN : uint = 0x008000 [static] | Color | ||
LIME : uint = 0x00ff00 [static] | Color | ||
MAROON : uint = 0x800000 [static] | Color | ||
NAVY : uint = 0x000080 [static] | Color | ||
OLIVE : uint = 0x808000 [static] | Color | ||
PURPLE : uint = 0x800080 [static] | Color | ||
RED : uint = 0xff0000 [static] | Color | ||
SILVER : uint = 0xc0c0c0 [static] | Color | ||
TEAL : uint = 0x008080 [static] | Color | ||
WHITE : uint = 0xffffff [static] | Color | ||
YELLOW : uint = 0xffff00 [static] | Color |
argb | () | method |
public static function argb(alpha:int, red:int, green:int, blue:int):uint
Creates an ARGB color, stored in an unsigned integer. Channels are expected in the range 0 - 255.
Parameters
alpha:int | |
red:int | |
green:int | |
blue:int |
uint |
getAlpha | () | method |
public static function getAlpha(color:uint):int
Returns the alpha part of an ARGB color (0 - 255).
Parameters
color:uint |
int |
getBlue | () | method |
public static function getBlue(color:uint):int
Returns the blue part of an (A)RGB color (0 - 255).
Parameters
color:uint |
int |
getGreen | () | method |
public static function getGreen(color:uint):int
Returns the green part of an (A)RGB color (0 - 255).
Parameters
color:uint |
int |
getRed | () | method |
public static function getRed(color:uint):int
Returns the red part of an (A)RGB color (0 - 255).
Parameters
color:uint |
int |
interpolate | () | method |
public static function interpolate(startColor:uint, endColor:uint, ratio:Number):uint
Calculates a smooth transition between one color to the next.
ratio
is expected between 0 and 1.
Parameters
startColor:uint | |
endColor:uint | |
ratio:Number |
uint |
multiply | () | method |
public static function multiply(color:uint, factor:Number):uint
Multiplies all channels of an (A)RGB color with a certain factor.
Parameters
color:uint | |
factor:Number |
uint |
rgb | () | method |
public static function rgb(red:int, green:int, blue:int):uint
Creates an RGB color, stored in an unsigned integer. Channels are expected in the range 0 - 255.
Parameters
red:int | |
green:int | |
blue:int |
uint |
setAlpha | () | method |
public static function setAlpha(color:uint, alpha:int):uint
Sets the alpha part of an ARGB color (0 - 255).
Parameters
color:uint | |
alpha:int |
uint |
setBlue | () | method |
public static function setBlue(color:uint, blue:int):uint
Sets the blue part of an (A)RGB color (0 - 255).
Parameters
color:uint | |
blue:int |
uint |
setGreen | () | method |
public static function setGreen(color:uint, green:int):uint
Sets the green part of an (A)RGB color (0 - 255).
Parameters
color:uint | |
green:int |
uint |
setRed | () | method |
public static function setRed(color:uint, red:int):uint
Sets the red part of an (A)RGB color (0 - 255).
Parameters
color:uint | |
red:int |
uint |
toVector | () | method |
public static function toVector(color:uint, out:Vector.<Number> = null):Vector.<Number>
Converts a color to a vector containing the RGBA components (in this order) scaled between 0 and 1.
Parameters
color:uint | |
out:Vector.<Number> (default = null )
|
Vector.<Number> |
AQUA | Constant |
public static const AQUA:uint = 0x00ffff
BLACK | Constant |
public static const BLACK:uint = 0x000000
BLUE | Constant |
public static const BLUE:uint = 0x0000ff
FUCHSIA | Constant |
public static const FUCHSIA:uint = 0xff00ff
GRAY | Constant |
public static const GRAY:uint = 0x808080
GREEN | Constant |
public static const GREEN:uint = 0x008000
LIME | Constant |
public static const LIME:uint = 0x00ff00
MAROON | Constant |
public static const MAROON:uint = 0x800000
NAVY | Constant |
public static const NAVY:uint = 0x000080
OLIVE | Constant |
public static const OLIVE:uint = 0x808000
PURPLE | Constant |
public static const PURPLE:uint = 0x800080
RED | Constant |
public static const RED:uint = 0xff0000
SILVER | Constant |
public static const SILVER:uint = 0xc0c0c0
TEAL | Constant |
public static const TEAL:uint = 0x008080
WHITE | Constant |
public static const WHITE:uint = 0xffffff
YELLOW | Constant |
public static const YELLOW:uint = 0xffff00