domenic / svg2png

Converts SVGs to PNGs, using PhantomJS
Other
585 stars 134 forks source link

Adds option for SVG `fill` attribute #122

Open ahoran3 opened 3 years ago

ahoran3 commented 3 years ago

Adds ability to set the fill color of your output png with a new fill option.

Usage for red output shape:

svg2png(sourceBuffer, { width: 300, height: 400, fill: '#ff0000' })
    .then(buffer => ...)
    .catch(e => console.error(e));

Includes updated documentation

ahoran3 commented 3 years ago

Hi @domenic! Thanks for the great library. I've added a small change to allow the user to also set the fill color. This is a missing piece I needed as I'm converting svg shapes to a client's primary color before saving images to use in their email correspondence templates.

If there's anything you need from me to help get this released, just @ahoran3 me!

Cheers!