Packageorg.juicekit.flare.util.palette
Classpublic class ColorPalette
InheritanceColorPalette Inheritance flare.util.palette.ColorPalette
Implementsflash.events.IEventDispatcher



Public Properties
 PropertyDefined by
  colorsAC : ArrayCollection
ColorPalette
  darker : Function
ColorPalette
  _keyframes : Array
ColorPalette
  length : uint
ColorPalette
  lighter : Function
ColorPalette
  nameCache : Object
An object containing arrays
ColorPalette
  paletteName : String = "undefined"
An optional name for the palette This will be used to attempt to lookup the palette if the palette length is changed
ColorPalette
  sortByAlpha : Function
ColorPalette
  sortByBlue : Function
ColorPalette
  sortByGreen : Function
ColorPalette
  sortByHue : Function
ColorPalette
  sortByLuminance : Function
ColorPalette
  sortByLuminanceBlack : Function
ColorPalette
  sortByRed : Function
ColorPalette
  sortBySaturation : Function
ColorPalette
  sortByValue : Function
ColorPalette
  values : Array
Array of palette values.
ColorPalette
Public Methods
 MethodDefined by
  
ColorPalette(colors:Array, keyframes:Array = null, nm:String)
Creates a new ColorPalette.
ColorPalette
  
addEventListener(type:String, listener:Function, useCapture:Boolean = false, priority:int = 0, useWeakReference:Boolean = false):void
ColorPalette
  
adjustContrast(step:Number = 0.1):ColorPalette
(NodeBox) Adjust contrast on all the colors in the input list
ColorPalette
  
analagous(c:uint, angle:Number = 0.02777, contrast:Number = 0.25):ColorPalette
[static] Returns colors that are next to each other on the wheel.
ColorPalette
  
(NodeBox) Get analagous colors for all colors in the input list
ColorPalette
  
category(size:int = 20, colors:Array = null, alpha:Number = 1.0, paletteName:String = "category"):ColorPalette
[static] Generates a categorical color palette
ColorPalette
  
(NodeBox) Complement all the colors in the input list
ColorPalette
  
[static] A palette containing six total colors that are related to the base color
ColorPalette
  
compound(c:uint, flip:Boolean = false):ColorPalette
[static] Roughly the complement and some far analogs.
ColorPalette
  
createPalette(colors:Array, keyframes:Array, size:int):ColorPalette
[static] Create a palette using colors and keyframes
ColorPalette
  
createPaletteFromRGB(redValues:Array, redKeyframes:Array, greenValues:Array, greenKeyframes:Array, blueValues:Array, blueKeyframes:Array, nm:String, size:int):ColorPalette
[static] Create a palette using separate values and keyframes for each color channel.
ColorPalette
  
darken(step:Number = 0.1):ColorPalette
(NodeBox) Darken all the colors in the input list
ColorPalette
  
darkest():uint
Return the darkest color in the array
ColorPalette
  
desaturate(step:Number = 0.1):ColorPalette
(NodeBox) Desaturate all the colors in the input list
ColorPalette
  
(NodeBox) Completely desaturate all colors in the input list
ColorPalette
  
dispatchEvent(event:Event):Boolean
ColorPalette
  
diverging(min:uint = 0xffd73027, mid:uint = 0xffffffbf, max:uint = 0xff1a9850, f:Number = 0.5, size:int, paletteName:String = "diverging"):ColorPalette
[static] Generates a color palette of color ramps diverging from a central value.
ColorPalette
  
Extend the list by adding complements for all colors
ColorPalette
  
[static] Roughly the complement and some far analogs.
ColorPalette
  
[static] A color array containing a single color
ColorPalette
  
[static] Convert a Flare ColorPalette to a JuiceKit ColorPalette
ColorPalette
  
getCategoricalPaletteByName(name:String = "spectral", size:int = 64):ColorPalette
[static] Categorical palettes shows categories
ColorPalette
  
getColorByIndexFromAC(idx:int):uint
ColorPalette
  
