Socket
Book a DemoInstallSign in
Socket

node-svg-fill

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

node-svg-fill

NodeJS package to fill (part of) an SVG image in a given colour.

1.0.2
latest
Source
npmnpm
Version published
Weekly downloads
3
-25%
Maintainers
1
Weekly downloads
 
Created
Source

node-svg-fill

https://www.npmjs.com/package/node-svg-fill codecov

NodeJS package to fill (part of) an SVG image in a given colour.

Installation

The package can be installed via your favourite node package manager:

yarn add node-svg-fill

Examples

Example: Fill a circle completely in yellow

Input:

examples/full/input.svg

Code:

const svgFill = require("node-svg-fill");
console.log(svgFill.fill(input, "#FFFF00"));

Output:

examples/full/output.svg

Example: Fill letters in two directions with a gradient

Input:

examples/gradient/input-a.svg examples/gradient/input-m.svg

Code:

const svgFill = require("node-svg-fill");
console.log(svgFill.fillGradient(inputA, [{
    "color": "#FF0000",
    "from": 0,
    "to": 0.20,
}, {
    "color": "#0000FF",
    "from": 0.70,
    "to": 1,
}]));
console.log(svgFill.fillGradient(inputM, [{
    "color": "#FF00FF",
    "from": 0,
    "to": 0.50,
}, {
    "color": "#A0F0F0",
    "from": 0.50,
    "to": 1,
}], 90));

examples/gradient/output-a.svg examples/gradient/output-m.svg

Keywords

colour

FAQs

Package last updated on 22 May 2022

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.