Skip to content

Instantly share code, notes, and snippets.

@lisawilliams
Last active December 14, 2015 23:39
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 lisawilliams/5166958 to your computer and use it in GitHub Desktop.
Save lisawilliams/5166958 to your computer and use it in GitHub Desktop.
A small processing sketch demonstrating a for loop.
// Define size of canvas
size(480, 120);
// Set background color (black)
background(0);
// Anti-alias:
smooth();
// making shapes without an outer line:
noStroke();
// For loop drawing circles on black background:
for (int y = 0; y <= height; y += 40) {
for (int x = 0; x <= width; x += 40) {
//color of circles
fill(255, 140);
ellipse(x, y, 40, 40);
fill(219, 51, 85);
ellipse(x, y, 30, 30);
fill(139,135, 136);
ellipse(x, y, 20, 20);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment