![](https://assets.st-note.com/img/1674743117286-XdFwPCSdiW.png?width=1200)
String APPNAME = "generativeart_026";
float CIRCLE_X;
float CIRCLE_Y;
int LINES_NUM;
int COLUMN_NUM;
void setup() {
size(800, 800);
noLoop();
background(255);
}
void draw() {
LINES_NUM = 10;
COLUMN_NUM = 25;
drawCircle(LINES_NUM, COLUMN_NUM);
drawFooter();
}
void drawCircle(int LINES_NUM, int COLUMN_NUM){
background(255);
CIRCLE_X = 0;
CIRCLE_Y = 0;
float CIRCLE_DIAMETER = height / LINES_NUM;
float COLUMN_WIDTH = height / COLUMN_NUM;
for(int i = 0; i < LINES_NUM + 1; i = i + 1){
if(i % 2 == 0){
for (int j = 0; j < width + COLUMN_WIDTH; j = j + int(COLUMN_WIDTH)) {
noStroke();
fill(getColor());
circle(CIRCLE_X + j, CIRCLE_Y, CIRCLE_DIAMETER * 1.1);
}
CIRCLE_Y = CIRCLE_Y + CIRCLE_DIAMETER;
}else{
for (int j = 0; j < width + COLUMN_WIDTH; j = j + int(COLUMN_WIDTH)) {
noStroke();
fill(getColor());
circle(width - j, CIRCLE_Y, CIRCLE_DIAMETER * 1.1);
}
CIRCLE_Y = CIRCLE_Y + CIRCLE_DIAMETER;
}
}
}
color getColor(){
float COLOR_R = 255;
float COLOR_G = random(129, 255);
float COLOR_B = random(0, 128);
float COLOR_A = 255;
color COLOR_RGBA = color(COLOR_R, COLOR_G, COLOR_B, COLOR_A);
return COLOR_RGBA;
}
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)2023 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");
}
}