| Package | flare.util.palette |
| Class | public class ColorPalette |
| Inheritance | ColorPalette Palette |
| Property | Defined by | ||
|---|---|---|---|
| keyframes : Array [read-only] Keyframes at which color values change in the palette.
| ColorPalette | ||
![]() | size : int The number of values in the palette.
| Palette | |
![]() | values : Array Array of palette values.
| Palette | |
| Method | Defined by | ||
|---|---|---|---|
|
ColorPalette(colors:Array = null, keyframes:Array = null)
Creates a new ColorPalette.
| ColorPalette | ||
|
category(size:int = 20, colors:Array = null, alpha:Number = 1.0):ColorPalette
[static]
Generates a categorical color palette
| ColorPalette | ||
|
cool(size:int):ColorPalette
[static]
Generates a color palette that uses a "cool", blue-heavy color scheme.
| ColorPalette | ||
|
diverging(min:uint = 0xffd73027, mid:uint = 0xffffffbf, max:uint = 0xff1a9850, f:Number = 0.5, size:int):ColorPalette
[static]
Generates a color palette of color ramps diverging from a central
value.
| ColorPalette | ||
|
getColor(v:Number):uint
Retrieves the color corresponding to input interpolation fraction.
| ColorPalette | ||
|
getColorByIndex(idx:int):uint
Retrieves the color corresponding to the input array index.
| ColorPalette | ||
![]() |
getValue(f:Number):Object
Retrieves the palette value corresponding to the input interpolation
fraction.
| Palette | |
|
hot(size:int):ColorPalette
[static]
Generates a color palette that moves from black to red to yellow
to white.
| ColorPalette | ||
|
ramp(min:uint = 0xfff1eef6, max:uint = 0xff045a8d, size:int):ColorPalette
[static]
Generates a color palette that "ramps" from one color to another.
| ColorPalette | ||
| Constant | Defined 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 | ||
| keyframes | property |
keyframes:Array [read-only]Keyframes at which color values change in the palette. Useful for configuring gradient paint fills.
Implementation public function get keyframes():Array
| ColorPalette | () | constructor |
public function ColorPalette(colors:Array = null, keyframes:Array = null)Creates a new ColorPalette.
Parameterscolors:Array (default = null) — an array of colors defining the palette
|
|
keyframes:Array (default = null) — array of keyframes of color interpolations
|
| category | () | method |
public static function category(size:int = 20, colors:Array = null, alpha:Number = 1.0):ColorPaletteGenerates a categorical color palette
Parameterssize: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
|
ColorPalette —
the categorical color palette
|
| cool | () | method |
public static function cool(size:int):ColorPaletteGenerates a color palette that uses a "cool", blue-heavy color scheme.
Parameterssize:int — the size of the color palette
|
ColorPalette —
the color palette
|
| diverging | () | method |
public static function diverging(min:uint = 0xffd73027, mid:uint = 0xffffffbf, max:uint = 0xff1a9850, f:Number = 0.5, size:int):ColorPaletteGenerates a color palette of color ramps diverging from a central value.
Parametersmin: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
|
ColorPalette —
the color palette
|
| getColor | () | method |
public function getColor(v:Number):uintRetrieves the color corresponding to input interpolation fraction.
Parametersv:Number — an interpolation fraction
|
uint — the color corresponding to the input fraction
|
| getColorByIndex | () | method |
public function getColorByIndex(idx:int):uintRetrieves the color corresponding to the input array index.
Parametersidx:int — an integer index. The actual index value used is
the modulo of the input index by the length of the palette.
|
uint — the color in the palette at the given index
|
| hot | () | method |
public static function hot(size:int):ColorPaletteGenerates a color palette that moves from black to red to yellow to white.
Parameterssize:int — the size of the color palette
|
ColorPalette —
the color palette
|
| ramp | () | method |
public static function ramp(min:uint = 0xfff1eef6, max:uint = 0xff045a8d, size:int):ColorPaletteGenerates a color palette that "ramps" from one color to another.
Parametersmin: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
|
ColorPalette —
the color palette
|
| CATEGORY_COLORS_10 | constant |
public static const CATEGORY_COLORS_10:ArrayA set of 10 colors for encoding category values.
| CATEGORY_COLORS_20 | constant |
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_19 | constant |
public static const CATEGORY_COLORS_ALT_19:ArrayAn alternative set of 19 colors for encoding category values.
| DEFAULT_SIZE | constant |
public static const DEFAULT_SIZE:int = 64Default size of generated color palettes.