node-rsvg
node-rsvg copied to clipboard
Add support for backgroundColor option
Hi @2gis,
librsvg (via rsvg-convert
has support for a --background-color
option. It would be nice if this package supported this property as a parameter to svg.render()
:
let svg = new Rsvg();
svg.on('finish', () => {
fs.writeFileSync('icon.png', svg.render({
format: 'png',
width: 256,
height: 256,
backgroundColor: 'white'
}).data);
next();
});
fs.createReadStream('icon.svg').pipe(svg);
Thanks, Caleb