Graphics::getColour()

Can this be a thing one day?

I’ve got a utility method that sometimes needs to draw icons using SVGs using ReplaceColour and it’d be a smoother integration if it was possible to get the current colour as set with Graphics::setColour(…)

I avoided that because of all the ambiguity around what the current colour actually is… e.g. if you set a gradient or image fill, or just change the alpha, what would it return? Best to sidestep the issue, I think!

If there was a special value for the Colour in the SVG, like auto, so it would just skip setColour and keep painting in the current colour.
Would help for monochrome drawables (the majority in my case)…

But I am not familiar with SVG and if specifying a colour there is mandatory…

2 Likes