Skip to content

Instantly share code, notes, and snippets.

@zamfi
Created February 4, 2022 01:44
Show Gist options
  • Save zamfi/779fc76e7f6d61e766da05553544217f to your computer and use it in GitHub Desktop.
Save zamfi/779fc76e7f6d61e766da05553544217f to your computer and use it in GitHub Desktop.
// "spaced colored squares" -- array edition
colorMode(HSB);
noFill();
var SIZE = 40;
var y = height/2 - SIZE/2;
var squares = [
{ x: 50, y: y },
{ x: 100, y: y },
{ x: 150, y: y },
{ x: 200, y: y },
{ x: 250, y: y }
];
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