![](https://assets.st-note.com/img/1729439077-IqsOM1K8in9UxNzoTPFY627l.png?width=1200)
String APPNAME = "generativeart_039";
void setup() {
size(800, 800);
noLoop();
}
void draw() {
background(255, 255, 255);
noFill();
noStroke();
drawpPttern(5);
drawFooter();
}
void drawpPttern(int PIECE_NUMBER) {
float PIECE_WIDTH = width / PIECE_NUMBER;
float PIECE_HEIGHT = height / PIECE_NUMBER;
for (float i = 0; i <= PIECE_NUMBER; i = i + 1) {
for (float j = 0; j <= PIECE_NUMBER; j = j + 1) {
float PIECE_CORNER_R = 10;
float PIECE_X = PIECE_WIDTH * i;
float PIECE_Y = PIECE_HEIGHT * j;
pushMatrix();
translate(PIECE_X, PIECE_Y);
fill(255, 255, 255);
rect(0, 0, PIECE_WIDTH, PIECE_HEIGHT, PIECE_CORNER_R);
for (float n = PIECE_WIDTH; n >= 0; n = n - 20) {
fill(255/PIECE_WIDTH*n ,255/PIECE_WIDTH*n, 255/PIECE_WIDTH*n);
stroke(128, 128, 128);
strokeWeight(2);
rect(0, 0, n, n);
}
popMatrix();
}
}
}
void drawFooter() {
rectMode(CORNER);
noStroke();
fill(255, 255, 255, 192);
rect(0, height - 45, width, 45);
textAlign(LEFT, BOTTOM);
textSize(20);
fill(64);
text(APPNAME, 30, height - 10);
textAlign(RIGHT, BOTTOM);
textSize(20);
fill(64);
text("(C)2024 sakuzo_arts", width - 30, height - 10);
}
void keyPressed() {
if (key == ' ') {
redraw();
}
if (key == 'S') {
int Y = year();
int M = month();
int D = day();
int h = hour();
int m = minute();
int s = second();
String FILENAME = APPNAME + "-" + Y + nf(M, 2) + nf(D, 2) + nf(h, 2) + nf(m, 2) + nf(s, 2);
saveFrame(FILENAME + ".png");
}
}