Textbutton changes colour when clicked, I don't want it to do that


I’m trying to create a text button that doesn’t change colour when clicked. Here is my code. The purple colour gets darker once it has been clicked and released (or if you click the button, hold the mouse and slide away from the button then release).

I’ve tried searching but can’t anyone with the same problem.

Here’s my code

myButton.setButtonText("Click Me!");
myButton.setColour(juce::TextButton::buttonColourId,juce::Colour::fromRGB (65,61,135));
myButton.setColour(juce::TextButton::buttonOnColourId,juce::Colour::fromRGB (65,61,135));
myButton.setColour(juce::TextButton::textColourOnId, juce::Colours::white);
myButton.setColour(juce::TextButton::textColourOffId, juce::Colours::white);
myButton.setBounds(10, 10, 100, 30);

As far as I remember, the Button LookAndFeel class changes alpha values depending the button state. If you don’t want this you can paint the button yourself, or create your own look and feel for it.