Square Rai­n­b­o­w tut 14

by Michael McCammon
    /**@peep sketchcode*/
     
    Square[] squares;
    //creating the arrays of squares
     
    void setup() {
      size(500, 500);
      colorMode(HSB, 360, 100, 100);
      squares = new Squares[100];
      for (int i = 0; i < squares.length; i++) {
        squares[i] = new Square();
        squares[i].x = random(width);
        squares[i].y = random(height);
        squares[i].sides = random(10, 40);
        squares[i].colourStroke = color(random(360), 100, 100);
        squares[i].weightS = strokeWeight(random(20-40));
        squares[i].weightS = stroke(0);
      }  
    }
     
    void draw() {
      //noStroke();
      for (int i = 0; i < squares.length; i++) {
        fill(squares[i].colourStroke);
        strokeWeight(squares[i].weightS);
        rect(squares[i].x, squares[i].y, 3*squares[i].sides, 3*squares[i].sides);
      }
    }
     
    class Square {
      float x;
      float y;
      float side;
      float weightS;
      color colourStroke;
    }

    Comments

    Nobody has said anything yet.