Skip to content

Instantly share code, notes, and snippets.

@errete
Created March 4, 2014 08:01
Show Gist options
  • Save errete/9342112 to your computer and use it in GitHub Desktop.
Save errete/9342112 to your computer and use it in GitHub Desktop.
source code for the cover of http://8tracks.com/danielrt/39
int i, j, gray;
PGraphics n39; // raster "39."
PFont fnt=createFont("HelveticaNeueLTStd-Bd", 54);
color[] c={
color(234, 38, 92), // red
color(5, 130, 204), // blue
color(144, 204, 0), // green
color(254, 183, 0) // orange
};
void setup() {
size(1440, 1440);
background(255);
stroke(255);
strokeWeight(2);
n39=createGraphics(90, 90); // raster "38."
n39.beginDraw();
n39.background(0);
n39.fill(255);
n39.textFont(fnt);
n39.textAlign(CENTER, TOP);
n39.text("39.", 45, 40);
n39.endDraw();
for (j=0; j<90; j++) {
fill(c[round(random(c.length-1))], round(random(192))+63);
beginShape();
curveVertex(-16, j*16);
for (i=0; i<90; i++) {
gray=32-round(red(n39.pixels[i+j*n39.width])/2);
curveVertex(i*16+round(random(12))+8, j*16+round(random(gray)));
}
curveVertex(1456, j*16);
endShape();
}
save("39.png");
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment