/* built with Studio Sketchpad:
* https://sketchpad.cc
*
* observe the evolution of this sketch:
* https://hewitt.sketchpad.cc/sp/pad/view/ro.LUOfPmO83Ya/rev.3
*
* authors:
* Victoria Zoha
* license (unless otherwise specified):
* creative commons attribution-share alike 3.0 license.
* https://creativecommons.org/licenses/by-sa/3.0/
*/
int r, g, b;
int changeR, changeB, changeG;
void setup() {
size(500,500);
background (8,8,8);
r=255;
g=80;
b=200;
changeR=1;
changeG=2;
changeB=3;
}
void draw () {
pushMatrix();
translate (mouseX, mouseY);
fill(r,g,b);
r+=changeR;
g+=changeG;
b+=changeB;
if(r>255 || g<0){
changeR=-changeR;
}
if(g > 255 || g<0){
changeG= -changeG;
}
if(b>255 || b<0){
changeB= -changeB;
}
stroke (255);
strokeWeight(2);
beginShape ();
vertex(0,-50);
vertex(14,-19);
vertex(47,-14);
vertex(25,6);
vertex(28,39);
vertex(0,24);
vertex(-28,30);
vertex(-25,6);
vertex(-47,-14);
vertex(-14,-19);
endShape(CLOSE);
popMatrix();
}
void mousePressed (){
float diameter = random(50);
for(int i=0; i<50; i++){
fill(random(255),random(255),random(255));
ellipse(mouseX+random(-100,100),mouseY+random(-100,100),diameter,diameter);
}
}