Packageorg.aswing
Classpublic class ASColor
SubclassesASColorUIResource

ASColor object to set color and alpha for a movieclip.



Protected Properties
 PropertyDefined by
  alpha : Number
ASColor
  hue : Number
ASColor
  luminance : Number
ASColor
  rgb : uint
ASColor
  saturation : Number
ASColor
Public Methods
 MethodDefined by
  
ASColor(rgb:uint = 0x000000, alpha:Number = 1)
Create a ASColor
ASColor
  
brighter(factor:Number = 0.7):ASColor
Creates a new ASColor that is a brighter version of this ASColor.
ASColor
  
changeAlpha(newAlpha:Number):ASColor
Create a new ASColor with another alpha but same rgb.
ASColor
  
changeHue(newHue:Number):ASColor
Create a new ASColor with just change hue channel value.
ASColor
  
changeLuminance(newLuminance:Number):ASColor
Create a new ASColor with just change luminance channel value.
ASColor
  
changeSaturation(newSaturation:Number):ASColor
Create a new ASColor with just change saturation channel value.
ASColor
  
darker(factor:Number = 0.7):ASColor
Creates a new ASColor that is a darker version of this ASColor.
ASColor
  
equals(o:Object):Boolean
Compare if compareTo object has the same value as this ASColor object does
ASColor
  
getAlpha():Number
Returns the alpha component in the range 0-1.
ASColor
  
getARGB():uint
Returns the ARGB value representing the color.
ASColor
  
getASColor(r:uint, g:uint, b:uint, a:Number = 1):ASColor
[static] Returns a ASColor with the specified red, green, blue values in the range [0 - 255] and alpha value in range[0, 1].
ASColor
  
getASColorWithHLS(h:Number, l:Number, s:Number, a:Number = 1):ASColor
[static] Returns a ASColor with with the specified hue, luminance, saturation and alpha values in the range [0 - 1].
ASColor
  
getBlue():uint
Returns the blue component in the range 0-255.
ASColor
  
getGreen():uint
Returns the green component in the range 0-255.
ASColor
  
getHue():Number
Returns the hue component in the range [0, 1].
ASColor
  
getLuminance():Number
Returns the luminance component in the range [0, 1].
ASColor
  
getRed():uint
Returns the red component in the range 0-255.
ASColor
  
getRGB():uint
Returns the RGB value representing the color.
ASColor
  
getRGBWith(rr:uint, gg:uint, bb:uint):uint
[static] Returns the RGB value representing the red, green, and blue values.
ASColor
  
getSaturation():Number
Returns the saturation component in the range [0, 1].
ASColor
  
getWithARGB(argb:uint):ASColor
[static] Returns a ASColor with specified ARGB uint value.
ASColor
  
toString():String
ASColor
Public Constants
 ConstantDefined by
  BLACK : ASColor
[static]
ASColor
  BLUE : ASColor
[static]
ASColor
  CYAN : ASColor
[static]
ASColor
  DARK_GRAY : ASColor
[static]
ASColor
  GRAY : ASColor
[static]
ASColor
  GREEN : ASColor
[static]
ASColor
  HALO_BLUE : ASColor
[static]
ASColor
  HALO_GREEN : ASColor
[static]
ASColor
  HALO_ORANGE : ASColor
[static]
ASColor
  LIGHT_GRAY : ASColor
[static]
ASColor
  MAGENTA : ASColor
[static]
ASColor
  ORANGE : ASColor
[static]
ASColor
  PINK : ASColor
[static]
ASColor
  RED : ASColor
[static]
ASColor
  WHITE : ASColor
[static]
ASColor
  YELLOW : ASColor
[static]
ASColor
Property detail
alphaproperty
protected var alpha:Number
hueproperty 
protected var hue:Number
luminanceproperty 
protected var luminance:Number
rgbproperty 
protected var rgb:uint
saturationproperty 
protected var saturation:Number
Constructor detail
ASColor()constructor
public function ASColor(rgb:uint = 0x000000, alpha:Number = 1)

Create a ASColor

Parameters
rgb:uint (default = 0x000000)
 
alpha:Number (default = 1)
Method detail
brighter()method
public function brighter(factor:Number = 0.7):ASColor

Creates a new ASColor that is a brighter version of this ASColor.

Parameters
factor:Number (default = 0.7) — the birghter factor 0 to 1, default is 0.7

Returns
ASColor — a new ASColor object that is a brighter version of this ASColor.

See also

changeAlpha()method 
public function changeAlpha(newAlpha:Number):ASColor

Create a new ASColor with another alpha but same rgb.

Parameters
newAlpha:Number — the new alpha

