The problem I had was that the specific icon I was working on didn't have the words "style" or "Fill""fill" anywhere so I had trouble figuring out where to put the parameter line. The Inkscape trick described by Martina solved this problem but I have a bunch of them to do and I didn't want to open and save each in Inkscape so I decided to attempt trial and error. Looking at the code I could see that the version info and metadata was at the top and the shape instructions were at the bottom enclosed in quotation marks that were bounded at the beginning by <g><path d=
(some have <g><g><path d=
) and at the end by /></g></g></svg>
. After a little experimenting I figured out that putting the parameter line between path
and d=
worked but the icon was invisible in the selector pane and the icon in the preview pane at the top was entirely filled in black. The invisible icon issue seems to have been a bug. I fixed it by adding an opacity parameter that I will describe below. It turned out that the black fill was just because the icon was only 4mm and it was filled by just the outline. To fix this I bumped the icon size up to 10mm (in QGIS) and bumped the outline down to 0.1 (in Notepad).
If your icon doesn't have the words "style" or "fill" anywhere, but it does have this line <g><path d=
(or <g><g><path d=
right) right before the shape instructions you should be able to add the edit parameters by replacing the above line with <g><g><path<g><path fill="param(fill) #FFF" stroke="param(outline) #000" stroke-width="param(outline-width) 1" d=
If the border is too thick, you can shrink it by changing the last number to a fraction e.g. <g><g><path<g><path fill="param(fill) #FFF" stroke="param(outline) #000" stroke-width="param(outline-width) 0.5" d=
If you wish to make your icon semitransparent you can do so by changing the above line to this one <g><g><path<g><path style="opacity:0.5;fill:param(fill) #000"#FFF" stroke="param(outline) #000" stroke-width="param(outline-width) 1" d=
. The opacity value can be from 1 (fully opaque) to 0 (fully transparent) and you can use hundredths or even thousandths for additional precision (e.g. 0.01). The same rule goes for border thickness.
If your QGIS icon disappears you can easily still work with it. The above opacity edit might fix it but if not, it should be back after restarting QGIS.
If you have a lot of them to edit, you can find batch files here on StackExchange to automate the search and replace process.