Skip to content

Instantly share code, notes, and snippets.

@errete
Created September 6, 2014 18:09
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/66f143e15f35a493d56e to your computer and use it in GitHub Desktop.
Save errete/66f143e15f35a493d56e to your computer and use it in GitHub Desktop.
Processing.org code for the cover of http://8tracks.com/danielrt/54
int i, j, k, h, gray;
PGraphics n54; // raster "54."
PFont fnt=createFont("HelveticaNeueLTStd-Bd", 54);
void setup() {
size(1440, 1440);
background(226, 227, 229);
noStroke();
n54=createGraphics(90, 90); // raster "38."
n54.beginDraw();
n54.background(0);
n54.fill(255);
n54.textFont(fnt);
n54.textAlign(CENTER, TOP);
n54.text("54.", 45, 20);
n54.endDraw();
for (i=0; i<90; i++) {
for (j=0; j<90; j++) {
gray=round(red(n54.pixels[i+j*n54.width])/64);
if (gray>0) {
for (k=0; k<gray; k++) {
h=round(random(16));
fill(
85+round(10.5*h),
28+round(11.3*h),
51+round(5.6*h)
);
ellipse(i*16+(j%2)*8, j*16, h*2, h*2);
}
}
fill(255, 255, 255);
ellipse(i*16+(j%2)*8, j*16, 2, 2);
}
}
save("54.png");
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment