feColorMatrix element | SVGFEColorMatrixElement object

This filter applies a matrix transformation.

Scalable Vector Graphics: Filter Effects, Section 15.25.4

Syntax


<feColorMatrix type="matrix" values="1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 1 0"/>
<feColorMatrix type="hueRotate" in="SourceGraphic" values="90"/>
<feColorMatrix type="luminanceToAlpha" in="SourceGraphic" result="a"/>


DOM Information

Inheritance Hierarchy

 Node
  Element
   SVGElement
     SVGFEColorMatrixElement

Members

The SVGFEColorMatrixElement object has these types of members:

Properties

The SVGFEColorMatrixElement object has these properties.

PropertyAccess typeDescription

height

Gets or sets the height of an element.

in1

Read-only

Identifies input for the given filter primitive.

result

Read-only

Provides a reference for the output result of a filter.

type

Read-only

Indicates the type of matrix operation.

values

Read-only

Numeric values for the feColorMatrix transformation matrix.

width

Defines the width of an element.

x

Gets or sets the x-coordinate value.

y

Gets or sets the y-coordinate value.

 

Standards information

Remarks

This filter applies the following matrix transformation:

| R' |     | a00 a01 a02 a03 a04 |   | R |
| G' |     | a10 a11 a12 a13 a14 |   | G |
| B' |  =  | a20 a21 a22 a23 a24 | * | B |
| A' |     | a30 a31 a32 a33 a34 |   | A |
| 1  |     |  0   0   0   0   1  |   | 1 |

This matrix is applied on the RGBA color and alpha values of every pixel on the input graphics to produce a result with a new set of RGBA color and alpha values.

The calculations are performed on non-premultiplied color values. If the input graphics consist of premultiplied color values, those values are automatically converted into non-premultiplied color values for this operation.

The type attributed is used to indicate the type of matrix operation. The keyword matrix indicates that a full 5x4 matrix of values will be provided. The other keywords (see values) represent convenience shortcuts to allow commonly used color operations to be performed without specifying a complete matrix. If the attribute type is not specified, the effect is as if a value of matrix were specified.

 

 

Show:
© 2014 Microsoft. All rights reserved.