DenverCoder1/custom-icon-badges

Support for logo color on svgs

DenverCoder1 opened this issue · 0 comments

It should be possible to support the logo_color parameter by replacing all fill styles with the given color and adding fill styles to <path> tags where they are missing.

Ex.

Original (no fill):

<svg><path fill-rule="evenodd" d="M1.75 2A1.75 1.75 0 000..."></path></svg>

Original (wrong fill):

<svg><path fill-rule="evenodd" d="M1.75 2A1.75 1.75 0 000..." style="fill: red;"></path></svg>

Expected result (colored #fff):

<svg><path fill-rule="evenodd" d="M1.75 2A1.75 1.75 0 000..." style="fill: #fff;"></path></svg>

Another solution

Could add <style>* { fill: #00f !important; }</style> after the opening <svg> tag.

E.g.

<svg><style>* { fill: #00f !important; }</style><path fill-rule="evenodd" d="M11.536 3.464a5 5..."></path></svg>