Advertisement
valiamaximova1

Rect random colors

Mar 8th, 2019
125
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.38 KB | None | 0 0
  1. int x = 0;
  2. int sizeX = 50;
  3. int sizeY = 50;
  4.  
  5. void setup(){
  6.   size(600,600);
  7.   background(255);
  8.  
  9. }
  10. void draw(){
  11.   noLoop();
  12.   for(int rows = 0; rows < 600; rows = rows + 50){
  13.     for(int cols = 0; cols<600; cols = cols+ 50){
  14. float r = random(0,225);
  15. float g = random(0,255);
  16. float b = random(0,255);
  17.     rect(rows, cols, sizeX, sizeY);
  18.     fill(r, g, b);
  19.    
  20.     }}
  21. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement