Constructor
new AssetColor()
- Since:
- Source:
Extends
Members
defaults :object
Default attributes for AssetColor models
Type:
Properties:
Name |
Type |
Attributes |
Description |
value |
string
|
number
|
|
The value of the attribute that corresponds to
this color. If set to null, then this color will be the default color. |
label |
string
|
<optional>
|
A user-facing name for this attribute value,
to show in map legends, etc. If not set, then the value will be displayed
instead. |
color |
Color
|
|
The red, green, and blue intensities that define the
color |
- Source:
type :string
The name of this type of model
Type:
- Source:
Methods
getCss() → {string}
- Since:
- Source:
Returns:
A string in the format of a css color value.
-
Type
-
string
hexToRGBA(hex) → {Color}
Converts an 6 to 8 digit hex color value to RGBA values between 0 and 1
Parameters:
Name |
Type |
Description |
hex |
string
|
A hex color code, e.g. '#44A96A' or '#44A96A88' |
- Since:
- Source:
Returns:
- The RGBA values of the color
-
Type
-
Color
initialize(colorConfigopt)
Executed when a new AssetColor model is created.
Parameters:
Name |
Type |
Attributes |
Description |
colorConfig |
ColorConfig
|
<optional>
|
The initial values of the
attributes, which will be set on the model. |
- Source:
Type Definitions
Color
An object that defines the properties of a color
Type:
Properties:
Name |
Type |
Attributes |
Default |
Description |
red |
number
|
<optional>
|
1
|
A number between 0 and 1 indicating the intensity of red
in this color. |
blue |
number
|
<optional>
|
1
|
A number between 0 and 1 indicating the intensity of
red in this color. |
green |
number
|
<optional>
|
1
|
A number between 0 and 1 indicating the intensity of
red in this color. |
alpha |
number
|
<optional>
|
1
|
A number between 0 and 1 indicating the opacity of
this color. |
- Source: