hey! how can i change the colors of individual sliders in controlP5? so every slider has a different color?
i can only get it to work on all sliders at once :/
thx =)
i can only get it to work on all sliders at once :/
- here's my code if it helps:
- import controlP5.*;
- ControlP5 cp5;
- ControlWindow controlWindow;
- public int Radius = 10; //Startwert
- public int Anzahl = 1; //Startwert
- public float Rotieren = -2; //Startwert
- public int Rot = 255; //Startwert
- public int Gruen = 255; //Startwert
- public int Blau = 255; //Startwert
- public int Glas = 255; //Startwert
- void setup() {
- size(900, 900,P3D);
- cp5 = new ControlP5(this);
- controlWindow = cp5.addControlWindow("controlP5window", 400, 400, 400, 400) //größe des Fenster
- .hideCoordinates()
- .setBackground(color(0))
- ;
- cp5.addSlider("Radius")
- .setRange(1, 25) //von bis
- .setPosition(40, 40) //Position
- .setSize(200, 29) //Größe
- .setWindow(controlWindow)
- .setColorValue(color(0, 0, 0))
- .setColorBackground(color(156, 158, 159))
- ;
- cp5.addSlider("Anzahl")
- .setRange(1, 8) //von bis
- .setPosition(40, 80) //Position
- .setSize(200, 29) //Größe
- .setWindow(controlWindow)
- .setColorValue(color(0, 0, 0))
- .setColorBackground(color(156, 158, 159))
- ;
- cp5.addSlider("Rotieren")
- .setRange(-3, 6) //von bis
- .setPosition(40, 120) //Position
- .setSize(200, 29) //Größe
- .setWindow(controlWindow)
- .setColorValue(color(0, 0, 0))
- .setColorBackground(color(156, 158, 159))
- ;
- cp5.addSlider("Rot")
- .setRange(0, 255) //von bis
- .setPosition(40, 160) //Position
- .setSize(200, 29) //Größe
- .setWindow(controlWindow)
- .setColorValue(color(255, 0, 0))
- .setColorBackground(color(255, 0, 0))
- ;
- cp5.addSlider("Gruen")
- .setRange(0, 255) //von bis
- .setPosition(40, 189) //Position
- .setSize(200, 29) //Größe
- .setWindow(controlWindow)
- .setColorValue(color(0, 255, 0))
- .setColorBackground(color(0, 255, 0))
- ;
- cp5.addSlider("Glas")
- .setRange(100, 255) //von bis
- .setPosition(40, 260) //Position
- .setSize(200, 29) //Größe
- .setWindow(controlWindow)
- .setColorValue(color(0, 0, 0))
- .setColorBackground(color(156, 158, 159))
- ;
- cp5.addSlider("Blau")
- .setRange(0, 255) //von bis
- .setColorValue(color(0, 0, 255))
- .setPosition(40, 218) //Position
- .setSize(200, 29) //Größe
- .setWindow(controlWindow)
- .setColorBackground(color(0, 0, 255))
- .setColorForeground(color(255))
- .setColorValue(color(0, 0, 255))
- ;
- }
thx =)
1