getDivergingPaletteByName(name:String = "RdGy", size:int = 64):ColorPalette
[static] Diverging palettes go from an negative high intensity through a lower intensit critical midpoint to a positive high intensity
ColorPalette
  
getPaletteByName(name:String = "", size:int = 64):ColorPalette
[static]
ColorPalette
  
getSequentialPaletteByName(name:String = "hot", size:int = 64):ColorPalette
[static] Sequential palettes go from a low intensity to a high intensity
ColorPalette
  
getSequentialReversedPaletteByName(name:String = "binary", size:int = 64):ColorPalette
[static] Sequential reversed palettes go from a high intensity to a low intensity
ColorPalette
  
hasEventListener(type:String):Boolean
ColorPalette
  
[static] Returns the left half of the split complement.
ColorPalette
  
lighten(step:Number = 0.1):ColorPalette
(NodeBox) Lighten all the colors in the input list
ColorPalette
  
lightest():uint
Return the lightest color in the array
ColorPalette
  
[static] Returns colors in the same hue with varying brightness/saturation.
ColorPalette
  
Pastel1(size:int):ColorPalette
[static]
ColorPalette
  
Pastel2(size:int):ColorPalette
[static]
ColorPalette
  
ramp(min:uint = 0xfff1eef6, max:uint = 0xff045a8d, size:int, paletteName:String = "ramp"):ColorPalette
[static] Generates a color palette that "ramps" from one color to another.
ColorPalette
  
removeEventListener(type:String, listener:Function, useCapture:Boolean = false):void
ColorPalette
  
Reverse the order of colors in the Palette
ColorPalette
  
[static] Returns the right half of the split complement.
ColorPalette
  
saturate(step:Number = 0.1):ColorPalette
(NodeBox) Saturate all the colors in the input list
ColorPalette
  
[static] A palette containing the split complementary colors of a base color
ColorPalette
  
tetrad(c:uint, angle:Number = 0.25):ColorPalette
[static] Returns a tetrad of colors.
ColorPalette
  
Convert a JuiceKit ColorPalette to a Flare ColorPalette
ColorPalette
  
triad(c:uint, angle:Number = 0.33333):ColorPalette
[static] Returns a triad of colors.
ColorPalette
  
willTrigger(type:String):Boolean
ColorPalette
Public Constants
 ConstantDefined by
  CATEGORY_COLORS_10 : Array
[static] A set of 10 colors for encoding category values.
ColorPalette
  CATEGORY_COLORS_20 : Array
[static] A set of 20 colors for encoding category values.
ColorPalette
  CATEGORY_COLORS_ALT_19 : Array
[static] An alternative set of 19 colors for encoding category values.
ColorPalette
  DEFAULT_SIZE : int = 64
[static] Default size of generated color palettes.
ColorPalette
Property detail
colorsACproperty
public var colorsAC:ArrayCollection
darkerproperty 
public var darker:Function
_keyframesproperty 
public var _keyframes:Array
lengthproperty 
length:uint  [read-write]

This property can be used as the source for data binding.

Implementation
    public function get length():uint
    public function set length(value:uint):void
lighterproperty 
public var lighter:Function
nameCacheproperty 
public var nameCache:Object

An object containing arrays

paletteNameproperty 
public var paletteName:String = "undefined"

An optional name for the palette This will be used to attempt to lookup the palette if the palette length is changed

sortByAlphaproperty 
public var sortByAlpha:Function
sortByBlueproperty 
public var sortByBlue:Function
sortByGreenproperty 
public var sortByGreen:Function
sortByHueproperty 
public var sortByHue:Function
sortByLuminanceproperty 
public var sortByLuminance:Function
sortByLuminanceBlackproperty 
public var sortByLuminanceBlack:Function
sortByRedproperty 
public var sortByRed:Function
sortBySaturationproperty 
public var sortBySaturation:Function
sortByValueproperty 
public var sortByValue:Function
valuesproperty 
values:Array  [read-write]

Array of palette values.

This property can be used as the source for data binding.

Implementation
    public function get values():Array
    public function set values(value:Array):void
