# Custom plugin background colours

**URL:** <https://forum.juce.com/t/custom-plugin-background-colours/28572>\
**Category:** Audio Plugins\
**Created:** [July 16, 2018, 1:35pm UTC](https://forum.juce.com/t/custom-plugin-background-colours/28572 "2018-07-16T13:35:55Z")\
**Posts on this page:** 13\
**Page:** 1

<div class="post-metadata">

**Author:** ![DigitalTek](https://avatars.discourse-cdn.com/v4/letter/d/f14d63/32.png) [@DigitalTek](https://forum.juce.com/u/DigitalTek)\
**Post date:** [July 16, 2018, 1:35pm UTC](https://forum.juce.com/t/custom-plugin-background-colours/28572/1 "2018-07-16T13:35:55Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![hyakken](https://avatars.discourse-cdn.com/v4/letter/h/d9b06d/32.png) [@hyakken](https://forum.juce.com/u/hyakken)\
**Post date:** [July 16, 2018, 1:50pm UTC](https://forum.juce.com/t/custom-plugin-background-colours/28572/2 "2018-07-16T13:50:51Z")

</div>

I think you can fill the background like this.

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

```

---

<div class="post-metadata">

**Author:** ![ImJimmi](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/imjimmi/32/10843_2.png) [@ImJimmi](https://forum.juce.com/u/ImJimmi)\
**Post date:** [July 16, 2018, 2:12pm UTC](https://forum.juce.com/t/custom-plugin-background-colours/28572/3 "2018-07-16T14:12:35Z")

</div>

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

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

```

---

<div class="post-metadata">

**Author:** ![DigitalTek](https://avatars.discourse-cdn.com/v4/letter/d/f14d63/32.png) [@DigitalTek](https://forum.juce.com/u/DigitalTek)\
**Post date:** [July 16, 2018, 2:33pm UTC](https://forum.juce.com/t/custom-plugin-background-colours/28572/4 "2018-07-16T14:33:56Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![hyakken](https://avatars.discourse-cdn.com/v4/letter/h/d9b06d/32.png) [@hyakken](https://forum.juce.com/u/hyakken)\
**Post date:** [July 16, 2018, 2:54pm UTC](https://forum.juce.com/t/custom-plugin-background-colours/28572/5 "2018-07-16T14:54:15Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![DigitalTek](https://avatars.discourse-cdn.com/v4/letter/d/f14d63/32.png) [@DigitalTek](https://forum.juce.com/u/DigitalTek)\
**Post date:** [July 16, 2018, 3:11pm UTC](https://forum.juce.com/t/custom-plugin-background-colours/28572/6 "2018-07-16T15:11:20Z")

</div>

done that now i get a build error.

 ![image](https://us1.discourse-cdn.com/flex026/uploads/juce/original/2X/6/6a951e86a37424e94ea3929994795646f0235958.png)  
i get many more errors with the other void paint not as a comment

---

<div class="post-metadata">

**Author:** ![danielrudrich](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/danielrudrich/32/3735_2.png) [@danielrudrich](https://forum.juce.com/u/danielrudrich)\
**Post date:** [July 16, 2018, 3:12pm UTC](https://forum.juce.com/t/custom-plugin-background-colours/28572/7 "2018-07-16T15:12:29Z")

</div>

It belongs into the .cpp, not the .h

---

<div class="post-metadata">

**Author:** ![hyakken](https://avatars.discourse-cdn.com/v4/letter/h/d9b06d/32.png) [@hyakken](https://forum.juce.com/u/hyakken)\
**Post date:** [July 16, 2018, 3:15pm UTC](https://forum.juce.com/t/custom-plugin-background-colours/28572/8 "2018-07-16T15:15:39Z")

</div>

in .h

```auto
void paint (Graphics& g) override;

```

in .cpp

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

```

I think this will work.

---

<div class="post-metadata">

**Author:** ![DigitalTek](https://avatars.discourse-cdn.com/v4/letter/d/f14d63/32.png) [@DigitalTek](https://forum.juce.com/u/DigitalTek)\
**Post date:** [July 16, 2018, 3:20pm UTC](https://forum.juce.com/t/custom-plugin-background-colours/28572/9 "2018-07-16T15:20:36Z")

</div>

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](https://cdck-file-uploads-us1.s3.dualstack.us-west-2.amazonaws.com/flex026/uploads/juce/original/2X/0/0fb095580df08ff7767f34ad5b555fb2b789d23c.png)

---

<div class="post-metadata">

**Author:** ![hyakken](https://avatars.discourse-cdn.com/v4/letter/h/d9b06d/32.png) [@hyakken](https://forum.juce.com/u/hyakken)\
**Post date:** [July 16, 2018, 3:29pm UTC](https://forum.juce.com/t/custom-plugin-background-colours/28572/10 "2018-07-16T15:29:03Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![DigitalTek](https://avatars.discourse-cdn.com/v4/letter/d/f14d63/32.png) [@DigitalTek](https://forum.juce.com/u/DigitalTek)\
**Post date:** [July 16, 2018, 5:55pm UTC](https://forum.juce.com/t/custom-plugin-background-colours/28572/11 "2018-07-16T17:55:21Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![jules](https://avatars.discourse-cdn.com/v4/letter/j/41988e/32.png) [@jules](https://forum.juce.com/u/jules)\
**Post date:** [July 17, 2018, 8:13am UTC](https://forum.juce.com/t/custom-plugin-background-colours/28572/12 "2018-07-17T08:13:38Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![DigitalTek](https://avatars.discourse-cdn.com/v4/letter/d/f14d63/32.png) [@DigitalTek](https://forum.juce.com/u/DigitalTek)\
**Post date:** [July 18, 2018, 10:26am UTC](https://forum.juce.com/t/custom-plugin-background-colours/28572/13 "2018-07-18T10:26:38Z")

</div>

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)
