Various Color Manipulation functions
support
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
|
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
public static function brighter(color:uint):uintParameters
Returns
public static function brighterSolidColor(clr:SolidColor, bright:int, clone:Boolean = false):SolidColor
Parameters
| clr:SolidColor |
| |
| bright:int |
| |
| clone:Boolean (default = false) |
Returns
public static function darker(color:uint):uintParameters
Returns
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
|
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
|
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
|
public static function getARGBValue(clr:Object):uint
Converts a ARGB color object to a argb 32bit hex value
Parameters
Returns
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
public static function getRGBValue(clr:Object):Number
Converts a ARGB color object to a rgb 24bit hex value
Parameters
Returns
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
|
public static function HSBtoRGB(HSB:Object):uint
Converts a HSB color object to a RGB object
Parameters
Returns
public static function HSLtoRGB(HSB:Object):Object
Converts a HSL color object to a RGB object
Parameters
Returns
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
|
public static function RGBtoHSB(clr:uint):Object
Converts a RGB color object to a HSB object
Parameters
Returns
public static function RGBtoHSL(RGB:Object):Object
Converts a RGB color object to a HSL object
Parameters
Returns
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
|
public static const FACTOR:int = 30