xxxxxxxxxx
27
let dim;
function setup() {
createCanvas(710, 400);
dim = width / 2;
background(255);
colorMode(HSB, 360, 100, 100);
noStroke();
ellipseMode(RADIUS);
drawGradient(width/2, height / 2);
}
function drawGradient(x, y) {
let radius = dim / 2;
let h = 0;
let s = 80-0.5*radius;
let b = 100;
for (let r = radius; r > 0; --r) {
let c = color(0, s, b);
fill(c);
ellipse(x, y, r, r);
// Adjust saturation and brightness
s += 0.5;
}
}