四季
var time;
function setup() {
createCanvas(windowWidth,
windowHeight);
noFill();
time = 0.0005;
}
function draw() {
background(1112, 815, 728);
var num = 40;
for (var i = 0; i < num; i = i + 1) {
var R = i * (429 / num);
var G = 540- i * (200/ num);
var B = 655- i * (650/ num);
stroke(R, G, B);
var x = windowWidth / 2;
var y = windowHeight / 3;
var spX = 0.5 * i * windowWidth / num;
var spY = 0.5 * i * windowHeight / num;
// var dia = spX;
var dia = spX * sin(0.1 * i + time);
stamp(x, y, spX, spY, dia);
}
time = time + 0.007;
}
function stamp(x, y, spaceX, spaceY, diameter) {
ellipse(x - spaceX, y - spaceY, diameter);
ellipse(x - spaceX, y + spaceY, diameter);
ellipse(x + spaceX, y - spaceY, diameter);
ellipse(x + spaceX, y + spaceY, diameter);
}