Created
February 10, 2014 15:13
-
-
Save errete/8917641 to your computer and use it in GitHub Desktop.
processing.org code for the cover of http://8tracks.com/danielrt/37
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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