xxxxxxxxxx
75
function setup() {
createCanvas(windowWidth, windowHeight);
frameRate(60);
colorMode(HSB, 250);
noFill();
h = 0;
bb = 0;
inc = true;
count = 0;
h1 = random() * 250;
h2 = random() * 250;
h3 = random() * 250;
peak = 13;
weight = height / 150;
}
function draw() {
background(0);
translate(width / 2, height / 2);
if (getbb() > 99 || (getbb() > 0 && getbb() < 0.25)) {
count++;
}
if (frameCount % 100 == 1) {
h3 = h1;
h1 = random() * 250;
h2 = h3;
}
for (i = 0; i < 20; i++) {
bb += i + 0.4;
r = i * height / 20;
stroke(0);
strokeWeight(weight + 2);
ellipse(0, 0, r);
if (getbb() > 99) {
peak = i;
}
if (count % 2 == 0) {
if (inc) {
if (i < peak) {
h = h1;
} else {
h = h2;
}
} else {
h = h2;
}
} else {
if (inc) {
h = h1;
} else {
if (i <= peak) {
h = h1;
} else {
h = h2;
}
}
}
cc = color(h, 250, getbb());
stroke(cc);
strokeWeight(weight);
ellipse(0, 0, r);
}
}
function getbb() {
if (bb % 200 < 100) {
inc = false;
return bb % 100;
} else {
inc = true;
return 100 - (bb % 100);
}
}