Class: ColorMatrix

fabric.Image.filters.ColorMatrix

new ColorMatrix()

Color Matrix filter class
Source:
See:
Example

Kodachrome filter

var filter = new fabric.Image.filters.ColorMatrix({
 matrix: [
       1.1285582396593525, -0.3967382283601348, -0.03992559172921793, 0, 63.72958762196502,
       -0.16404339962244616, 1.0835251566291304, -0.05498805115633132, 0, 24.732407896706203,
       -0.16786010706155763, -0.5603416277695248, 1.6014850761964943, 0, 35.62982807460946,
       0, 0, 0, 1, 0
      ]
});
object.filters.push(filter);
object.applyFilters(canvas.renderAll.bind(canvas));

Extends

Members

type

Filter type
Overrides:
Default Value:
  • ColorMatrix
Source:

Methods

applyTo(canvasEl)

Applies filter to canvas element
Parameters:
Name Type Description
canvasEl Object Canvas element to apply filter to
Source:

initialize(optionsopt)

Constructor
Parameters:
Name Type Attributes Description
options Object <optional>
Options object
Properties
Name Type Attributes Description
matrix Array <optional>
Color Matrix to modify the image data with
Overrides:
Source:

setOptions(optionsopt)

Sets filter's properties from options
Parameters:
Name Type Attributes Description
options Object <optional>
Options object
Inherited From:
Source:

toJSON() → {Object}

Returns a JSON representation of an instance
Inherited From:
Source:
Returns:
JSON
Type
Object

toObject() → {Object}

Returns object representation of an instance
Overrides:
Source:
Returns:
Object representation of an instance
Type
Object