Packageverlocity.utils
Classpublic final class ColorUtil
InheritanceColorUtil Inheritance Object



Public Methods
 MethodDefined By
  
FindComplimentaryHue(hue:Number):Number
[static] Finds the complimentary hue based on the hue given.
ColorUtil
  
HSVtoHex(h:Number, s:Number, v:Number):uint
[static] Returns a hexidecimal color value based on hue, saturation, and value given.
ColorUtil
  
RandColor(r1:int, r2:int, g1:int, g2:int, b1:int, b2:int, a1:int = 255, a2:int = 255):uint
[static] Returns a random color (specific in RGB) in hex.
ColorUtil
  
RandColorHex(uiColor1:uint, uiColor2:uint):uint
[static] Returns a random color between two colors (in hex).
ColorUtil
  
RGBtoHEX(r:uint, g:uint, b:uint, a:uint = 255):uint
[static] Returns a hexidecimal color value based on RGB
ColorUtil
Method Detail
FindComplimentaryHue()method
public static function FindComplimentaryHue(hue:Number):Number

Finds the complimentary hue based on the hue given. Idea from: http://codecanyon.net/forums/thread/as3-help-needed-calculate-complementary-opposite-hex-color-value/31176?page=2#292970

Parameters

hue:Number — Hue

Returns
Number
HSVtoHex()method 
public static function HSVtoHex(h:Number, s:Number, v:Number):uint

Returns a hexidecimal color value based on hue, saturation, and value given. Based on: http://www.cs.rit.edu/~ncs/color/t_convert.html AS3 from: https://gist.github.com/638271

Parameters

h:Number — Hue
 
s:Number — Saturation
 
v:Number — Value

Returns
uint
RandColor()method 
public static function RandColor(r1:int, r2:int, g1:int, g2:int, b1:int, b2:int, a1:int = 255, a2:int = 255):uint

Returns a random color (specific in RGB) in hex.

Parameters

r1:int — First red value.
 
r2:int — Second red value.
 
g1:int — First green value.
 
g2:int — Second green value.
 
b1:int — First blue value.
 
b2:int — Second blue value.
 
a1:int (default = 255) — First alpha value.
 
a2:int (default = 255) — Second alpha value.

Returns
uint
RandColorHex()method 
public static function RandColorHex(uiColor1:uint, uiColor2:uint):uint

Returns a random color between two colors (in hex).

Parameters

uiColor1:uint — The first color
 
uiColor2:uint — The second color

Returns
uint
RGBtoHEX()method 
public static function RGBtoHEX(r:uint, g:uint, b:uint, a:uint = 255):uint

Returns a hexidecimal color value based on RGB

Parameters

r:uint — Red (0-255)
 
g:uint — Green (0-255)
 
b:uint — Blue (0-255)
 
a:uint (default = 255) — Alpha (0-255)

Returns
uint