Hi everyone!
I am trying to design buttons with different colors but i don’t know how to change the color of name button inside it.Normally the color is white and every sketch i see online uses this color.Can i add something to the code for doing this thing?
This is the classic code i wrote:
import controlP5.*; //import ControlP5 library
import processing.serial.*;
Serial port;
ControlP5 cp5; //create ControlP5 object
PFont font;
void setup(){ //same as arduino program
size(1366, 768); //window size, (width, height)
printArray(Serial.list()); //prints all available serial ports
//port = new Serial(this, "COM3", 9600); //i have connected arduino to com3, it would be different in linux and mac os
//lets add button to empty window
cp5 = new ControlP5(this);
font = createFont("arial", 20); // custom fonts for buttons and title
cp5.addButton("rosso") //"red" is the name of button
.setPosition(100, 50) //x and y coordinates of upper left corner of button
.setSize(100, 70) //(width, height)
.setFont(font)
.setColorBackground(color(255, 0, 0))
;
Thanks for your help