ControlP5 background color

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

From Examples:

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();

}


Sorry if it’s too obvious, but i just can’t figure out this myself.

1 Like

Here is the officila doc: 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.

3 Likes

Oh, jb4x thank you so much! I must have overlooked that.

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

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

  .......

  cp5.end();

Thanks once again!

2 Likes