xxxxxxxxxx
51
let circleColor = 0;
let circle1;
function setup()
{
createCanvas(400, 400);
circle1 = new Circle(0, 200, 50);
}
function Circle(x, y, diameter)
{
this.x = x;
this.y = y;
this.diameter = diameter;
this.increaseX = function()
{
this.x = this.x + 1;
}
}
function draw()
{
background(255);
noStroke();
fill(circleColor, circleColor + 100, circleColor + 200);
ellipse(circle1.x, circle1.y, circle1.diameter, circle1.diameter);
circle1.increaseX();
circleColor = (circleColor + 5) % 256;
}