Created
January 8, 2012 20:00
-
-
Save jordanorelli/1579485 to your computer and use it in GitHub Desktop.
some, errr, lines.
This file contains hidden or 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
size(400, 400); // the default size is too small | |
smooth(); // i don't know why you wouldn't use this for images. | |
background(128); // 50% gray background | |
int lineCount = 20; // number of lines to be drawn | |
int circleDepth = 10; // how "deep" the circle is said to be. | |
int lineSpacing = height / lineCount; // how far apart the lines should be from one another | |
/* the lines should be half as wide as they are far apart, such that the positive | |
and negative space is equal. */ | |
strokeWeight(lineSpacing / 2); | |
for(int i = 0; i < lineCount; i++) { | |
/* draw lineCount number of equally-spaced horizontal lines. */ | |
int lineHeight = i * lineSpacing; | |
noFill(); | |
stroke(0); | |
line(0, lineHeight, width, lineHeight); | |
/* if we're at the circle's "depth", draw the circle. This will be drawn above the lines that | |
were already drawn, but lines drawn in the future will be drawn in front of the circle. */ | |
if(i == circleDepth) { | |
fill(255); | |
noStroke(); | |
ellipse(width / 2, height / 2, width / 4, width / 4); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment