Skip to content

Instantly share code, notes, and snippets.

@dimkir
Created September 17, 2013 10:11
Show Gist options
  • Save dimkir/6592450 to your computer and use it in GitHub Desktop.
Save dimkir/6592450 to your computer and use it in GitHub Desktop.
Created using Sketch2Tweet tool
int i, n, s=900;
void setup() {
size(s, s);
colorMode(HSB, 255);
}
void draw() {
n=int(90+90*sin((i+=5)*.51));
// a bit faster ^^^^
textSize(n);
fill(233<<n);
int x = i%s-50;
int y = 99*(i/s)%s-n;
lineTo(x,y); // replaced with random colored lines.
//text(i/s,x , y);
}//#p5
int prevX = -100;
int prevY = -100;
void lineTo(int x, int y ){
stroke(randomColor());
strokeWeight(random(2,15));
if ( prevX == -100 ){
// this is first run, just set vars
point(x,y);
prevX = x; prevY = y;
}
else{
line(prevX, prevY, x, y);
prevX = x; prevY = y;
}
}
color randomColor(){
return color((int)random(255), 200,200);
}
@dimkir
Copy link
Author

dimkir commented Sep 17, 2013

This is comment which can show image of the sketch imge

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment