Packageblitting.model
Classpublic class Color
InheritanceColor Inheritance Object
Implements IInitializable

Color structure.



Public Properties
 PropertyDefined By
  alpha : uint
[read-only] Get unsigned int of 8-bit alpha.
Color
  argb : uint
[read-only] Get 32-bit unsigned int of 8-bit alpha, red, green, blue.
Color
  blue : uint
[read-only] Get unsigned int of 8-bit blue.
Color
  green : uint
[read-only] Get unsigned int of 8-bit green.
Color
  red : uint
[read-only] Get unsigned int of 8-bit red.
Color
  rgb : uint
[read-only] Get 24-bit unsigned int of 8-bit red, green, and blue
Color
  rgba : uint
[read-only] Get 32-bit unsigned int of 8-bit red, green, blue, alpha.
Color
Protected Properties
 PropertyDefined By
  color : uint
32-bit ARGB color 8-bit alpha (0x0 - 0xff) 8-bit red (0x0 - 0xff) 8-bit green (0x0 - 0xff) 8-bit blue (0x0 - 0xff)
Color
Public Methods
 MethodDefined By
  
Color(red:uint = 0x0, green:uint = 0x0, blue:uint = 0x0, alpha:uint = 0xff)
Constructor, initializing color to black with full alpha.
Color
  
fromARGB(color:uint):Color
[static] Get ARGB values from 32-bit integer.
Color
  
fromName(name:String):Color
[static] Get named color from color palette.
Color
  
fromRGB(color:uint):Color
[static] Get RGB values from 24-bit integer.
Color
  
fromRGBA(color:uint):Color
[static] Get RGBA values from 32-bit integer.
Color
  
getAlpha(color:uint):uint
[static] Get Alpha from a 32-bit ARGB unsigned integer.
Color
  
getARGB(alpha:uint, red:uint, green:uint, blue:uint):uint
[static] Get 32-bit ARGB color as integer.
Color
  
getARGBFromAlphaAndRGB(rgb:uint, alpha:uint = 0xff):uint
[static] Get 32-bit ARGB by combining 8-bit Alpha with 24-bit RGB.
Color
  
getARGBFromRGBA(color:uint):uint
[static] Get 32-bit ARGB from RGBA unsigned int.
Color
  
getBlue(color:uint):uint
[static] Get Blue from an unsigned integer.
Color
  
getGreen(color:uint):uint
[static] Get Green from an unsigned integer.
Color
  
getRed(color:uint):uint
[static] Get Red from an unsigned integer.
Color
  
getRGB(red:uint, green:uint, blue:uint):uint
[static] Get 24-bit RGB color as integer.
Color
  
getRGBA(red:uint, green:uint, blue:uint, alpha:uint):uint
[static] Get 32-bit RGBA color as integer.
Color
  
getRGBAFromARGB(color:uint):uint
[static] Get 32-bit RGBA from ARGB unsigned int.
Color
  
initialize():void
IInitialize initialization.
Color
  
[static]
Color
Property Detail
alphaproperty
alpha:uint  [read-only]

Get unsigned int of 8-bit alpha.


Implementation
    public function get alpha():uint
argbproperty 
argb:uint  [read-only]

Get 32-bit unsigned int of 8-bit alpha, red, green, blue.


Implementation
    public function get argb():uint
blueproperty 
blue:uint  [read-only]

Get unsigned int of 8-bit blue.


Implementation
    public function get blue():uint
colorproperty 
protected var color:uint

32-bit ARGB color 8-bit alpha (0x0 - 0xff) 8-bit red (0x0 - 0xff) 8-bit green (0x0 - 0xff) 8-bit blue (0x0 - 0xff)

greenproperty 
green:uint  [read-only]

Get unsigned int of 8-bit green.


Implementation
    public function get green():uint
redproperty 
red:uint  [read-only]

Get unsigned int of 8-bit red.


Implementation
    public function get red():uint
rgbproperty 
rgb:uint  [read-only]

Get 24-bit unsigned int of 8-bit red, green, and blue


Implementation
    public function get rgb():uint
rgbaproperty 
rgba:uint  [read-only]

Get 32-bit unsigned int of 8-bit red, green, blue, alpha.


Implementation
    public function get rgba():uint
Constructor Detail
Color()Constructor
public function Color(red:uint = 0x0, green:uint = 0x0, blue:uint = 0x0, alpha:uint = 0xff)

Constructor, initializing color to black with full alpha.

