# ControlP5 background color

**URL:** <https://discourse.processing.org/t/controlp5-background-color/3011>\
**Category:** Libraries\
**Created:** [August 27, 2018, 6:03am UTC](https://discourse.processing.org/t/controlp5-background-color/3011 "2018-08-27T06:03:54Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Lunkvoul](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/lunkvoul/32/1246_2.png) [@Lunkvoul](https://discourse.processing.org/u/Lunkvoul)\
**Post date:** [August 27, 2018, 6:03am UTC](https://discourse.processing.org/t/controlp5-background-color/3011/1 "2018-08-27T06:03:54Z")

</div>

Hi everyone! Is there any option to change cp5 background colour?

From Examples:

```auto
void setup() {
  size(800, 400);  
  noStroke();
  cp5 = new ControlP5(this);
  
  cp5.begin(cp5.addBackground("abc"));
  
  cp5.addSlider("v1")
     .setPosition(10, 20)
     .setSize(200, 20)
     .setRange(100, 300)
     .setValue(250)
     ;
  
  cp5.addToggle("lines")
     .setPosition(10,50)
     .setSize(80,20)
     .setMode(Toggle.SWITCH)
     ;
     
  cp5.end();

}

```

 ![24](https://canada1.discourse-cdn.com/flex036/uploads/processingfoundation1/original/2X/6/6313a896ccc735dd01f1f8aa99b062c1b7d57ae1.png)  
Sorry if it’s too obvious, but i just can’t figure out this myself.

---

<div class="post-metadata">

**Author:** ![jb4x](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/jb4x/32/789_2.png) [@jb4x](https://discourse.processing.org/u/jb4x)\
**Post date:** [August 27, 2018, 7:18am UTC](https://discourse.processing.org/t/controlp5-background-color/3011/2 "2018-08-27T07:18:11Z")

</div>

Here is the officila doc: [http://www.sojamo.de/libraries/controlP5/reference/](http://www.sojamo.de/libraries/controlP5/reference/)

If you go in the `background` class and check the inherited methods, you get a `setColorBackground`. Might be that.

---

<div class="post-metadata">

**Author:** ![Lunkvoul](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/lunkvoul/32/1246_2.png) [@Lunkvoul](https://discourse.processing.org/u/Lunkvoul)\
**Post date:** [August 27, 2018, 8:01am UTC](https://discourse.processing.org/t/controlp5-background-color/3011/3 "2018-08-27T08:01:40Z")

</div>

Oh, [jb4x](https://discourse.processing.org/u/jb4x) thank you so much! I must have overlooked that.

Just in case anyone’s interested, it should be:

```auto
  cp5.begin();
  cp5.addBackground("abc")
  .setBackgroundColor(color(r,g,b,a));

  .......

  cp5.end();

```

Thanks once again!
