An object that represents a palette of colors.
A Palette is a representation of a set of colors. While the standard number of colors contained in a palette is 5, it can really handle any number of colors.
A palette is useful for the ability to transform all the colors in it using a simple object-based approach. In addition, you can generate palettes using dojox.color.Palette.generate; these generated palettes are based on the palette generators at http://kuler.adobe.com.
Parameter | Type | Description |
---|---|---|
base | String | Array | dojox.color.Color | dojox.color.Palette |
See the dojox/color/Palette reference documentation for more information.
Generate a new Palette using any of the named functions in dojox.color.Palette.generators or an optional function definition. Current generators include "analogous", "monochromatic", "triadic", "complementary", "splitComplementary", and "shades".
Parameter | Type | Description |
---|---|---|
base | String | dojox.color.Color | |
type | Function | String |
Transform the palette using a specific transformation function and a set of transformation parameters.
{palette}.transform is a simple way to uniformly transform all of the colors in a palette using any of 5 formulae: RGBA, HSL, HSV, CMYK or CMY.
Once the forumula to be used is determined, you can pass any number of parameters based on the formula "d"[param]; for instance, { use: "rgba", dr: 20, dg: -50 } will take all of the colors in palette, add 20 to the R value and subtract 50 from the G value.
Unlike other types of transformations, transform does not alter the original palette but will instead return a new one.
Parameter | Type | Description |
---|---|---|
kwArgs | Object | An object with the following properties:
|