Quantcast
Channel: Library Questions - Processing 2.x and 3.x Forum
Viewing all articles
Browse latest Browse all 2896

How to make the ellipse change color apposed to black and white

$
0
0

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

}


Viewing all articles
Browse latest Browse all 2896

Trending Articles