Skip to content

Instantly share code, notes, and snippets.

@colinowens
Created May 12, 2014 02:08
Show Gist options
  • Save colinowens/d832ed7f1c9247e68bc3 to your computer and use it in GitHub Desktop.
Save colinowens/d832ed7f1c9247e68bc3 to your computer and use it in GitHub Desktop.
Random Graph Lines With Save Output
int a =300;
int b= 775;
int numberOfTimes = 1;
boolean randomColor = false;
int s = second();
int m = minute();
int h = hour();
color c;
void setup() {
size(b, a);
}
void draw() {
colorMode(HSB, 100);
color c = color(89, 87, 87);
background(0);
for (int j=0;j<numberOfTimes;j++) {
pushMatrix();
ArrayList<PVector> al = new ArrayList();
for (int i=5; i<=b; i+=5) {
al.add( new PVector(i, random(10, a-10), 10) );
}
translate(10, height-10);
scale(1, -1);
if (randomColor) stroke(c);//stroke(random(100),100,100);
strokeWeight(2);
for (int i=1; i<al.size(); i++) {
if (!randomColor) stroke(0, 0, 30);
line(al.get(i-1).x, al.get(i-1).y, al.get(i).x, al.get(i).y);
}
popMatrix();
}
saveFrame(h+m+s+".png");
stop();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment