Hi everyone!
I am making a GUI with ControlP5 and want to make 16 buttons that each represent a color. I could just make 16 buttons, but I thought it might be nicer to do with buttonbar (or maybe checkbox). Now I want to change the color of the items. When printed, the items also show they contain a color-values, but I don’t know how to change those color values.
This is what printing the item returns:
{view=controlP5.ButtonBar$1@79d7845d, color=bg (0,45,90), fg (0,116,217), active (0,170,255), captionlabel (255,255,255), valuelabel (255,255,255), name=a, text=a, value=0, selected=false}
I tried this in the buttonbar example:
CColor red = new CColor(); // router
red.setActive(color(255, 255, 255));
red.setBackground(color(255, 255, 0));
red.setForeground(color(255, 250, 50));
ButtonBar b = cp5.addButtonBar(“bar”)
.addItem(“a”," ");
println(b.getItem(“a”));
b.changeItem(“a”,“color”,red);
b.changeItem(“a”,“text”,“red”);
And some different terms etc for “color” to see if any of those correlated to the data stored in the items. Changing the “text” does work. Anybody that can help me out with this?
Thanks!