xxxxxxxxxx
// by Laura Krok aka la-krok
var margin = 10;
var topStep = 70;
var bottomStep = 25;
var sideStep = 47;
function setup() {
createCanvas(1240, 1748);
background(255);
}
function draw() {
// Setze die Hintergrundfarbe auf blasses Gelb
fill(color('#DDD0A5'));
rect(0,0,width,height);
// Überprüfe, ob die Maus über dem braunen Rechteck ist
if (mouseX > margin && mouseX < width-margin && mouseY > margin && mouseY < height-margin) {
// Setze die Farbe des braunen Rechtecks auf blau
fill(color('#377172'));
} else {
// Setze die Farbe des braunen Rechtecks auf braun
fill(color('#8B5C33'));
strokeWeight(0);
fill(color('#21AA4F'));
rect(margin, margin, width-(margin*2), height-(margin*2));
fill(color('#087261'));
rect(margin + sideStep, margin + topStep, width-margin*2-sideStep*2, height-margin*2-bottomStep-topStep);
fill(color('#DDD0A5'));
rect(margin + sideStep*2, margin + topStep*2, width-margin*2-sideStep*4, height-margin*2-bottomStep*2-topStep*2);
fill(color('#FEE334'));
rect(margin + sideStep*3, margin + topStep*3, width-margin*2-sideStep*6, height-margin*2-bottomStep*3-topStep*3);
}
}
function keyTyped() {
if (key === "s" || key === "S") {
saveCanvas("AlbersHuldingAnDasQuadrat1240x1748", ".jpeg");
}
}