Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
int rectno = 4000;
int height = 4000;
int width = 4000;
int width2 = 210;
float height2 = (width2*1.618033);
int x;
int y;
color colour1;
int coin2;
void setup() {
size(4000, 4000);
background(1, 1, 1);
ellipseMode(CENTER);
rectMode(CENTER);
noStroke();
noLoop();
}
void draw() {
for (int j = 0; j < rectno; j++){
x = int(random(height));
y = int(random(height));
int coin2 = int(random(5));
if (coin2 == 0){
fill(255, 188, 66);
} else if (coin2 == 1){
fill(7, 134, 252);
} else if (coin2 == 2){
fill(35, 240, 199);
} else if (coin2 == 4){
fill(239, 69, 75);
} else {
fill(8, 3, 87);
}
rect(x, y, width2, height2, 50);
}
save("randorectangles1.png");
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.