Skip to content

Instantly share code, notes, and snippets.

@errete
Created February 10, 2014 15:13
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/8917641 to your computer and use it in GitHub Desktop.
Save errete/8917641 to your computer and use it in GitHub Desktop.
processing.org code for the cover of http://8tracks.com/danielrt/37
int i, j;
int[][] c={ // colors
{26, 56, 56},
{254, 190, 88}
};
PGraphics n37; // raster "37."
int gray; // color of current pixel
PFont fnt=createFont("HelveticaNeueLTStd-Blk", 54);
void setup() {
n37=createGraphics(90, 90); // raster "37."
n37.beginDraw();
n37.background(0);
n37.fill(255);
n37.textFont(fnt);
n37.textAlign(CENTER, TOP);
n37.text("37.", 45, 26);
n37.endDraw();
size(1440, 1440);
noStroke();
background(192);
for (i=0; i<90; i++) { // one gradient
for (j=0; j<90; j++) {
gray=round(red(n37.pixels[i+j*n37.width])/16);
fill(
(c[1][0]-c[0][0])/180*i+(c[1][0]-c[0][0])/180*j,
(c[1][1]-c[0][1])/180*i+(c[1][1]-c[0][1])/180*j,
(c[1][2]-c[0][2])/180*i+(c[1][2]-c[0][2])/180*j
);
quad(
i*16+(j%2)*16,
j*16+(i%2)*16,
i*16+(j%2)*16,
j*16+16-(i%2)*16,
i*16+16-(j%2)*16,
j*16+gray-(i%2)*16,
i*16+16-(j%2)*16,
j*16+16-(i%2)*16
);
}
}
// uncomment the next line to save
// save("portada_37.png");
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment