class org.aswing.ASColor
| Sub classes | ||||
![]() | ASColorUIResource |
| ||
ASColor object to set color and alpha.
Authors firdosh, paling, n0rthwood, ngrebenshikov
Class Fields
static function getASColor(r:Int, g:Int, b:Int, ?a:Float = 1): ASColor
Returns a ASColor with the specified red, green, blue values in the range [0 - 255] and alpha value in range[0, 1].
| r | red channel |
| g | green channel |
| b | blue channel |
| a | alpha channel |
static function getASColorWithHLS(h:Float, l:Float, s:Float, ?a:Float = 1): ASColor
Returns a ASColor with with the specified hue, luminance, saturation and alpha values in the range [0 - 1].
| h | hue channel |
| l | luminance channel |
| s | saturation channel |
| a | alpha channel |
static function getRGBWith(rr:Int, gg:Int, bb:Int): Int
Returns the RGB value representing the red, green, and blue values.
| rr | red channel |
| gg | green channel |
| bb | blue channel |
static function getWithARGB(argb:Int): ASColor
Returns a ASColor with specified ARGB uint value.
| argb | ARGB value representing the color |
| returns | the ASColor |
Instance Fields
function brighter(?factor:Float = 0.7f): ASColor
Creates a new ASColor that is a brighter version of this
ASColor.
@see #darker()
| factor | the birghter factor 0 to 1, default is 0.7 |
| returns | a new |
function changeAlpha(newAlpha:Float): ASColor
Create a new ASColor with another alpha but same rgb.
| newAlpha | the new alpha |
| returns | the new |
function changeHue(newHue:Float): ASColor
Create a new ASColor with just change hue channel value.
| newHue | the new hue value |
| returns | the new |
function changeLuminance(newLuminance:Float): ASColor
Create a new ASColor with just change luminance channel value.
| newLuminance | the new luminance value |
| returns | the new |
function changeSaturation(newSaturation:Float): ASColor
Create a new ASColor with just change saturation channel value.
| newSaturation | the new saturation value |
| returns | the new |
Clone a ASColor, most time you dont need to call this because ASColor is un-mutable class, but to avoid UIResource, you can call this.
function darker(?factor:Float = 0.7f): ASColor
Creates a new ASColor that is a darker version of this
ASColor.
@see #brighter()
| factor | the darker factor(0, 1), default is 0.7 |
| returns | a new |
function equals(o:Dynamic): Bool
Compare if compareTo object has the same value as this ASColor object does
| compareTo | the object to compare with |
| returns | a Boolean value that indicates if the compareTo object's value is the same as this one |
function getLuminance(): Float
Returns the luminance component in the range [0, 1].
| returns | the luminance component. |
function getSaturation(): Float
Returns the saturation component in the range [0, 1].
| returns | the saturation component. |
function offsetHLS(hOffset:Float, lOffset:Float, sOffset:Float): ASColor
Create a new ASColor with just offset the hue luminace and saturation channel values.
| hOffset | offset for hue |
| lOffset | offset for luminance |
| sOffset | offset for saturation |
| returns | the new |
