xxxxxxxxxx
// declare w and h of each rect
var w;
var h;
// define colors
var clPink;
var clWhite;
// stroke weight of rects
var stW;
function setup() {
createCanvas(600, 600);
w = 600 / 5
h = w;
// Assign color values
clPink = '#FF66FF';
clWhite = '#ffffff';
// Set Stroke Weight
stW = 1;
// set angle mode to degrees
angleMode(DEGREES);
}
function draw() {
background(240,240,240);
// Draw grid 1,1
fill(clWhite);
rect(0, 0, w, h);
// Draw grid 1,2
fill(clPink);
rect(120, 0, w, h);
// arc(x, y, w, h, start, stop)
fill(clWhite);
arc(w*2, h/4-30, w*2 , h*2, 90, 180);
// Draw grid 1,2
fill(clPink);
rect(240, 0, w, h);
// arc(x, y, w, h, start, stop)
fill(clWhite);
arc(w*2, h/4-30, w*2 , h*2, 360, 90);
// Draw grid 1,3
fill(clWhite);
rect(360, 0, w, h);
// Draw grid 1,4
fill(clWhite);
rect(480, 0, w, h);
// Draw grid 2,1
fill(clWhite);
rect(0, 120, w, h);
// Draw grid 2,2
fill(clWhite);
rect(120, 120, w, h);
// arc(x, y, w, h, start, stop)
fill(clPink);
arc(w*2, h, w*2 , h*2, 90, 180);
// Draw grid 2,3
fill(clWhite);
rect(240, 120, w, h);
// arc(x, y, w, h, start, stop)
fill(clPink);
arc(w*2, h, w*2 , h*2, 360, 90);
// Draw grid 2,4
fill(clWhite);
rect(360, 120, w, h);
// Draw grid 2,5
fill(clWhite);
rect(480, 120, w, h);
// Draw grid 3,1
fill(clWhite);
rect(0, 240, w, h);
// Draw grid 3,2
fill(clWhite);
rect(120, 240, w, h);
// arc(x, y, w, h, start, stop)
fill(clPink);
arc(w*2, h*3, w*2 , h*2, 180, 270);
// Draw grid 3,3
fill(clWhite);
rect(240, 240, w, h);
// arc(x, y, w, h, start, stop)
fill(clPink);
arc(w*2, h*3, w*2 , h*2, 270, 360);
// Draw grid 3,4
fill(clWhite);
rect(360, 240, w, h);
// Draw grid 3,3
fill(clWhite);
rect(480, 240, w, h);
// Draw grid 4,1
fill(clWhite);
rect(0, 360, w, h);
// Draw grid 4,2
fill(clPink);
rect(120, 360, w, h);
// Draw grid 4,3
fill(clPink);
rect(240, 360, w, h);
// Draw grid 4,4
fill(clWhite);
rect(360, 360, w, h);
// Draw grid 4,5
fill(clPink);
rect(480, 360, w, h);
// arc(x, y, w, h, start, stop)
fill(clWhite);
arc(w*4, h*4, w*2 , h*2, 270, 360);
// Draw grid 5,1
fill(clPink);
rect(0, 480, w, h);
// arc(x, y, w, h, start, stop)
fill(clWhite);
arc(w, h*4, w*2 , h*2, 90, 180);
// Draw grid 5,2
fill(clPink);
rect(120, 480, w, h);
// Draw grid 5,3
fill(clPink);
rect(240, 480, w, h);
// Draw grid 5,4
fill(clPink);
rect(360, 480, w, h);
// arc(x, y, w, h, start, stop)
fill(clWhite);
arc(w*4, h*4, w*2 , h*2, 90, 180);
// Draw grid 5,4
fill(clPink);
rect(480, 480, w, h);
// arc(x, y, w, h, start, stop)
fill(clWhite);
arc(w*4, h*4, w*2 , h*2, 360, 90);
}