Packagecom.degrafa.paint.palette
Classpublic class PaletteUtils

Methods for processing color values and generating color palettes.



Public Properties
 PropertyDefined by
  CATEGORY_HUES : Array
[static] Default set of category hues.
PaletteUtils
Public Methods
 MethodDefined by
  
adjustBrightness(color:uint, value:Number):uint
[static] Adjust the color brightness by a given value.
PaletteUtils
  
adjustBrightness2(color:uint, value:Number):uint
[static] Adjust the color brightness by a given value.
PaletteUtils
  
alpha(color:int):int
[static] Get the alpha component of the given color.
PaletteUtils
  
blue(color:int):int
[static] Get the blue component of the given color.
PaletteUtils
  
brighter(color:uint):uint
[static] Get a brighter shade of an input color.
PaletteUtils
  
darker(color:uint):uint
[static] Get a darker shade of an input color.
PaletteUtils
  
desaturate(color:uint):uint
[static] Get a desaturated shade of an input color.
PaletteUtils
  
getCategoryPalette(size:int, s1:Number, s2:Number, b:Number, a:int):Array
[static] Returns a color palette of given size tries to provide colors appropriate as category labels.
PaletteUtils
  
getCoolPalette(size:int):Array
[static] Returns a color palette that uses a "cool", blue-heavy color scheme.
PaletteUtils
  
getGreyScalePalette(size:int):Array
[static] Returns a color palette of specified size that ranges from white to black through shades of gray.
PaletteUtils
  
getHotPalette(size:int):Array
[static] Returns a color palette that moves from black to red to yellow to white.
PaletteUtils
  
getHSBPalette(size:int, s:Number, b:Number):Array
[static] Returns a color palette of given size that cycles through the hues of the HSB (Hue/Saturation/Brightness) color space.
PaletteUtils
  
getInterpolatedPalette(size:int, color1:uint, color2:uint):Array
[static] Returns a color array of given size that ranges from one given color to the other.
PaletteUtils
  
green(color:int):int
[static] Get the green component of the given color.
PaletteUtils
  
grey(color:int):int
[static] Get the color code for the given grayscale value.
PaletteUtils
  
hsb(h:Number, s:Number, b:Number):uint
[static] Get the color code for the given hue, saturation, and brightness values, translating from HSB color space to RGB color space.
PaletteUtils
  
hsba(h:Number, s:Number, b:Number, a:Number):uint
[static] Get the color code for the given hue, saturation, and brightness values, translating from HSB color space to RGB color space.
PaletteUtils
  
HSBtoRGB(h:Number, s:Number, v:Number):uint
[static] Convert hsb color value to rgb.
PaletteUtils
  
interpolate(color1:uint, color2:uint, t:Number):uint
[static] Interpolate between two color values by the given mixing proportion.
PaletteUtils
  
red(color:int):int
[static] Get the red component of the given color.
PaletteUtils
  
rgb(r:int, g:int, b:int):uint
[static] Get the color code for the given red, green, and blue values.
PaletteUtils
  
rgba(r:int, g:int, b:int, a:int = 255):uint
[static] Get the color code for the given red, green, blue, and alpha values.
PaletteUtils
  
rgbaFloat(r:Number, g:Number, b:Number, a:Number):uint
[static] Get the color code for the given red, green, blue, and alpha values as floating point numbers in the range 0-1.0.
PaletteUtils
  
RGBtoHSB(r:int, g:int, b:int):Object
[static] Convert rbg color value to hsb.
PaletteUtils
  
saturate(color:uint, saturation:Number):uint
[static] Set the saturation of an input color.
PaletteUtils
  
setAlpha(color:uint, alpha:Number):uint
[static] Set the alpha component of the given color.
PaletteUtils
Property detail
CATEGORY_HUESproperty
public static var CATEGORY_HUES:Array

Default set of category hues.

Method detail
adjustBrightness()method
public static function adjustBrightness(color:uint, value:Number):uint

Adjust the color brightness by a given value. From Adobe Flex.

Parameters
color:uint
 
value:Number

Returns
uint
adjustBrightness2()method 
public static function adjustBrightness2(color:uint, value:Number):uint

Adjust the color brightness by a given value. From Adobe Flex.

Parameters
color:uint
 
value:Number

Returns
uint
alpha()method 
public static function alpha(color:int):int

Get the alpha component of the given color.

Parameters
color:int

Returns
int
blue()method 
public static function blue(color:int):int

Get the blue component of the given color.

Parameters
color:int

