xxxxxxxxxx
50
function setup() {
createCanvas(400, 400);
frameRate(30);
background(248, 240, 227);
}
function draw() {
let y = color(255, 255, 119);
let bl = color(171, 255, 255);
let gr = color(144, 251, 120);
let br = color(94, 25, 0);
let r = color(248, 40, 22);
let p = color(96, 35, 250);
let arraycolors = [ y, bl,gr, r, p, br];
translate(width/2, height/2);
if (mouseX>0 && mouseX < width && mouseY>0 && mouseY < height){
for (let z = 0 ; z< 5;z++){
let i = random(50);
let j = random(100);
let k = random(50);
let l = random(200);
let f = int(random(5));
stroke(arraycolors[f]);
rotate(random(60));
strokeWeight(random(1.2));
line(i,j,k,l)
scale(1,-1);
}
if(mouseIsPressed && mouseX>0 && mouseX < width/2 && mouseY>0 && mouseY < height/2){
background(248, 240, 227);
}
if(mouseIsPressed && mouseX>width/2 && mouseX < width && mouseY>0 && mouseY < height/2){
console.log("2nd quarter");
background(255, 172, 144);
}
if(mouseIsPressed && mouseX>width/2 && mouseX < width && mouseY>height/2 && mouseY < height){
console.log("4th quarter");
background(200, 172, 144);
}
if(mouseIsPressed && mouseX>0 && mouseX < width/2 && mouseY>height/2 && mouseY < height){
console.log("3rd quarter");
background(200, 200, 144);
}
}
}