Class: AssetColor

AssetColor()

An AssetColor Model represents one color in a color scale that maps to attributes of a Map Asset. For vector assets (e.g. Cesium3DTileset models), the color is used to conditionally color vector data in a map (or plot).

Constructor

new AssetColor()

Since:
  • 2.18.0
Source:

Extends

  • Backbone.Model

Members

defaults :object

Default attributes for AssetColor models
Type:
  • object
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:
  • string
Source:

Methods

getCss() → {string}

Since:
  • 2.30.0
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:
  • 2.25.0
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:
  • object
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: