Skip to content

Instantly share code, notes, and snippets.

@KokoDoko
Created October 11, 2017 11:04
Show Gist options
  • Save KokoDoko/141b4c6dd7de5caf6de4a2114731f581 to your computer and use it in GitHub Desktop.
Save KokoDoko/141b4c6dd7de5caf6de4a2114731f581 to your computer and use it in GitHub Desktop.
void setup(){
size(800,600);
noStroke();
}
void draw(){
}
void mouseDragged(){
drawCircle();
}
void drawCircle(){
float x = getRandomNumber(mouseX-30, mouseX+30);
float y = getRandomNumber(mouseY-30, mouseY+30);
float r = getRandomNumber(0,120);
float red = getRandomNumber(0,255);
float green = getRandomNumber(0,255);
float blue = getRandomNumber(0,255);
fill(red, green, blue);
ellipse(x, y, r, r);
}
float getRandomNumber(int min, int max){
return random(min, max);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment