int mode =0; void setup(){ // size(500,500); // size (3000,2000); //6mp size(4000,3000 ); //12mp colorMode(HSB, 3000,100,100); background(#FAFAFA); noStroke(); smooth(); } void draw (){ float x= random (width); float y= random(height); fill(x,y,180, abs(round(255 -(mouseX)))); if ((mousePressed == true)&& mouseButton== LEFT) { mode=1; } if ((mousePressed == true)&& mouseButton== RIGHT) { mode=0; } if ((mousePressed == true)&& mouseButton== CENTER) { mode=2; } if(mode ==0){ rect(x, y, second(), second()); } if(mode ==1){ ellipse(x, y, second(), second()); } if(mode ==2){ //triangle(x, y, round(y/2), second(), second(), second() ); triangle(x, y, mouseY, second(), second(), second() ); } } void keyTyped() { if (int(key) ==32){ // if someone presses space mode =-1; } if (int(key) ==115){ // if someone presses s save("blipper"+day()+"."+month()+"."+year()+"."+hour()+"."+second()+"."+ millis()+".png"); } println("key press: "+int(key) ); }