1

Why can I color some SVG symbols, but not others?

At symbol # 1 I can change the color, but not the others.

In the XnView viewer, the symbols are shown differently.

enter image description here

What qualifies an SVG symbol to change the color?

Even editing it in Adobe Illustrator, I do not understand what's happening!

nmtoken
  • 13,355
  • 5
  • 38
  • 87
Carlos Pires
  • 1,135
  • 10
  • 24

1 Answers1

6

It come from how is made the SVG, if you open a svg file in a text editor (svg are juste text file) you will see that the one with modifiable color have a part with like this : fill="param(fill) #FFF" stroke="param(outline) #000", those with fixed color lack the "param" and have hardcoded color.

You could check this answers to get a better explanation than mine and learn how to edit the svg file for modifiable color

How to create svg symbols that have modifiable fill color, stroke color and stroke width?

J.R
  • 16,090
  • 1
  • 19
  • 52
  • Thank you for helping to find the way. After searching for some time, I found the following: in Illustrator I opened an SVG file that works on QGIS and pasted the contents of one I need, in this case a heart symbol. I saved with the new name (heart) and edited the SVG file in Notepad ++. Just had this part "<path <=> M15.91,8.84c-1 ..." . Replaces only "<path" with this "<path fill="param(fill)" fill-opacity="param(fill-opacity)" stroke="param(outline)" stroke-opacity="param(outline-opacity)" stroke-width="param(outline-width)" In QGIS I was able to change the color. Great. – Carlos Pires Jan 19 '18 at 20:32