Hi guys,
I have a problem with the background of my program. If it is a solid color, everything works, buti if I draw a gradient, animation trembles. Can you recomend me any solution? Thank you very much.
int x;
int sentido;
void setup(){
size(360,720);
x=80;
sentido=1;
frameRate(10);
smooth();
ellipseMode(RADIUS);
background(255,78,78);
float l = width/255;
for(int i = 0; i<width; i++) {
stroke(253,176,71,255-i/(l));
line(i,0,i, height);
}
}
void draw(){
background(255,78,78);
float l = width/255;
for(int i = 0; i<width; i++) {
stroke(253,176,71,255-i/(l));
line(i,0,i, height);
}
noFill();
strokeWeight(2);
stroke(255);
ellipse(180, 420, x, x);
ellipse(180, 420, x, x);
ellipse(180, 300, x, x);
ellipse(232, 390, x, x);
ellipse(232, 330, x, x);
ellipse(128, 390, x, x);
ellipse(128, 330, x, x);
if ((x>width-270) || (x<80)){
sentido=-sentido;
}
x += 1 * sentido;
}