Colorful Pentagons by Jerome Herr

Rupert Russell

Ballarat, Australia

  • Available
    Products
    52
  • Artist
    Notes
  • Artwork Comments 1

Apparel

Cases & Skins

Wall Art

Home Decor

Bags

Stationery

Artist's Description

/*
“colorful pentagons” by Jerome Herr
http://www.openprocessing.org/sketch/109796
Licensed under Creative Commons Attribution ShareAlike
https://creativecommons.org/licenses/by-sa/3.0
https://creativecommons.org/licenses/GPL/2.0/
*/

color[] cols = {
#0F4155, #288791, #87CD89, #F04132, #FCB123
};

int count = 0;
int num = 50000;
int sides = 5;
float radius;
float alpha = 255;

void setup() {
size(15283, 11462);

strokeWeight(5);
}

void draw() {

for (int i = 0; i < num; i++) {
alpha -= .0001;
//alpha = 100;
float angle = random(TWO_PI);
radius = random(30, 600);
int r = int(random(0, 5));
color col = cols®;
polygon(sides, radius, angle, alpha, col);
}

count = count + 1;
save(“hexagons” + count + “.jpg”);
println(“Saved Pentagons 1” + count + “.png”);
}

void mouseClicked() {
count = count + 1;
save(“Pentagons 1” + count + “.png”);

// setup();
}

void polygon(int sideCount, float radius, float angle, float _alpha, color _col) {
float theta = angle;
float alpha = _alpha;
float x = random(width);
float y = random(height);
color col = _col;
fill(col, alpha);

beginShape();
for (int i=0; i<sideCount; i++) {
x = x + cos(theta) * radius;
y = y + sin(theta) * radius;
vertex(x, y);
theta += TWO_PI/sideCount;
}
endShape(CLOSE);
}

Artwork Comments

desktop tablet-landscape content-width tablet-portrait workstream-4-across phone-landscape phone-portrait
desktop tablet-landscape content-width tablet-portrait workstream-4-across phone-landscape phone-portrait

10% off

for joining the Redbubble mailing list

Receive exclusive deals and awesome artist news and content right to your inbox. Free for your convenience.