We are about to switch to a new forum software. Until then we have removed the registration on this forum.
At the moment when using the slider the ellipse goes from black - white, however I'd like it to go from the colors in my code (maroon - green) any help would be greatly appreciated!
import controlP5.*; ControlP5 cp5;
color maroon = color(125, 18, 38); color purple = color(153, 27, 79); color red = color(237,32,36); color orange = color(245,126,32); color yellow = color(237,233,55); color green = color(197,218,64);
public int sliderValue = 100;
void setup() {
size(700, 400);
background(255);
cp5 = new ControlP5(this);
cp5.addSlider("sliderValue") .setRange(0, 300) .setPosition(40, 40) .setSize(200, 29) ;
}
void draw() { ellipse(350,200,200,200); fill(sliderValue); noStroke(); smooth();
}
Answers
Please format the code properly
Anyway, I thought in a way of doing so. Don't know if its a clever one, but works...
Thank you, that's wonderful!