Constructor detail
ColorPalette()constructor
public function ColorPalette(colors:Array, keyframes:Array = null, nm:String)

Creates a new ColorPalette.

Parameters
colors:Array — an array of colors defining the palette
 
keyframes:Array (default = null) — array of keyframes of color interpolations
 
nm:String
Method detail
addEventListener()method
public function addEventListener(type:String, listener:Function, useCapture:Boolean = false, priority:int = 0, useWeakReference:Boolean = false):voidParameters
type:String
 
listener:Function
 
useCapture:Boolean (default = false)
 
priority:int (default = 0)
 
useWeakReference:Boolean (default = false)
adjustContrast()method 
public function adjustContrast(step:Number = 0.1):ColorPalette

(NodeBox) Adjust contrast on all the colors in the input list

Parameters
step:Number (default = 0.1) — an optional step value, default=0.1

Returns
ColorPalette — a list containing contrast adjusted color values
analagous()method 
public static function analagous(c:uint, angle:Number = 0.02777, contrast:Number = 0.25):ColorPalette

Returns colors that are next to each other on the wheel. These yield natural color schemes (like shades of water or sky). The angle determines how far the colors are apart, making it bigger will introduce more variation. The contrast determines the darkness/lightness of the analogue colors in respect to the given colors.

Parameters
c:uint — a base color
 
angle:Number (default = 0.02777) — how far the colors are apart between 0-1, default=0.02777 (5 degrees)
 
contrast:Number (default = 0.25) — the darkness/lightness of the analogue colors with respect to the base colors, default=0.25

Returns
ColorPalette
analog()method 
public function analog():ColorPalette

(NodeBox) Get analagous colors for all colors in the input list

Returns
ColorPalette — a list containing analagous colors
category()method 
public static function category(size:int = 20, colors:Array = null, alpha:Number = 1.0, paletteName:String = "category"):ColorPalette

Generates a categorical color palette

Parameters
size:int (default = 20) — the number of colors to include
 
colors:Array (default = null) — an array of category colors to use. If null, a default category color palette will be used.
 
alpha:Number (default = 1.0) — the alpha value for this palette's colors
 
paletteName:String (default = "category")

Returns
ColorPalette — the categorical color palette
complement()method 
public function complement():ColorPalette

(NodeBox) Complement all the colors in the input list

Returns
ColorPalette — a list containing complementary colors
complementary()method 
public static function complementary(c:uint):ColorPalette

A palette containing six total colors that are related to the base color

Parameters
c:uint — a base color

Returns
ColorPalette
compound()method 
public static function compound(c:uint, flip:Boolean = false):ColorPalette

Roughly the complement and some far analogs.

Parameters
c:uint — a base color
 
flip:Boolean (default = false)

Returns
ColorPalette
createPalette()method 
public static function createPalette(colors:Array, keyframes:Array, size:int):ColorPalette

Create a palette using colors and keyframes

Parameters
colors:Array
 
keyframes:Array
 
size:int

Returns
ColorPalette
createPaletteFromRGB()method 
public static function createPaletteFromRGB(redValues:Array, redKeyframes:Array, greenValues:Array, greenKeyframes:Array, blueValues:Array, blueKeyframes:Array, nm:String, size:int):ColorPalette

Create a palette using separate values and keyframes for each color channel.

Parameters
redValues:Array — desired red value at keyframe positions
 
redKeyframes:Array — desired red keyframes
 
greenValues:Array — desired green value at keyframe positions
 
greenKeyframes:Array — desired green keyframes
 
blueValues:Array — desired blue value at keyframe positions
 
blueKeyframes:Array — desired blue keyframes
 
nm:String — a name for the palette
 
size:int — the length of the palette

Returns
ColorPalette
darken()method 
public function darken(step:Number = 0.1):ColorPalette

(NodeBox) Darken all the colors in the input list

Parameters
step:Number (default = 0.1) — an optional step value, default=0.1

Returns
ColorPalette — a list containing darkened color values
darkest()method 
public function darkest():uint

Return the darkest color in the array

Returns
uint
desaturate()method 
public function desaturate(step:Number = 0.1):ColorPalette

