xxxxxxxxxx
var size= 50;
var color1= "lightPink";
var color2= "plum";
var color3= "paleTurquoise";
function setup() {
createCanvas(windowWidth, windowHeight);
background("black");
frameRate(20);
}
function draw() {
var whichcolor = floor(random(3));
if(whichcolor==0) fill(color1);
if(whichcolor==1) fill(color2);
if(whichcolor==2) fill(color3);
stroke("white");
strokeWeight(5);
var whichshape = floor(random(2));
if(whichshape==0) ellipse(mouseX, mouseY, size, size);
if(whichshape==1) rect(mouseX, mouseY, size, size);
}
function keyTyped()
{
if(key=='c') background("black");
if(key=='a') { //warm color scheme
color1 = "orangeRed";
color2 = "gold";
color3 = "crimson";
}
if(key=='s') { //cool color scheme
color1 = "lightSeaGreen";
color2 = "limeGreen";
color3 = "blue";
}
if(key=='o') { //original color scheme
color1= "lightPink";
color2= "plum";
color3= "paleTurquoise";
}
if(key=='1') { //increase size
size= size+20;
}
if(key=='2') { //decrease size
size= size-20;
}
}