I have a range of SVG icons as file that I would like to use in various nodes within a go.Picture element. I also want the colors of these SVG to be able to change dynamically.
I found a solution to changing colors here: css - How to change the color of an svg element? - Stack Overflow, which involves wrapping the svg in an image and applying a css filter (filter - CSS: Cascading Style Sheets | MDN (mozilla.org)) element.
When I try to set this style inline, (i.e. create html image element ‘elem’, then set elem.style.filter = ‘…’ or elem.setAttribute(‘style’ …)) it does not work. When I log the ‘elem’, it appears to have removed the filter style altogether, but this does not occur for other inline styles. This method also works perfectly fine with the same svg icons but outside of the the go.Picture element.
I can only guess that there is some css sanitization going on in the background. Is there any way I can get around this?