createCanvas(windowHeight, windowHeight);
colorMode(HSB, 360, 100, 100, 1);
function windowResized() {
if (windowWidth > windowHeight) win = windowHeight;
c1 = color(hue, random(0, 20), random(50,100));
c2 = color(random(hue - 10, hue + 10) % 360, random(0, 20), random(50,100));
var gradient = drawingContext.createLinearGradient(win / 2,0, win / 2, win);
gradient.addColorStop(0, c1);
gradient.addColorStop(1, c2);
drawingContext.fillStyle = gradient;
rect(0, 0, windowWidth, windowHeight);
drawingContext.shadowColor = "rgba(0,0,0,0.5)";
drawingContext.shadowBlur = bd / 2;
fill(random(hue - 30, hue - 20) % 360, random(0, 20), random(50,100), 0.5);
rect(win / 2, win / 2, win / 1.4);
for (let i = 0; i < 50; i++)
points.push(new Pnt(random(bd, win - bd), random(bd, win - bd)));
for (let i = 0; i < points.length; i++)
beginShape(TRIANGLE_STRIP);
fill(random(hue - 10, hue + 10) % 360, random(0, 20), random(50,100));
for (let j = i + 1; j < points.length; j++)
var d = sqrt(pow(points[i].x - points[j].x, 2) +
pow(points[i].y - points[j].y, 2));
if (d > bd && d < bd * 2)
vertex(points[i].x, points[i].y);
vertex(points[j].x, points[j].y);
if (nearbors != 0) circle(points[i].x, points[i].y, bd / 10);
drawingContext.shadowColor = "rgba(0,0,0,0)";
} else if (keyCode === 83) {
saveCanvas("thumb", "png");