Class: Fill

ol/style/Fill~Fill


import Fill from 'ol/style/Fill';

Set fill style for vector features.

new Fill(options)

Name Type Description
color Color | ColorLike | null (defaults to null)

A color, gradient or pattern. See Color and ColorLike for possible formats. Default null; if null, the Canvas/renderer default black will be used.

Methods

Clones the style. The color is not cloned if it is an ColorLike.

Returns:
The cloned style.

getColor(){Color | ColorLike | null}

Get the fill color.

Returns:
Color.

setColor(color)

Set the color.

Name Type Description
color Color | ColorLike | null

Color.