Namespace: color

vef.ui.color

A super module that collects available sub-modules.
Source:

Classes

ColorScaleDropdown
ColorScalePicker
ColorSlider
ColorizedImage

Members

(static, constant) CMOCEAN

Collection of color scales for the layer styling
Author:
Source:

Methods

(static) exports.colorScaleToWmsParams(scale, noValue) → {object}

Get the WMS query parameters for the the O2A color template styles from the given color scale
Parameters:
Name Type Description
scale Array.<object> color scale array
noValue object
Author:
Source:
Returns:
{env, styles}
Type
object

(static) exports.copyColorItem(item) → {object}

Copy a color item to remove original pointers to instances
Parameters:
Name Type Description
item object color item
Author:
Source:
Returns:
copied color item
Type
object

(static) exports.copyColorScale(scale) → {Array.<object>}

Copy a color scale to remove original pointers to instances
Parameters:
Name Type Description
scale Array.<object> color scale
Author:
Source:
Returns:
copied color scale
Type
Array.<object>

(static) exports.generateCssGradient(scale, min, max)

Generate a CSS-gradient based on the given color scale
Parameters:
Name Type Description
scale Array.<object>
min number custom minimum value (optional)
max number custom maximum value (optional)
Author:
Source:

(static) exports.getColorFromScale(scale, value, format)

Get the matching color from a given scale for a value with linear interpolation
Parameters:
Name Type Description
scale Array.<object>
value number
format string "hexstring", "rgb", (default "hexstring")
Author:
Source:

(static) exports.invertColorScale(scale)

Invert the color scale value order
Parameters:
Name Type Description
scale Array.<object> color scale array
Author:
Source:

(static) exports.isHexColor(color) → {boolean}

Checks if a given string is a six digit hexadecimal color code
Parameters:
Name Type Description
color string hex color code
Author:
Source:
Returns:
true if color is valid
Type
boolean

(static) exports.stretchColorScale(scale, min, max)

Stretch the color scale values linear with equal distance
Parameters:
Name Type Description
scale Array.<object> color scale array
min number
max number
Author:
Source:

(static) exports.validateColorItem(item) → {object}

Validates a color item and throws error if it has invalid properties. exampleItem = { "color": "#000000", "value": 1 "opacity": 1 }
Parameters:
Name Type Description
item object color item
Author:
Source:
Returns:
valid color item
Type
object

(static) exports.validateColorScale(colorScale) → {Array.<object>}

Validates a color scale and throws error if it has invalid items.
Parameters:
Name Type Description
colorScale Array.<object> color scale
Author:
Source:
Returns:
valid color scale
Type
Array.<object>

(static) exports.wmsParamsToColorScale() → {object}

Set the color scale based on the existing WMS query string parameters of the O2A template styles.
Author:
Source:
Returns:
color scale
Type
object