class jive.Color
Color object to set color and alpha.
Authors firdosh, paling, n0rthwood, ngrebenshikov
Class Fields
static function getColor(r:Int, g:Int, b:Int, ?a:Float): Color
Returns a Color 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 getColorWithHLS(h:Float, l:Float, s:Float, ?a:Float): Color
Returns a Color 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): Color
Returns a Color with specified ARGB uint value.
| argb | ARGB value representing the color |
| returns | the Color |
Instance Fields
function brighter(?factor:Float): Color
Creates a new Color that is a brighter version of this
Color.
@see #darker()
| factor | the birghter factor 0 to 1, default is 0.7 |
| returns | a new |
function changeAlpha(newAlpha:Float): Color
Create a new Color with another alpha but same rgb.
| newAlpha | the new alpha |
| returns | the new |
function changeHue(newHue:Float): Color
Create a new Color with just change hue channel value.
| newHue | the new hue value |
| returns | the new |
function changeLuminance(newLuminance:Float): Color
Create a new Color with just change luminance channel value.
| newLuminance | the new luminance value |
| returns | the new |
function changeSaturation(newSaturation:Float): Color
Create a new Color with just change saturation channel value.
| newSaturation | the new saturation value |
| returns | the new |
Clone a Color, most time you dont need to call this because Color is un-mutable class, but to avoid UIResource, you can call this.
function darker(?factor:Float): Color
Creates a new Color that is a darker version of this
Color.
@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 Color 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): Color
Create a new Color 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 |