Returns
ASColor — the new ASColor
changeHue()method 
public function changeHue(newHue:Number):ASColor

Create a new ASColor with just change hue channel value.

Parameters
newHue:Number — the new hue value

Returns
ASColor — the new ASColor
changeLuminance()method 
public function changeLuminance(newLuminance:Number):ASColor

Create a new ASColor with just change luminance channel value.

Parameters
newLuminance:Number — the new luminance value

Returns
ASColor — the new ASColor
changeSaturation()method 
public function changeSaturation(newSaturation:Number):ASColor

Create a new ASColor with just change saturation channel value.

Parameters
newSaturation:Number — the new saturation value

Returns
ASColor — the new ASColor
darker()method 
public function darker(factor:Number = 0.7):ASColor

Creates a new ASColor that is a darker version of this ASColor.

Parameters
factor:Number (default = 0.7) — the darker factor(0, 1), default is 0.7

Returns
ASColor — a new ASColor object that is a darker version of this ASColor.

See also

equals()method 
public function equals(o:Object):Boolean

Compare if compareTo object has the same value as this ASColor object does

Parameters
o:Object — the object to compare with

Returns
Boolean — a Boolean value that indicates if the compareTo object's value is the same as this one
getAlpha()method 
public function getAlpha():Number

Returns the alpha component in the range 0-1.

Returns
Number
getARGB()method 
public function getARGB():uint

Returns the ARGB value representing the color.

Returns
uint
getASColor()method 
public static function getASColor(r:uint, g:uint, b:uint, a:Number = 1):ASColor

Returns a ASColor with the specified red, green, blue values in the range [0 - 255] and alpha value in range[0, 1].

Parameters
r:uint — red channel
 
g:uint — green channel
 
b:uint — blue channel
 
a:Number (default = 1) — alpha channel

Returns
ASColor
getASColorWithHLS()method 
public static function getASColorWithHLS(h:Number, l:Number, s:Number, a:Number = 1):ASColor

Returns a ASColor with with the specified hue, luminance, saturation and alpha values in the range [0 - 1].

Parameters
h:Number — hue channel
 
l:Number — luminance channel
 
s:Number — saturation channel
 
a:Number (default = 1) — alpha channel

Returns
ASColor
getBlue()method 
public function getBlue():uint

Returns the blue component in the range 0-255.

Returns
uint — the blue component.
getGreen()method 
public function getGreen():uint

Returns the green component in the range 0-255.

Returns
uint — the green component.
getHue()method 
public function getHue():Number

Returns the hue component in the range [0, 1].

Returns
Number — the hue component.
getLuminance()method 
public function getLuminance():Number

Returns the luminance component in the range [0, 1].

Returns
Number — the luminance component.
getRed()method 
public function getRed():uint

Returns the red component in the range 0-255.

Returns
uint — the red component.
getRGB()method 
public function getRGB():uint

Returns the RGB value representing the color.

Returns
uint
getRGBWith()method 
public static function getRGBWith(rr:uint, gg:uint, bb:uint):uint

Returns the RGB value representing the red, green, and blue values.

Parameters
rr:uint — red channel
 
gg:uint — green channel
 
bb:uint — blue channel

Returns
uint
getSaturation()method 
public function getSaturation():Number

Returns the saturation component in the range [0, 1].

Returns
Number — the saturation component.
getWithARGB()method 
public static function getWithARGB(argb:uint):ASColor

Returns a ASColor with specified ARGB uint value.

Parameters
argb:uint — ARGB value representing the color

Returns
ASColor — the ASColor
toString()method 
public function toString():String

Returns
String
Constant detail
BLACKconstant
public static const BLACK:ASColor
BLUEconstant 
public static const BLUE:ASColor
CYANconstant 
public static const CYAN:ASColor
DARK_GRAYconstant 
public static const DARK_GRAY:ASColor
GRAYconstant 
public static const GRAY:ASColor
GREENconstant 
public static const GREEN:ASColor
HALO_BLUEconstant 
public static const HALO_BLUE:ASColor
HALO_GREENconstant 
public static const HALO_GREEN:ASColor
HALO_ORANGEconstant 
public static const HALO_ORANGE:ASColor
LIGHT_GRAYconstant 
public static const LIGHT_GRAY:ASColor
MAGENTAconstant 
public static const MAGENTA:ASColor
ORANGEconstant 
public static const ORANGE:ASColor
PINKconstant 
public static const PINK:ASColor
REDconstant 
public static const RED:ASColor
WHITEconstant 
public static const WHITE:ASColor
YELLOWconstant 
public static const YELLOW:ASColor