| Package | com.kraftner.geom |
| Class | public class Color |
Instances of this class can be combined to Palettes.
This Class also offers a wide variety of manipulating this RGBA color. Keep in mind that some of these manipulations aren't exact and non-reversible which means that setting a certain value +10 and then -10 doesn't necessarily bring you back to the initial value.
See also
| Property | Defined by | ||
|---|---|---|---|
| a : Number
alpha part of this Color
Only takes values between 0 and 1, Higher/Lower values are trimmed to 0/1. | Color | ||
| b : Number
blue part of this Color
Only takes values between 0 and 255, Higher/Lower values are trimmed to 0/255. | Color | ||
| brightness : Number
brightness of this Color
Only takes values between 0 and 100, Higher/Lower values are trimmed to 0/100. | Color | ||
| g : Number
green part of this Color
Only takes values between 0 and 255, Higher/Lower values are trimmed to 0/255. | Color | ||
| hex : Number
hex representation of this Color
| Color | ||
| hue : Number
Hue of this Color
Only takes values between 0 and 360, Higher/Lower values are wrapped to be within 0 and 360: 400 would be 40 and -30 would be 330. | Color | ||
| lightness : Number
lightness of this Color as set by the HSL Colorsystem
Only takes values between 0 and 100, Higher/Lower values are trimmed to 0/100. | Color | ||
| r : Number
red part of this Color
Only takes values between 0 and 255, Higher/Lower values are trimmed to 0/255. | Color | ||
| saturation_HSL : Number
saturation of this Color as set by the HSL Colorsystem
Only takes values between 0 and 100, Higher/Lower values are trimmed to 0/100. | Color | ||
| saturation_HSV : Number
saturation of this Color as set by the HSV Colorsystem
Only takes values between 0 and 100, Higher/Lower values are trimmed to 0/100. | Color | ||
| value : Number
value of this Color as set by the HSV Colorsystem
Only takes values between 0 and 100, Higher/Lower values are trimmed to 0/100. | Color | ||
| Method | Defined by | ||
|---|---|---|---|
|
Color(red:Number = 0, green:Number = 0, blue:Number = 0, alpha:Number = 1)
Constructor method
| Color | ||
|
Returns a copy of this Color
| Color | ||
|
random(randomize_red:Boolean = true, randomize_green:Boolean = true, randomize_blue:Boolean = true, randomize_alpha:Boolean = false):void
Randomly change the red, green, blue and alpha values of this Color.
| Color | ||
|
RGBtoHEX(red:Number, green:Number, blue:Number):Number
[static]
Converts a RGB color from red, green and blue parts to a HEX representation
| Color | ||
|
toString():Number
Returns the hex code of this Color
| Color | ||
| a | property |
a:Number [read-write]alpha part of this Color
Only takes values between 0 and 1, Higher/Lower values are trimmed to 0/1.
Implementation public function get a():Number
public function set a(value:Number):void
| b | property |
b:Number [read-write]blue part of this Color
Only takes values between 0 and 255, Higher/Lower values are trimmed to 0/255.
Implementation public function get b():Number
public function set b(value:Number):void
| brightness | property |
brightness:Number [read-write]brightness of this Color
Only takes values between 0 and 100, Higher/Lower values are trimmed to 0/100.
Implementation public function get brightness():Number
public function set brightness(value:Number):void
| g | property |
g:Number [read-write]green part of this Color
Only takes values between 0 and 255, Higher/Lower values are trimmed to 0/255.
Implementation public function get g():Number
public function set g(value:Number):void
| hex | property |
hex:Number [read-write]hex representation of this Color
Implementation public function get hex():Number
public function set hex(value:Number):void
| hue | property |
hue:Number [read-write]Hue of this Color
Only takes values between 0 and 360, Higher/Lower values are wrapped to be within 0 and 360: 400 would be 40 and -30 would be 330.
Implementation public function get hue():Number
public function set hue(value:Number):void
| lightness | property |
lightness:Number [read-write]lightness of this Color as set by the HSL Colorsystem
Only takes values between 0 and 100, Higher/Lower values are trimmed to 0/100.
Implementation public function get lightness():Number
public function set lightness(value:Number):void
| r | property |
r:Number [read-write]red part of this Color
Only takes values between 0 and 255, Higher/Lower values are trimmed to 0/255.
Implementation public function get r():Number
public function set r(value:Number):void
| saturation_HSL | property |
saturation_HSL:Number [read-write]saturation of this Color as set by the HSL Colorsystem
Only takes values between 0 and 100, Higher/Lower values are trimmed to 0/100.
Implementation public function get saturation_HSL():Number
public function set saturation_HSL(value:Number):void
| saturation_HSV | property |
saturation_HSV:Number [read-write]saturation of this Color as set by the HSV Colorsystem
Only takes values between 0 and 100, Higher/Lower values are trimmed to 0/100.
Implementation public function get saturation_HSV():Number
public function set saturation_HSV(value:Number):void
| value | property |
value:Number [read-write]value of this Color as set by the HSV Colorsystem
Only takes values between 0 and 100, Higher/Lower values are trimmed to 0/100.
Implementation public function get value():Number
public function set value(value:Number):void
| Color | () | constructor |
public function Color(red:Number = 0, green:Number = 0, blue:Number = 0, alpha:Number = 1)Constructor method
Parametersred:Number (default = 0) — red value of the RGBA Color
|
|
green:Number (default = 0) — green value of the RGBA Color
|
|
blue:Number (default = 0) — blue value of the RGBA Color
|
|
alpha:Number (default = 1) — alpha value of the RGBA Color
|
| clone | () | method |
public function clone():ColorReturns a copy of this Color
ReturnsColor —
copy of the original Color Instance
|
| random | () | method |
public function random(randomize_red:Boolean = true, randomize_green:Boolean = true, randomize_blue:Boolean = true, randomize_alpha:Boolean = false):voidRandomly change the red, green, blue and alpha values of this Color.
Parametersrandomize_red:Boolean (default = true) |
|
randomize_green:Boolean (default = true) |
|
randomize_blue:Boolean (default = true) |
|
randomize_alpha:Boolean (default = false) |
| RGBtoHEX | () | method |
public static function RGBtoHEX(red:Number, green:Number, blue:Number):NumberConverts a RGB color from red, green and blue parts to a HEX representation
Parametersred:Number — red part of the RGB color
|
|
green:Number — green part of the RGB color
|
|
blue:Number — blue part of the RGB color
|
Number — HEX color
|
| toString | () | method |
public function toString():NumberReturns the hex code of this Color
ReturnsNumber |