xxxxxxxxxx
let cols = 20;
let rows = 20;
var cellW, cellH;
var colors = ["#65F0B6","#F0664D", "#F0DF59", "#4DF0AC", "#937DF0"];
var corner, arcLen;
function setup() {
createCanvas(windowHeight, windowHeight);
cellW = width/cols;
cellH = height/rows;
corner = [PI + PI/2 , PI + PI, 2*PI + PI/2, PI];
arcLen = [HALF_PI, PI, PI + HALF_PI, 2*PI]
background("#44396E");
noLoop();
noStroke();
}
function draw() {
for(var i=0; i<cols; i++){
for(var j=0; j<rows; j++){
let x, y, arcL;
x = i*cellW + cellW/2;
y = j*cellH + cellH/2;
var rndom = random(20);
if(rndom < 12) arcL = arcLen[0];
else if(rndom < 18) arcL = arcLen[1];
else if(rndom < 19) arcL = arcLen[2];
else arcL = arcLen[3];
let angle = random(corner);
push();
translate(x,y);
rotate(angle);
let c= color(random(colors));
noFill();
stroke(c)
strokeWeight(4);
arc(0, 0, cellH, cellH, 0, arcL, OPEN);
pop();
}
}
//save("arcs.svg");
}