Use your mouse/touch pad to interact. Use the keys: R,O,Y,G,B,V,P,+ and space. hold them while dragging your mouse across the screen to make different colours.
xxxxxxxxxx
void setup () {
fullScreen ();
background (220);
strokeWeight (7);
stroke (255);
}
void draw () {
if (mousePressed) {
fill (0,10);
rect (0,0,width,height);
line (mouseX,mouseY,pmouseX,pmouseY);
line (width-mouseX,height-mouseY,width-pmouseX,height-pmouseY);
line (width-mouseX,mouseY,width-pmouseX,pmouseY);
line (mouseX,height-mouseY,pmouseX,height-pmouseY);
}
}
void keyPressed () {
if (key == 'r') {// RED
stroke (255,0,0);
}
if (key == 'o') {// ORANGE
stroke (255,165,0);
}
if (key == 'y') {// YELLOW
stroke (255,255,0);
}
if (key == 'g') {// GREEN
stroke (0,255,0);
}
if (key == 'b') {// BLUE
stroke (0,0,255);
}
if (key == 'V') {// VIOLET
stroke (100,0,255);
}
if (key == 'p') {// PINK
stroke (255,30,255);
}
if (key == '=') {
stroke (random (0,255),random (0,255),random (0,255));
}
if (key == ' ') {
stroke (0);
}
}