int step;
color nextColor;
color currentColor;
void setup(){
size(500, 500, P3D);
smooth();
sphereDetail(24);
nextColor = color(random(255), random(255), random(255), 30);
setColor();
}
void setColor(){
step = 0;
currentColor = nextColor;
nextColor = color(random(255), random(255), random(255), 30);
}
void draw(){
background(0);
lights();
translate(width/2, height/2, -500);
noStroke();
for(int i = 1; i <= 30; i++){
if(i <= step){
fill(nextColor);
} else {
fill(currentColor);
}
sphere(i * 10);
}
step++;
if(step == 30){
setColor();
}
}