Object associated with each cell in a ColorPalette palette. Implements dijit/Dye.
Parameter | Type | Description |
---|---|---|
alias | String | English name of the color. |
row | Number | Vertical position in grid. |
col | undefined | |
title | String | Localized name of the color. |
This is stores the path to the palette images used for high-contrast mode display
Parameter | Type | Description |
---|---|---|
r | undefined | |
g | undefined | |
b | undefined | |
a | undefined |
Parameter | Type | Description |
---|---|---|
cell | DOMNode | |
blankGif | String |
Note that although dijit._Color is initialized with a value like "white" getValue() always returns a hex value
Takes a named string, hex string, array of rgb or rgba values,
an object with r, g, b, and a properties, or another Color
object
and sets this color instance to that value.
Parameter | Type | Description |
---|---|---|
color | Array | String | Object |
Takes a named string, hex string, array of rgb or rgba values,
an object with r, g, b, and a properties, or another Color
object
and sets this color instance to that value.
require(["dojo/_base/color"], function(Color){ var c = new Color(); // no color c.setColor("#ededed"); // greyish });
Returns a css color string in rgb(a) representation
Parameter | Type | Description |
---|---|---|
includeAlpha | Boolean |
Optional
|
require(["dojo/_base/color"], function(Color){ var c = new Color("#FFF").toCss(); console.log(c); // rgb('255','255','255') });
Returns a CSS color string in hexadecimal representation
require(["dojo/_base/color"], function(Color){ console.log(new Color([0,0,0]).toHex()); // #000000 });
Returns 3 component array of rgb values
require(["dojo/_base/color"], function(Color){ var c = new Color("#000000"); console.log(c.toRgb()); // [0,0,0] });
Returns a 4 component array of rgba values from the color represented by this object.