feColorMatrix element | SVGFEColorMatrixElement object
This filter applies a matrix transformation.
![]() ![]() |
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
Members
The SVGFEColorMatrixElement object has these types of members:
Properties
The SVGFEColorMatrixElement object has these properties.
| Property | Access type | Description |
|---|---|---|
|
Gets or sets the height of an element. | ||
| Read-only |
Identifies input for the given filter primitive. | |
| Read-only |
Provides a reference for the output result of a filter. | |
| Read-only |
Indicates the type of matrix operation. | |
| Read-only |
Numeric values for the feColorMatrix transformation matrix. | |
|
Defines the width of an element. | ||
|
Gets or sets the x-coordinate value. | ||
|
Gets or sets the y-coordinate value. |
Standards information
- Scalable Vector Graphics: Filter Effects, Section 15.25.4
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.
See also

