Thanks Mike,
Much more responsive! Check this out:
var x, y, s, a, b, c, d, kol, s
function setup() {
createCanvas(320, 200);
background('black');
s = 1000;
}
function mouseClicked() {
if (s == 1000) {
s = 5;
}
else {
s += 5;
}
for (x = 0; x <= 320; x++) {
for (y = 0; y <= 200; y++) {
a = x * s / 600;
b = y * s / 600;
c = a * a + b * b;
d = c / 2;
d = d - Math.floor(d);
d = d * 1000;
if (d < 250) {
kol = color(d, 0, 0);
}
else if (d < 500) {
kol = color(0, d - 250, 0);
}
else if (d < 750) {
kol = color(0, 0, d - 500);
}
else {
kol = color(255, 255, 255);
}
stroke(kol);
point(x, y);
}
}
}
EDIT: missed a ; after d = d * 1000