(NodeBox) Desaturate all the colors in the input list

Parameters
step:Number (default = 0.1) — an optional step value, default=0.1

Returns
ColorPalette — a list containing more saturated color values
desaturate2()method 
public function desaturate2():ColorPalette

(NodeBox) Completely desaturate all colors in the input list

Returns
ColorPalette — a list containing completely desaturated colors
dispatchEvent()method 
public function dispatchEvent(event:Event):BooleanParameters
event:Event

Returns
Boolean
diverging()method 
public static function diverging(min:uint = 0xffd73027, mid:uint = 0xffffffbf, max:uint = 0xff1a9850, f:Number = 0.5, size:int, paletteName:String = "diverging"):ColorPalette

Generates a color palette of color ramps diverging from a central value.

Parameters
min:uint (default = 0xffd73027) — the color corresponding to the minimum scale value
 
mid:uint (default = 0xffffffbf) — the color corresponding to the central scale value
 
max:uint (default = 0xff1a9850) — the color corresponding to the maximum scale value
 
f:Number (default = 0.5) — an interpolation fraction specifying the position of the central value
 
size:int — the size of the color palette
 
paletteName:String (default = "diverging")

Returns
ColorPalette — the color palette
extendWithComplements()method 
public function extendWithComplements():ColorPalette

Extend the list by adding complements for all colors

Returns
ColorPalette — a list containing the original colors and complements
flippedCompound()method 
public static function flippedCompound(c:uint):ColorPalette

Roughly the complement and some far analogs.

Parameters
c:uint — a base color

Returns
ColorPalette
fromColor()method 
public static function fromColor(c:uint):ColorPalette

A color array containing a single color

Parameters
c:uint

Returns
ColorPalette
fromFlareColorPalette()method 
public static function fromFlareColorPalette(cp:ColorPalette):ColorPalette

Convert a Flare ColorPalette to a JuiceKit ColorPalette

Parameters
cp:ColorPalette — a flare ColorPalette

Returns
ColorPalette
getCategoricalPaletteByName()method 
public static function getCategoricalPaletteByName(name:String = "spectral", size:int = 64):ColorPalette

Categorical palettes shows categories

Parameters
name:String (default = "spectral")
 
size:int (default = 64)

Returns
ColorPalette
getColorByIndexFromAC()method 
public function getColorByIndexFromAC(idx:int):uintParameters
idx:int

Returns
uint
getDivergingPaletteByName()method 
public static function getDivergingPaletteByName(name:String = "RdGy", size:int = 64):ColorPalette

Diverging palettes go from an negative high intensity through a lower intensit critical midpoint to a positive high intensity

Parameters
name:String (default = "RdGy")
 
size:int (default = 64)

Returns
ColorPalette
getPaletteByName()method 
public static function getPaletteByName(name:String = "", size:int = 64):ColorPaletteParameters
name:String (default = "")
 
size:int (default = 64)

Returns
ColorPalette
getSequentialPaletteByName()method 
public static function getSequentialPaletteByName(name:String = "hot", size:int = 64):ColorPalette

Sequential palettes go from a low intensity to a high intensity

Parameters
name:String (default = "hot")
 
size:int (default = 64)

Returns
ColorPalette
getSequentialReversedPaletteByName()method 
public static function getSequentialReversedPaletteByName(name:String = "binary", size:int = 64):ColorPalette

Sequential reversed palettes go from a high intensity to a low intensity

Parameters
name:String (default = "binary")
 
size:int (default = 64)

Returns
ColorPalette
hasEventListener()method 
public function hasEventListener(type:String):BooleanParameters
type:String

Returns
Boolean
leftComplement()method 
public static function leftComplement(c:uint):ColorPalette

Returns the left half of the split complement. A list is returned with the same darker and softer colors as in the complementary list, but using the hue of the left split complement instead of the complement itself. (per NodeBox documentation)

Parameters
c:uint — a base color

Returns
ColorPalette
lighten()method 
public function lighten(step:Number = 0.1):ColorPalette

