Class: ColorMapFilter

PIXI.filters.ColorMapFilter

The ColorMapFilter applies a color-map effect to an object.
originalfilter

new PIXI.filters.ColorMapFilter (colorMap, nearest, mix)

Name Type Attributes Default Description
colorMap HTMLImageElement | HTMLCanvasElement | PIXI.BaseTexture | PIXI.Texture <optional>

The colorMap texture of the filter.

nearest boolean <optional>
false

Whether use NEAREST for colorMap texture.

mix number <optional>
1

The mix from 0 to 1, where 0 is the original image and 1 is the color mapped image.

See:

Extends

  • PIXI.Filter

Members

colorMap PIXI.Texture

the colorMap texture

colorSize number readonly

the size of one color slice

mix number

The mix from 0 to 1, where 0 is the original image and 1 is the color mapped image.

Default Value:
  • 1

nearest boolean

Whether use NEAREST for colorMap texture.

Methods

destroy (destroyBase) void

Destroys this filter

Name Type Attributes Default Description
destroyBase boolean <optional>
false

Whether to destroy the base texture of colorMap as well

updateColorMap () void

If the colorMap is based on canvas , and the content of canvas has changed, then call updateColorMap for update texture.