here-icons icon indicating copy to clipboard operation
here-icons copied to clipboard

Changeable colour of imported SVG icons in QGIS

Open zirneklitis opened this issue 9 months ago • 4 comments

Thank You for nice collection of mapping icons! It would be nice to make the icons mere configurable – adding possibility to change fill and outline colour. It can be achieved by replacing (RegEx syntax) fill="[^"]+"\/> with fill="param(fill) #FFF" stroke="param(outline) #000" stroke-width="param(outline-width) 1"\/>

Image Original icon. The icon's colour cannot be changed.

Image _All icons are the same colour.

Image It is possible to change fill colour as well as outline width and colour for the modified icons.

Image Icons can be drawn in different colours.

zirneklitis avatar May 10 '25 07:05 zirneklitis

«sed» can be used to reach this goal. Bash script example is attached to this message. “OLDIFS” and “IFS” parameters are used as You have used spaces in file names (“currency-won_outline, Size=24px.svg”, “currency-won_solid, Size=16px.svg”,“currency-won_solid, Size=24px.svg”). As the result, keeping separate outline icon versions are made obsolete.

colourful_qgis_icons.sh.txt

zirneklitis avatar May 12 '25 08:05 zirneklitis

Hi!

I have created a 'perl' script to adopt SVG format images for using as 'QGIS' icons:

https://github.com/zirneklitis/svg2qgis_icon

zirneklitis avatar Jun 13 '25 06:06 zirneklitis

Hey @zirneklitis appreciate your work on the icons and that you like them. the thing with the icons and the flexibility is that we create an outline and a fill version. we then merge and clean them up and export a shape only making sure that the icons look fine even when they are scaled up or down. ... Best M

Mario-Nussbaumer avatar Sep 22 '25 12:09 Mario-Nussbaumer

«sed» can be used to reach this goal. Bash script example is attached to this message. “OLDIFS” and “IFS” parameters are used as You have used spaces in file names (“currency-won_outline, Size=24px.svg”, “currency-won_solid, Size=16px.svg”,“currency-won_solid, Size=24px.svg”). As the result, keeping separate outline icon versions are made obsolete.

colourful_qgis_icons.sh.txt

I fixed the naming a while ago, just fyi.

Mario-Nussbaumer avatar Sep 22 '25 12:09 Mario-Nussbaumer