Utilites and constants for work with color. Color is represented by 24-bit unsigned number like 0xRRGGBB.
public static function blue(color:uint):uintGet blue channel color value.
Parameters
Returns
| uint — blue channel value |
public static function difference(a:uint, b:uint):uintComponent-wise color subtraction.
Parameters
| a:uint — minuend color |
| |
| b:uint — subtrahend color |
Returns
| uint — component-wise color difference |
public static function green(color:uint):uintGet green channel color value.
Parameters
Returns
| uint — green channel value |
public static function interpolate(a:uint, b:uint, k:Number = 0.5):uintComponent-wise linear color interpolation.
Parameters
| a:uint — color interval beginning |
| |
| b:uint — color interval ending |
| |
| k:Number (default = 0.5) — interpolation parameter |
Returns
| uint — interpolated color value |
public static function multiply(color:uint, multiplier:Number):uintComponent-wise color multiplication.
Parameters
| color:uint — color |
| |
| multiplier:Number — multuplier |
Returns
| uint — a result of component-wise color multiplication |
public static function random(redMin:uint = 0, redMax:uint = 255, greenMin:uint = 0, greenMax:uint = 255, blueMin:uint = 0, blueMax:uint = 255):uintForm random color with channels values within given limits.
Parameters
| redMin:uint (default = 0) — red channel minimum |
| |
| redMax:uint (default = 255) — red channel maximum |
| |
| greenMin:uint (default = 0) — green channel minimum |
| |
| greenMax:uint (default = 255) — green channel maximum |
| |
| blueMin:uint (default = 0) — blue channel minimum |
| |
| blueMax:uint (default = 255) — blue channel maximum |
Returns
public static function red(color:uint):uintGet red channel color value.
Parameters
Returns
public static function rgb(red:int, green:int, blue:int):uintForm a color value from three channels.
Parameters
| red:int — red channel value |
| |
| green:int — green channel value |
| |
| blue:int — blue channel value |
Returns
| uint — a color value, formed from three channels |
public static function sum(a:uint, b:uint):uintComponent-wise color sum.
Parameters
| a:uint — first color |
| |
| b:uint — second color |
Returns
| uint — component-wise color sum |
public static const BLACK:uint = 0x000000
public static const BLUE:uint = 0x00007F
public static const BROWN:uint = 0x7F7F00
public static const CYAN:uint = 0x007F7F
public static const GRAY:uint = 0x7F7F7F
public static const GREEN:uint = 0x007F00
public static const LIGHT_BLUE:uint = 0x0000FF
public static const LIGHT_CYAN:uint = 0x00FFFF
public static const LIGHT_GREEN:uint = 0x00FF00
public static const LIGHT_MAGENTA:uint = 0xFF00FF
public static const LIGHT_RED:uint = 0xFF0000
public static const MAGENTA:uint = 0x7F007F
public static const RED:uint = 0x7F0000
public static const WHITE:uint = 0xFFFFFF
public static const YELLOW:uint = 0xFFFF00