Recoloring SVG imported into JUCE


I’ve been doing a BFS of the Drawable component created when an SVG (without color) is imported into Juce and using setFillType to set the brush used to draw the SVG. Is there a more elegant way to do this, or should I just build this as an internal utility function?

EDIT: Ideally, I would have the ability to alter the brush used when displaying the SVG/Drawable rather than it being a property of the structure. Is this at all feasible?

The SVGs I’m importing do not typically have any color defined, but in the future I might want to color only the uncolored elements.


I’ve never heard the acronym “BFS” before, so not really sure what you’re trying to do. According to google, it might stand for “Bowling For Soup”, but that’s probably not what you meant.

Loading the SVG and then tinkering with the Drawables to change their settings is the only way I can think of to do this, so it sounds like you’re doing it right.


Alright, I’ll keep doing it that way then.

BFS => Breadth-First Search


Ah… breadth-first-search… I should have thought of that!


Can the code for this be posted? I'd like to do similarly, as the raphaeljs svg's all come in black.


Here is an example of doing it by replacing hex colours from SVG XmlElements. Using icons from this zip file. (icons source)