Module: ol/color

ol/color


import * as olColor from 'ol/color';

Functions

asArray(color){Color}

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 Color | string

Color.

Returns:
Color.

asString(color){string}

import {asString} from 'ol/color';

Return the color as an rgba string.

Name Type Description
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.