Skip to content

Instantly share code, notes, and snippets.

@errete
Created October 9, 2014 23:15
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save errete/0c4f6d7c4d191b3a71d0 to your computer and use it in GitHub Desktop.
Save errete/0c4f6d7c4d191b3a71d0 to your computer and use it in GitHub Desktop.
Processing.org code for the cover of http://8tracks.com/danielrt/55
int i, j, k, gray;
int disp[]=new int[2];
float r;
PGraphics n55;
PFont fnt=createFont("HelveticaNeueLTStd-Bd", 54);
void setup() {
size(1440, 1440);
background(255, 255, 192);
noFill();
strokeWeight(2);
n55=createGraphics(90, 90); // raster "38."
n55.beginDraw();
n55.background(0);
n55.fill(255);
n55.textFont(fnt);
n55.textAlign(CENTER, TOP);
n55.text("55.", 45, 40);
n55.endDraw();
for (i=0; i<90; i++) {
for (j=0; j<90; j++) {
disp[0]=4+round(random(8));
disp[1]=4+round(random(8));
r=random(1);
gray=round(red(n55.pixels[i+j*n55.width])/8);
stroke(
202-round(180*r),
238-round(147*r),
39+round(97*r),
64
);
for (k=0; k<8+gray; k++) {
ellipse(
i*16+disp[0]+round((i-45)*k/45),
j*16+disp[1]+round((j-45)*k/45),
8,
8
);
}
}
}
save("55.png");
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment