I would have loved to add tests, but looks like there are none at this stage and the code does't seem to be easily testable without refactoring, so better left for a separate pull request.
Testing SVG -> PDF BEFORE (missing colors for some elements):
Fixes https://github.com/alafr/SVG-to-PDFKit/issues/187.
Note that I verified the functionality by temporarily moving the
parseColor
function out and running a jest test:I would have loved to add tests, but looks like there are none at this stage and the code does't seem to be easily testable without refactoring, so better left for a separate pull request.
Testing SVG -> PDF BEFORE (missing colors for some elements):
Testing SVG -> PDF AFTER (colors are correct):