node-rsvg icon indicating copy to clipboard operation
node-rsvg copied to clipboard

Add support for backgroundColor option

Open caleb531 opened this issue 7 years ago • 0 comments

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

caleb531 avatar May 08 '17 19:05 caleb531