Created
September 6, 2014 18:09
-
-
Save errete/66f143e15f35a493d56e to your computer and use it in GitHub Desktop.
Processing.org code for the cover of http://8tracks.com/danielrt/54
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, 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