Returns
int
brighter()method 
public static function brighter(color:uint):uint

Get a brighter shade of an input color.

Parameters
color:uint

Returns
uint
darker()method 
public static function darker(color:uint):uint

Get a darker shade of an input color.

Parameters
color:uint

Returns
uint
desaturate()method 
public static function desaturate(color:uint):uint

Get a desaturated shade of an input color.

Parameters
color:uint

Returns
uint
getCategoryPalette()method 
public static function getCategoryPalette(size:int, s1:Number, s2:Number, b:Number, a:int):Array

Returns a color palette of given size tries to provide colors appropriate as category labels. There are 12 basic color hues (red, orange, yellow, olive, green, cyan, blue, purple, magenta, and pink). If the size is greater than 12, these colors will be continually repeated, but with varying saturation levels.

Parameters
size:int — the size of the color palette
 
s1:Number — the initial saturation to use
 
s2:Number — the final (most distant) saturation to use
 
b:Number — the brightness value to use
 
a:int — the alpha value to use

Returns
Array
getCoolPalette()method 
public static function getCoolPalette(size:int):Array

Returns a color palette that uses a "cool", blue-heavy color scheme.

Parameters
size:int

Returns
Array
getGreyScalePalette()method 
public static function getGreyScalePalette(size:int):Array

Returns a color palette of specified size that ranges from white to black through shades of gray.

Parameters
size:int

Returns
Array
getHotPalette()method 
public static function getHotPalette(size:int):Array

Returns a color palette that moves from black to red to yellow to white.

Parameters
size:int

Returns
Array
getHSBPalette()method 
public static function getHSBPalette(size:int, s:Number, b:Number):Array

Returns a color palette of given size that cycles through the hues of the HSB (Hue/Saturation/Brightness) color space.

Parameters
size:int — the size of the color palette
 
s:Number — the saturation value to use
 
b:Number — the brightness value to use

Returns
Array — the color palette
getInterpolatedPalette()method 
public static function getInterpolatedPalette(size:int, color1:uint, color2:uint):Array

Returns a color array of given size that ranges from one given color to the other.

Parameters
size:int
 
color1:uint
 
color2:uint

Returns
Array
green()method 
public static function green(color:int):int

Get the green component of the given color.

Parameters
color:int

Returns
int
grey()method 
public static function grey(color:int):int

Get the color code for the given grayscale value.

Parameters
color:int

Returns
int
hsb()method 
public static function hsb(h:Number, s:Number, b:Number):uint

Get the color code for the given hue, saturation, and brightness values, translating from HSB color space to RGB color space.

Parameters
h:Number
 
s:Number
 
b:Number

Returns
uint
hsba()method 
public static function hsba(h:Number, s:Number, b:Number, a:Number):uint

Get the color code for the given hue, saturation, and brightness values, translating from HSB color space to RGB color space.

Parameters
h:Number
 
s:Number
 
b:Number
 
a:Number

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

Convert hsb color value to rgb.

Parameters
h:Number
 
s:Number
 
v:Number

Returns
uint
interpolate()method 
public static function interpolate(color1:uint, color2:uint, t:Number):uint

Interpolate between two color values by the given mixing proportion.

Parameters
color1:uint
 
color2:uint
 
t:Number

Returns
uint
red()method 
public static function red(color:int):int

Get the red component of the given color.

Parameters
color:int

Returns
int
rgb()method 
public static function rgb(r:int, g:int, b:int):uint

Get the color code for the given red, green, and blue values.

Parameters
r:int
 
g:int
 
b:int

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

Get the color code for the given red, green, blue, and alpha values.

Parameters
r:int
 
g:int
 
b:int
 
a:int (default = 255)

Returns
uint
rgbaFloat()method 
public static function rgbaFloat(r:Number, g:Number, b:Number, a:Number):uint

Get the color code for the given red, green, blue, and alpha values as floating point numbers in the range 0-1.0.

Parameters
r:Number
 
g:Number
 
b:Number
 
a:Number

Returns
uint
RGBtoHSB()method 
public static function RGBtoHSB(r:int, g:int, b:int):Object

Convert rbg color value to hsb.

Parameters
r:int
 
g:int
 
b:int

Returns
Object
saturate()method 
public static function saturate(color:uint, saturation:Number):uint

Set the saturation of an input color.

Parameters
color:uint
 
saturation:Number

Returns
uint
setAlpha()method 
public static function setAlpha(color:uint, alpha:Number):uint

Set the alpha component of the given color.

Parameters
color:uint
 
alpha:Number

Returns
uint