Module: ol/color

ol/color


import * as olColor from 'ol/color';

Methods

module:ol/color.asArray(color){module:ol/color~Color}

color.js, line 132
import {asArray} from 'ol/color';

Return the color as an array. This function maintains a cache of calculated arrays which means the result should not be modified.

Name Type Description
color module:ol/color~Color | string

Color.

Returns:
Color.

module:ol/color.asString(color){string}

color.js, line 42
import {asString} from 'ol/color';

Return the color as an rgba string.

Name Type Description
color module:ol/color~Color | string

Color.

Returns:
Rgba string.

Type Definitions

Color{Array.<number>}

A color represented as a short array [red, green, blue, alpha]. red, green, and blue should be integers in the range 0..255 inclusive. alpha should be a float in the range 0..1 inclusive. If no alpha value is given then 1 will be used.