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 AssetColor#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

hexToRGB(hex) → {Color}

Converts hex color values to RGB values between 0 and 1
Parameters:
Name Type Description
hex string a color in hexadecimal format
Source:
Returns:
a color in RGB format
Type
Color

initialize(colorConfigopt)

Executed when a new AssetColor model is created.
Parameters:
Name Type Attributes Description
colorConfig MapConfig#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.
Source: