xxxxxxxxxx
68
s = 50;
function setup() {
createCanvas(700, 700);
background(250);
noStroke();
}
function draw() {
let shades = ["#8A414C", "#6A101E", "#4C010D", "#CDB7B7", "#C29B9B", "#C58282", "#E0A99C", "#DB7C66", "#CB6046", "#E4E3E0", "#D4D0C5", "#C1BBAE", "#919293", "#555860", "#3B404B"];
let tones = ["#8A414C", "#6A101E", "#4C010D", "#CDB7B7", "#C29B9B", "#C58282", "#E0A99C", "#DB7C66", "#CB6046", "#E4E3E0", "#D4D0C5", "#C1BBAE", "#FFF6C6", "#EEE29E", "#E2D488", "#FFF6C6", "#EEE29E", "#E2D488", "#FFF6C6", "#EEE29E", "#E2D488", "#FFF6C6", "#EEE29E", "#E2D488"];
for (x = 0; x < width; x = x + s) {
for (y = 0; y < width; y = y + s) {
let shade = random(shades);
cS = color(shade);
let tone = random(tones);
cT = color(tone);
if (x > 110 && x < 550 && y > 110 && y < 550) {
fill(cT);
} else {
fill(cS);
}
rect(x, y, s);
noLoop();
}
}
}
function keyReleased() {
if (key == '1') {
s = 10;
loop();
}
if (key == '2') {
s = 20;
loop();
}
if (key == '3') {
s = 35;
loop();
}
if (key == '4') {
s = 50;
loop();
}
if (key == '5') {
s = 70;
loop();
}
if (key == '6') {
s = 100;
loop();
}
if (key == '7') {
s = 140;
loop();
}
if (key == '8') {
s = 175;
loop();
}
}