Filter

A class representing a filter.

Constructor

new Filter()

A class representing a filter.

Members

(protected, static, readonly) TYPE :string

Type:
  • string
Properties
NameTypeDescription
NONEstring

No filter.

GRAYSCALEstring

Grayscale filter.

SEPIAstring

Sepia filter.

INVERTstring

Invert filter.

BRIGHTNESSstring

Brightness filter.

CONTRASTstring

Contrast filter.

BLURstring

Blur filter.

HUE_ROTATEstring

Hue rotate filter.

SATURATEstring

Saturate filter.

OPACITYstring

Opacity filter.

DROP_SHADOWstring

Drop shadow filter.

NONEstring
GRAYSCALEstring
SEPIAstring
INVERTstring
BRIGHTNESSstring
CONTRASTstring
BLURstring
HUE_ROTATEstring
SATURATEstring
OPACITYstring
DROP_SHADOWstring

Methods

Add(type, …values)

Add a new filter to the list.

Parameters:
NameTypeAttributesDescription
typestring

The type of the filter.

valuesnumber<repeatable>

Filter values.

Remove(type, …values)

Remove a filter from the list.

Parameters:
NameTypeAttributesDescription
typestring

The type of the filter.

valuesnumber<repeatable>

Filter values.

toString(ctx)

Apply the filters to a canvas context.

Parameters:
NameTypeDescription
ctxCanvasRenderingContext2D

The canvas rendering context.