Custom plugin background colours

How to fill the background with the hex colour #3f3f3f
or rgb (63, 63, 63)
this is probably a stupid question but i really cant work out how to do it aha

I think you can fill the background like this.

void paint (Graphics& g)
{
   g.fillAll(Colour(0xff3f3f3f));
}

@SUBARU’s suggestion will work. But if you’d rather work with RGB values you could do:

void paint (Graphics& g)
{
    g.fillAll(Colour(63, 63, 63));
}

okay thanks, but how do i implement this? does it go in look and feel? if it is i dont understand how to access it.

From the subject title, you are trying to fill the plugin background, right?
If so, you have main plugin editor class like “PluginEditor”.
Then you can add above code in there.

done that now i get a build error.


i get many more errors with the other void paint not as a comment

It belongs into the .cpp, not the .h

in .h

void paint (Graphics& g) override;

in .cpp

void yourClassName::paint (Graphics& g)
{
   g.fillAll(Colour(0xff3f3f3f));
}

I think this will work.

if i have the class name in the function on the cpp it creates a build error, without it is fine. when i load it up however it really messes up the ui
image

I have no idea about those gui glitches.
If you don’t fill the background, your gui is fine?

Well I cannot work on code ATM so I will let you know tomorrow, however I do know when I use my own hex or RGB colour codes this happens, when I use preset juce colours it doesn’t

A common beginner mistake is to think that if you type Colour (0x112233), it’ll be opaque. It won’t because you’re giving it a 32-bit integer, not a string like for web-colours, and without an alpha value in the top bits, the colour is completely transparent.

well it isnt opaque if i use the 32 bit version it just causes ui glitches, this applies as well if i use the rgb colour code (74, 75, 94)