(NodeBox) Lighten all the colors in the input list

Parameters
step:Number (default = 0.1) — an optional step value, default=0.1

Returns
ColorPalette — a list containing lightened color values
lightest()method 
public function lightest():uint

Return the lightest color in the array

Returns
uint
monochrome()method 
public static function monochrome(c:uint):ColorPalette

Returns colors in the same hue with varying brightness/saturation.

Parameters
c:uint — a base color

Returns
ColorPalette
Pastel1()method 
public static function Pastel1(size:int):ColorPaletteParameters
size:int

Returns
ColorPalette
Pastel2()method 
public static function Pastel2(size:int):ColorPaletteParameters
size:int

Returns
ColorPalette
ramp()method 
public static function ramp(min:uint = 0xfff1eef6, max:uint = 0xff045a8d, size:int, paletteName:String = "ramp"):ColorPalette

Generates a color palette that "ramps" from one color to another.

Parameters
min:uint (default = 0xfff1eef6) — the color corresponding to the minimum scale value
 
max:uint (default = 0xff045a8d) — the color corresponding to the maximum scale value
 
size:int — the size of the color palette
 
paletteName:String (default = "ramp")

Returns
ColorPalette — the color palette
removeEventListener()method 
public function removeEventListener(type:String, listener:Function, useCapture:Boolean = false):voidParameters
type:String
 
listener:Function
 
useCapture:Boolean (default = false)
reverse()method 
public function reverse():ColorPalette

Reverse the order of colors in the Palette

Returns
ColorPalette
rightComplement()method 
public static function rightComplement(c:uint):ColorPalette

Returns the right half of the split complement. A list is returned with the same darker and softer colors as in the complementary list, but using the hue of the right split complement instead of the complement itself. (per NodeBox documentation)

Parameters
c:uint — a base color

Returns
ColorPalette
saturate()method 
public function saturate(step:Number = 0.1):ColorPalette

(NodeBox) Saturate all the colors in the input list

Parameters
step:Number (default = 0.1) — an optional step value, default=0.1

Returns
ColorPalette — a list containing more saturated color values
splitComplementary()method 
public static function splitComplementary(c:uint):ColorPalette

A palette containing the split complementary colors of a base color

Parameters
c:uint — a base color

Returns
ColorPalette
tetrad()method 
public static function tetrad(c:uint, angle:Number = 0.25):ColorPalette

Returns a tetrad of colors. The tetrad is made up of this color and three other colors that together make up an square on the artistic color wheel.

Parameters
c:uint — a base color
 
angle:Number (default = 0.25) — the angle between the colors beween 0-1 the angle is calculated using the artistic color wheel default=0.25 (90 degrees)

Returns
ColorPalette
toFlareColorPalette()method 
public function toFlareColorPalette():ColorPalette

Convert a JuiceKit ColorPalette to a Flare ColorPalette

Returns
ColorPalette
triad()method 
public static function triad(c:uint, angle:Number = 0.33333):ColorPalette

Returns a triad of colors. The triad is made up of this color and two other colors that together make up an equilateral triangle on the artistic color wheel.

Parameters
c:uint — a base color
 
angle:Number (default = 0.33333) — the angle between the colors beween 0-1 the angle is calculated using the artistic color wheel default=0.33333 (120 degrees)

Returns
ColorPalette
willTrigger()method 
public function willTrigger(type:String):BooleanParameters
type:String

Returns
Boolean
Constant detail
CATEGORY_COLORS_10constant
public static const CATEGORY_COLORS_10:Array

A set of 10 colors for encoding category values.

CATEGORY_COLORS_20constant 
public static const CATEGORY_COLORS_20:Array

A set of 20 colors for encoding category values. Includes the colors of CATEGORY_COLORS_10 plus lighter shades of each.

CATEGORY_COLORS_ALT_19constant 
public static const CATEGORY_COLORS_ALT_19:Array

An alternative set of 19 colors for encoding category values.

DEFAULT_SIZEconstant 
public static const DEFAULT_SIZE:int = 64

Default size of generated color palettes.