create random color only once
in
Programming Questions
•
2 years ago
I'm new to processing. My question is about random color.I'm having this code in my void draw:
thank you!
- ...
void draw() {
background(0);
fill(255,0,255);
rect(mouseX,390,10,10);
for(int i=0; i<10; i=i+1) {
fill(random(255),random(255),random(255));
stroke(0);
int ellipseX = 20;
int ellipseY = 20;
ellipse(ellipseX+i*40, ellipseY,40,40);
}
...
thank you!
1