xxxxxxxxxx
44
let x = 20;
let speed = 0.001;
let ac = 0.0001;
function setup() {
createCanvas(710, 400);
background(0);
noStroke();
ellipseMode(RADIUS);
frameRate(10)
}
function draw() {
background(0);
drawGradient(width/2, height / 2);
}
function drawGradient(f, y) {
let h = 0;
if (x >= 20 && x < 200) {
speed = speed
ac++
} else {
speed = -speed
ac = -(ac++)
}
for (let r = x; r > 0; --r) {
fill(255, 255, 255, h);
ellipse(f, y, r, r);
h = h +0.2
}
x = x + speed + ac
}