[SOLVED] svg color with css, it is possibile?

Answered
0
0

Hi,

it is possibile to change color of a svg with css?

for example I have a label, with a svg from “elegant icon” dll and I would like to change color:

<div><img src="resource.wx/Wisej.Ext.ElegantIcons/edition-pencil.svg" width="12" height="12" 
    style="vertical-align:middle;-webkit-transform: scaleX(-1);transform: scaleX(-1);fill: blue;">
    <span style="padding-right:5px">Modifica</span>
</div>

I have try olso

resource.wx/Wisej.Ext.ElegantIcons/edition-pencil.svg?color=blue

I do not know if I’m doing something wrong, otherwise there’s no problem it’s a small thing

regards

Cristian

  • You must to post comments
Best Answer
0
0

It depends on how the svg is created. Most svgs already specify the fill color. Wisej preloads the svg as an xml object and caches it in memory then detects if it’s a monochrome sgv by comparing the colors, and when the source name has ?color= Wisej actually changes the xml of the svg to change the color and caches the new colored version.

 

  • Cristian Zerbinati
    Thanks Luca :-)
  • edmond girardi
    Luca – does this mean it “Replaces” the original svg – or does it just Cache the new one along with the original ?
  • You must to post comments
Showing 1 result
Your Answer

Please first to submit.