Parameters
red:uint (default = 0x0) — 8-bit red.
 
green:uint (default = 0x0) — 8-bit green.
 
blue:uint (default = 0x0) — 8-bit blue.
 
alpha:uint (default = 0xff) — 8-bit alpha.
Method Detail
fromARGB()method
public static function fromARGB(color:uint):Color

Get ARGB values from 32-bit integer.

Parameters

color:uint — 32-bit ARGB color as unsigned integer.

Returns
Color — Color instance of 8-bit alpha, red, green, blue.
fromName()method 
public static function fromName(name:String):Color

Get named color from color palette.

Parameters

name:String — Name of color from color palette class.

Returns
Color — 24-bit RGB unsigned integer of color.

See also

ColorPalette
fromRGB()method 
public static function fromRGB(color:uint):Color

Get RGB values from 24-bit integer.

Parameters

color:uint — 24-bit RGB color as unsigned integer.

Returns
Color — Color instance of 8-bit red, green, blue.
fromRGBA()method 
public static function fromRGBA(color:uint):Color

Get RGBA values from 32-bit integer. In ActionScript, ARGB is typically used. Use getARGB for ARGB value. This function is provided for compatibility.

Parameters

color:uint — 32-bit ARGB color as unsigned integer.

Returns
Color — Color instance of 8-bit red, green, blue, alpha.
getAlpha()method 
public static function getAlpha(color:uint):uint

Get Alpha from a 32-bit ARGB unsigned integer.

Parameters

color:uint — 32-bit ARGB color as unsigned integer.

Returns
uint — 8-bit alpha.
getARGB()method 
public static function getARGB(alpha:uint, red:uint, green:uint, blue:uint):uint

Get 32-bit ARGB color as integer.

Parameters

alpha:uint — 8-bit Alpha.
 
red:uint — 8-bit Red.
 
green:uint — 8-bit Green.
 
blue:uint — 8-bit Blue.

Returns
uint — 32-bit ARGB unsigned integer.
getARGBFromAlphaAndRGB()method 
public static function getARGBFromAlphaAndRGB(rgb:uint, alpha:uint = 0xff):uint

Get 32-bit ARGB by combining 8-bit Alpha with 24-bit RGB.

Parameters

rgb:uint — 8-bit Alpha.
 
alpha:uint (default = 0xff) — 24-bit RGB.

Returns
uint — 32-bit ARGB unsigned integer.
getARGBFromRGBA()method 
public static function getARGBFromRGBA(color:uint):uint

Get 32-bit ARGB from RGBA unsigned int.

Parameters

color:uint — 32-bit RGBA unsigned int.

Returns
uint — 32-bit ARGB unsigned int.
getBlue()method 
public static function getBlue(color:uint):uint

Get Blue from an unsigned integer.

Parameters

color:uint — 24-bit RGB color as unsigned integer.

Returns
uint — 8-bit blue.
getGreen()method 
public static function getGreen(color:uint):uint

Get Green from an unsigned integer.

Parameters

color:uint — 24-bit RGB color as unsigned integer.

Returns
uint — 8-bit green.
getRed()method 
public static function getRed(color:uint):uint

Get Red from an unsigned integer.

Parameters

color:uint — 24-bit RGB color as unsigned integer.

Returns
uint — 8-bit red.
getRGB()method 
public static function getRGB(red:uint, green:uint, blue:uint):uint

Get 24-bit RGB color as integer.

Parameters

red:uint — 8-bit Red.
 
green:uint — 8-bit Green.
 
blue:uint — 8-bit Blue.

Returns
uint — 32-bit RGB unsigned integer.
getRGBA()method 
public static function getRGBA(red:uint, green:uint, blue:uint, alpha:uint):uint

Get 32-bit RGBA color as integer. In ActionScript, ARGB is typically used. Use getColor32 for ARGB value. This function is provided for compatibility

Parameters

red:uint — 8-bit Red.
 
green:uint — 8-bit Green.
 
blue:uint — 8-bit Blue.
 
alpha:uint — 8-bit Alpha.

Returns
uint — 32-bit RGBA unsigned integer.
getRGBAFromARGB()method 
public static function getRGBAFromARGB(color:uint):uint

Get 32-bit RGBA from ARGB unsigned int.

Parameters

color:uint — 32-bit ARGB unsigned int.

Returns
uint — 32-bit RGBA unsigned int.
initialize()method 
public function initialize():void

IInitialize initialization.

registerClass()method 
public static function registerClass():void