svg-saturation-filter-matrix

1.0.1 • Public • Published

svg-saturation-filter-matrix

A function that generates saturation filter matrix for svg element feColorMatrix which simulates filter effect of photoshop.

install

import svgSaturationFilterMatrix from "svg-saturation-filter-matrix";

how to use

var saturation = 0; // range from -100 to 100, 0 means no saturation shift
console.log(svgSaturationFilterMatrix(saturation));
// `1 0 0 0 0
// 0 1 0 0 0
// 0 0 1 0 0
// 0 0 0 1 0`

Package Sidebar

Install

npm i svg-saturation-filter-matrix

Weekly Downloads

2

Version

1.0.1

License

MIT

Unpacked Size

3.77 kB

Total Files

5

Last publish

Collaborators

  • raunicorn