Skip to content

Instantly share code, notes, and snippets.

@errete
Created November 10, 2014 15:12
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/8907ea2531a79282e596 to your computer and use it in GitHub Desktop.
Save errete/8907ea2531a79282e596 to your computer and use it in GitHub Desktop.
int i, j, gray;
PGraphics n56;
PFont fnt=createFont("HelveticaNeueLTStd-Bd", 54);
void setup() {
size(1440, 1440);
background(255);
n56=createGraphics(90, 90); // raster "56."
n56.beginDraw();
n56.background(0);
n56.fill(255);
n56.textFont(fnt);
n56.textAlign(CENTER, TOP);
n56.text("56.", 45, 40);
n56.endDraw();
for (i=0; i<90; i++) {
for (j=0; j<90; j++) {
gray=round(red(n56.pixels[i+j*n56.width])/16);
stroke(
118-107/16*gray,
166-123/16*gray,
125-61/16*gray
);
line(
i*16+cos(TWO_PI/90*i)*16,
j*16+sin(TWO_PI/90*j)*16,
i*16+cos(TWO_PI/90*j)*gray,
j*16+sin(TWO_PI/90*i)*gray
);
}
}
save("56.png");
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment