PaletteRegistry
pentaho.visual.color.PaletteRegistry
A singleton class that manages a set of discrete color palettes available for visuals to consume.
Standard Color Palettes
The registry comes pre-loaded with the following color palettes:
"palette 1"
(13 colors):#336699 #99CCFF #999933 #666699 #CC9933 #006666 #3399FF #993300 #CCCC99 #666666 #FFCC66 #6699CC #663366 "palette 2"
(11 colors):#880A0F #B09A6B #772200 #C52F0D #123D82 #4A0866 #FFAA00 #1E8AD3 #AA6611 #8B2834 #333333 "palette 3"
(12 colors):#387179 #626638 #A8979A #B09A6B #772200 #C52F0D #123D82 #4A0866 #445500 #FFAA00 #1E8AD3 #AA6611 "ryg-3"
(3 colors):#FF0000 #FFFF00 #008000 "ryg-5"
(5 colors):#FF0000 #FFBF3F #FFFF00 #BFDF3F #008000 "ryb-3"
(3 colors):#FF0000 #FFFF00 #4BB6E4 "ryb-5"
(5 colors):#FF0000 #FFBF3F #FFFF00 #DCDDDE #4BB6E4 "blue-3"
(3 colors):#CCDFED #6D85A4 #0F2B5B "blue-5"
(5 colors):#CCDFED #9CB2C8 #6D85A4 #3E587F #0F2B5B "gray-3"
(3 colors):#E6E6E6 #999999 #333333 "gray-5"
(5 colors):#E6E6E6 #CCCCCC #999999 #666666 #333333
AMD Module
require(["{pentaho.visual.color.PaletteRegistry} pentaho/visual/color/paletteRegistry"], function(PaletteRegistry) { /* code goes here */ });
Extends
Constructor
Name | Description |
---|---|
new PaletteRegistry() | Creates the color palette registry singleton instance. |
Members
Name | Description |
---|---|
base : Protected | If a method has been overridden, then the base method provides access to the overridden method. |
Methods
Name | Description |
---|---|
add(palette) : pentaho.visual.color.PaletteRegistry | Adds a specified color palette. |
extend(source, keyArgs) : Object | Extend an object with the properties of another. |
get(name) : pentaho.visual.color.IColorPalette | Gets a specified or default color palette. |
getAll() : Array.< | Gets an array with all registered color palettes. |
setDefault(name) : pentaho.visual.color.PaletteRegistry | Sets the default color palette, given its name. |
Constructor Details
new PaletteRegistry() |
---|
Creates the color palette registry singleton instance. Source: javascript/web/pentaho/visual/color/paletteRegistry.js, line 25 |
Members Details
base: Protected |
---|
If a method has been overridden, then the base method provides access to the overridden method. Can also be called from within a constructor function. Source: javascript/web/pentaho/lang/Base.js, line 265 Inherited From: pentaho.lang.Base#base |
Methods Details
add(palette) : pentaho.visual.color.PaletteRegistry | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|
Adds a specified color palette. Source: javascript/web/pentaho/visual/color/paletteRegistry.js, line 181
|
extend(source, keyArgs) : Object | |||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Extend an object with the properties of another. Methods that are overridden are accessible through This object is extended, but its class doesn't change. Can be applied to non- Source: javascript/web/pentaho/lang/Base.js, line 808 Inherited From: pentaho.lang.Base#extend
|
get(name) : pentaho.visual.color.IColorPalette | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|
Gets a specified or default color palette. When the name of the color palette is not specified, the default color palette is returned. Source: javascript/web/pentaho/visual/color/paletteRegistry.js, line 247
|
getAll() : Array.< | ||||
---|---|---|---|---|
Gets an array with all registered color palettes. Do not modify the returned array. Source: javascript/web/pentaho/visual/color/paletteRegistry.js, line 203
|
setDefault(name) : pentaho.visual.color.PaletteRegistry | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|
Sets the default color palette, given its name. If this method is not called, or if the name argument is not specified, the default palette becomes the first palette. The default palette is obtained by calling Source: javascript/web/pentaho/visual/color/paletteRegistry.js, line 228
Example Obtaining the default color palette. var defaultPalette = paletteRegistry.get(); |