Skip to content

Instantly share code, notes, and snippets.

@zamfi
Created February 4, 2022 01:39
Show Gist options
  • Save zamfi/c745b719e8b646b81cf185e0b3cfec8f to your computer and use it in GitHub Desktop.
Save zamfi/c745b719e8b646b81cf185e0b3cfec8f to your computer and use it in GitHub Desktop.
// "spaced colored squares" -- object edition
colorMode(HSB);
noFill();
var SIZE = 40;
var squares = [];
for (var x = 50; x <= 250; x = x + 50) {
squares.push({
x: x,
y: height/2 - SIZE/2
});
}
for (var i = 0; i < squares.length; i = i + 1) {
stroke(40,100,100);
rect(squares[i].x, squares[i].y, SIZE, SIZE);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment