Packagexp.utils
Classpublic class ColorUtils

Various Color Manipulation functions

See also

support


Public Methods
 MethodDefined by
  
adjustBrightness(clr:uint, bright:Number):uint
[static] Simple psuedo brighten/darken function
ColorUtils
  
adjustBrightness2(clr:uint, bright:int):uint
[static] Change the brightness of a color value
ColorUtils
  
brighter(color:uint):uint
[static]
ColorUtils
  
brighterSolidColor(clr:SolidColor, bright:int, clone:Boolean = false):SolidColor
[static]
ColorUtils
  
darker(color:uint):uint
[static]
ColorUtils
  
get24BitColor(r:int, g:int, b:int):uint
[static] Convert argb values in to 24Bit color hex value
ColorUtils
  
get32BitColor(a:int, r:int, g:int, b:int):uint
[static] Convert argb values in to 32Bit color hex value
ColorUtils
  
getARGBObject(clr:uint):Object
[static] Converts a color hex value to an ARGB color object
ColorUtils
  
getARGBValue(clr:Object):uint
[static] Converts a ARGB color object to a argb 32bit hex value
ColorUtils
  
getColorWheel(clr:uint, count:int = 6):Array
[static] Returns a color wheel array of colors based on a specified base color
ColorUtils
  
getRGBValue(clr:Object):Number
[static] Converts a ARGB color object to a rgb 24bit hex value
ColorUtils
  
getSolidColor(color:uint = 0xFF000000, alpha:Number):SolidColor
Create a SolidColor object from a 32 or 24 Bit color hex value.
ColorUtils
  
HSBtoRGB(HSB:Object):uint
[static] Converts a HSB color object to a RGB object
ColorUtils
  
HSLtoRGB(HSB:Object):Object
[static] Converts a HSL color object to a RGB object
ColorUtils
  
mixColor(rgb1:int, rgb2:int, alpha:Number):int
[static] Calculates the resultant mixed rgb value of overlaying a solid color with an alpha'd color
ColorUtils
  
RGBtoHSB(clr:uint):Object
[static] Converts a RGB color object to a HSB object
ColorUtils
  
RGBtoHSL(RGB:Object):Object
[static] Converts a RGB color object to a HSL object
ColorUtils
  
transform(clr:uint, bright:Number, hue:Number, saturation:Number):uint
[static] Transform a 32Bit color value based on the input params
ColorUtils
Public Constants
 ConstantDefined by
  FACTOR : int = 30
[static]
ColorUtils
Method detail
adjustBrightness()method
public static function adjustBrightness(clr:uint, bright:Number):uint

Simple psuedo brighten/darken function

Parameters
clr:uint — 32Bit color hex value
 
bright:Number — +/- 100

Returns
uint — 32Bit color hex value
adjustBrightness2()method 
public static function adjustBrightness2(clr:uint, bright:int):uint

Change the brightness of a color value

Parameters
clr:uint — A 32Bit hex ARGB color or a 24Bit hex RGB color
 
bright:int — The percentage amount to change the brightness, can be between -100 and +100

Returns
uint
brighter()method 
public static function brighter(color:uint):uintParameters
color:uint

Returns
uint
brighterSolidColor()method 
public static function brighterSolidColor(clr:SolidColor, bright:int, clone:Boolean = false):SolidColor

Parameters
clr:SolidColor
 
bright:int
 
clone:Boolean (default = false)

Returns
SolidColor
darker()method 
public static function darker(color:uint):uintParameters
color:uint

Returns
uint
get24BitColor()method 
public static function get24BitColor(r:int, g:int, b:int):uint

Convert argb values in to 24Bit color hex value

Parameters
r:int — red value
 
g:int — green value
 
b:int — blue value

Returns
uint — 24Bit color hex value
get32BitColor()method 
public static function get32BitColor(a:int, r:int, g:int, b:int):uint

Convert argb values in to 32Bit color hex value

Parameters
a:int — alpha value
 
r:int — red value
 
g:int — green value
 
b:int — blue value

Returns
uint — 32Bit color hex value
getARGBObject()method 
public static function getARGBObject(clr:uint):Object

Converts a color hex value to an ARGB color object

Parameters
clr:uint — A 32(ARGB) or 24(RGB) bit color value

Returns
Object — An object with alpha/red/green/blue properties
getARGBValue()method 
public static function getARGBValue(clr:Object):uint

Converts a ARGB color object to a argb 32bit hex value

Parameters
clr:Object

Returns
uint
getColorWheel()method 
public static function getColorWheel(clr:uint, count:int = 6):Array

Returns a color wheel array of colors based on a specified base color

Parameters
clr:uint — The base or starting color
 
count:int (default = 6) — the number of elements in the wheel, by default 6

Returns
Array
getRGBValue()method 
public static function getRGBValue(clr:Object):Number

Converts a ARGB color object to a rgb 24bit hex value

Parameters
clr:Object

Returns
Number
getSolidColor()method 
public function getSolidColor(color:uint = 0xFF000000, alpha:Number):SolidColor

Create a SolidColor object from a 32 or 24 Bit color hex value.

Parameters
color:uint (default = 0xFF000000) — 32Bit ARGB hex value or 24 Bit RGB hex value
 
alpha:Number — alpha value

Returns
SolidColor — SolidColor object
HSBtoRGB()method 
public static function HSBtoRGB(HSB:Object):uint

Converts a HSB color object to a RGB object

Parameters
HSB:Object

Returns
uint
HSLtoRGB()method 
public static function HSLtoRGB(HSB:Object):Object

Converts a HSL color object to a RGB object

Parameters
HSB:Object

Returns
Object
mixColor()method 
public static function mixColor(rgb1:int, rgb2:int, alpha:Number):int

Calculates the resultant mixed rgb value of overlaying a solid color with an alpha'd color

Parameters
rgb1:int — RGB overlay value
 
rgb2:int — RGB base value
 
alpha:Number — alpha value of overlayed color

Returns
int — RGB value of resultant mix of colors
RGBtoHSB()method 
public static function RGBtoHSB(clr:uint):Object

Converts a RGB color object to a HSB object

Parameters
clr:uint

Returns
Object
RGBtoHSL()method 
public static function RGBtoHSL(RGB:Object):Object

Converts a RGB color object to a HSL object

Parameters
RGB:Object

Returns
Object
transform()method 
public static function transform(clr:uint, bright:Number, hue:Number, saturation:Number):uint

Transform a 32Bit color value based on the input params

Parameters
clr:uint — 32Bit color hex value
 
bright:Number — +/-100
 
hue:Number — +/-100
 
saturation:Number — +/-100

Returns
uint — 32Bit color hex value
Constant detail
FACTORconstant
public static const FACTOR:int = 30