Skip to content
This repository has been archived by the owner on Sep 9, 2019. It is now read-only.

Add support for backgroundColor option #12

Open
caleb531 opened this issue May 8, 2017 · 0 comments
Open

Add support for backgroundColor option #12

caleb531 opened this issue May 8, 2017 · 0 comments

Comments

@caleb531
Copy link

caleb531 commented May 8, 2017

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

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant