Created
August 29, 2017 23:17
-
-
Save anonymous/a0757cb4e04756c2ccda3f5692970e71 to your computer and use it in GitHub Desktop.
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
/** | |
* This function draws a fishscale type pattern. | |
* It takes 2 parameters (x and y) which define | |
* the position of the target that is drawn. | |
* x: the distance in pixels from the top left | |
* y: the distance in pixels from the top right | |
**/ | |
void drawFishScales(float x, float y) { | |
noStroke(); | |
for (int i = 0; i < 50; i = i + 5) { | |
if (i%2 == 0) { // this line says "if i is an even number then..." | |
fill(255); // fill in white | |
} | |
else { // otherwise | |
// fill(0); // fill in black | |
fill(random(255)); | |
} | |
ellipse(x, y, 50 - i, 50 - i); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment