I'm building an editor where users can select an SVG from our CDN, and select its fill color. On the front-end I want to be able to render these SVG's in the color that's picked by the user, but this doesn't seem to be possible. Does anybody know any approaches I should try?
The data I get from the server is the following:
cdnURL: the URL from which the SVG should be loaded
fillColor: text corresponding to SCSS variables in our frontend. I have made utility classes for all colors to implement the fill-property:
color__fill--black { fill: black; }
I have come across answers on this site that suggest changing the fill-property of the SVG-file, but this is not possible because I only have its source-URL on the CDN. I have also seen people suggest using CSS filters, but this does not solve my issue as the colors vary a lot, from black to blue to yellow to white.