Wednesday, February 05, 2014

Random Colours

// just type here
// and click "save" when your done


int i = 0;

void setup()
{
  size(400,400);  
  smooth();  
  background(9,137,235);  
  frameRate(10);
}

void draw()

  pushMatrix();  
  fill(random(0,30),200,10,10);  //
  stroke(random(0,255), random(0,255), random(0,255));  
  strokeWeight(random(1,3));  
  translate(sin(radians(i)) * (i / 2) + (width / 2), cos(radians(i)) * (i / 2) + (height/2));  
  rotate(i);  
  scale(i);  
  strokeWeight(0.4);  
  shape();  
  popMatrix();  
  i++;
}

void shape() 

  line(5,1,1,1); 
  line(1,1,1,5); 
  line(1,5,5,5); 
}

void mousePressed()
{
  background(random(0,255),random(0,255),random(0,255));  
  i=0;  
}

info info

submitted by: technocampsuog
views: 30


Tags: Rotating, Random, Changing

comments comment

loading loading...

 

Add a comment: