DrawableButton ignoring setColour

I have a DrawableButton with an SVG image and that is working. My issue is that the button is white. The SVG has no background color defined and displays with no issues when rendering in other components.

I have tried using setColour as follows:

	dbutton->setColour(DrawableButton::ColourIds::backgroundOnColourId, Colours::green);
	dbutton->setColour(DrawableButton::ColourIds::backgroundColourId, Colours::blue);

And the button is ignoring the setColor. Any tips? And thank you!

To use another colour you need to call replaceColour() on the Drawable.

bool Drawable::replaceColour(Colour originalColour, Colour replacementColour)

"Recursively replaces a colour that might be used for filling or stroking.
return true if any instances of this colour were found. "

Thanks. My SVG has 1 color and I do replace that color. If I draw the button with no image, I also get a white button and setColour is ignored. What am I missing here?

Have you tested different buttonstyles? https://docs.juce.com/master/classDrawableButton.html#a7da653337d7329405ef9865cc35f612e

Which style are you using? Only ImageOnButtonBackground or ImageOnButtonBackgroundOriginalSize show a rounded rectangle behind the drawable. The colourIDs are TextButton::buttonColourId and TextButton::buttonOnColourId.

Here is my code so very confused as to why setColor is being ignored.

db = new DrawableButton(“FilterToggle”, DrawableButton::ImageOnButtonBackground);

I’m having exact the same problem. Did you found a solution for this?

Found the problem. drawButtonBackground() was overwritten in my look and feel class.