Coffeekraken.io 0.0.1

SGradientSvgFilter

Extends SSvgFilter

This SVG filter class apply either a linear or a radial gradient of your choice on an HTMLElement. This is useful cause the gradient will only be applied on part of the elements that is really visible and will respect the opacity of each parts

Example

    const filter = new SGradientSvgFilter();
filter.linear(['red','blue','green']);
filter.applyTo(myCoolHTMLElement);

Author : Olivier Bossel olivier.bossel@gmail.com

Constructor

Methods

linear

Linear gradient

Name Type Description Status Default
colors { Array } An array of colors for your gradient required
settings { Object } The settings of your gradient required

radial

Linear gradient

Name Type Description Status Default
colors { Array } An array of colors for your gradient required
settings { Object } The settings of your gradient required

applyTo

Apply the filter to element

Name Type Description Status Default
elm { HTMLElement } The element on which to apply the filter required

unapplyFrom

Remove the filter from element

Name Type Description Status Default
elm { HTMLElement } The element to unapply the filter from required