neocotic / convert-svg

Node.js packages for converting SVG into other formats using headless Chromium
MIT License
198 stars 45 forks source link

Add option to control background color #14

Closed neocotic closed 7 years ago

neocotic commented 7 years ago

Currently, the transparent areas of the SVG are output as transparent in the PNG output, however, it would be nice to be able to control this via a background option. When specified, the value will be used as inserted as the value for the background-color CSS property on the boilerplate HTML and the omitBackground puppeteer screenshot option will be disabled. I'm hoping that this will be enough to support this functionality, if not, we should attempt to find another means of doing so.

To clarify; this is only to control the background color used for transparent sections of the SVG and is not intended to be used to override the background color of the SVG itself, for now, at least.

This option should be available via the API and CLI.

neocotic commented 7 years ago

This change has been implemented in 0fa8ded and will be included in the 0.3.0 release.