Math functions for colors.
public static function calculateLitColour(col:Number, lightStrength:Number):Number
Calculate the colour for a particular lighting strength.
This converts the supplied pre-multiplied RGB colour into HSL
then modifies the L according to the light strength.
The result is then mapped back into the RGB space.
Parameters
| col:Number |
| |
| lightStrength:Number |
Returns
public static function changeAlpha(c:uint, a:Number):uint
Returns the color with altered alpha value.
Parameters
| c:uint — 32-bit color.
|
| |
| a:Number — New alpha. ( 0 - 1 )
|
Returns
| uint — The hexadecimal value
|
public static function hex2rgb(hex:Number):Object
Converts a hexadecimal color value to rgb components
Parameters
| hex:Number — hexadecimal color.
|
Returns
| Object — The rgb color of the hexadecimal given.
|
public static function hex2rgbn(hex:Number):Object
Converts hexadecimal color value to normalized rgb components ( 0 - 1 ).
Parameters
| hex:Number — hexadecimal color value.
|
Returns
| Object — The normalized rgb components ( 0 - 1.0 )
|
public static function rgb2hex(r:Number, g:Number, b:Number):Number
Converts color component values ( rgb ) to one hexadecimal value.
Parameters
| r:Number — Red Color. ( 0 - 255 )
|
| |
| g:Number — Green Color. ( 0 - 255 )
|
| |
| b:Number — Blue Color. ( 0 - 255 )
|
Returns
| Number — The hexadecimal value
|
ASDoc: Preliminary documentation for the Sandy 3D Engine, version 3.0.1