SVG <feColorMatrix> Filter
You are Here:
Whis is <feColorMatrix> Filter?
The <feColorMatrix>
SVG filter element changes colors based on a transformation matrix.
Example
HTML Online Editor
<!DOCTYPE html>
<html lang="en-US">
<head>
<style>
svg rect{
stroke:red;
stroke-width:3;
fill:#339933;
}
</style>
</head>
<body>
<svg height="130" width="130">
<defs>
<filter id="point" x="0" y="0" width="200%" height="200%">
<feOffset result="offOut" in="SourceGraphic" dx="20" dy="20" />
<feColorMatrix result="matrixOut" in="offOut" type="saturate" values="1"/>
<feGaussianBlur result="blurOut" in="matrixOut" stdDeviation="10" />
<feBlend in="SourceGraphic" in2="blurOut" mode="normal" />
</filter>
</defs>
<rect width="80" height="80" filter="url(#point)" />
</svg>
</body>
</html>
Attributes Value
Attribute | Explanation |
---|---|
in | Specifies the input for the given filter primitive. |
type | Specifies the type of matrix operation. The following are the list of possible value
|
values | The values attribute is a semicolon-separated list of one or more values. The values attribute in feColorMatrix are always depends upon the type attribute value used. The following are the list of possible values depends upon type attributes value
|
Reminder
Hi Developers, we almost covered 91% of SVG Tutorials with examples for quick and easy learning.
We are working to cover every Single Concept in SVG.
Please do google search for:
Join Our Channel
Join our telegram channel to get an instant update on depreciation and new features on HTML, CSS, JavaScript, jQuery, Node.js, PHP and Python.
This channel is primarily useful for Full Stack Web Developer.