//My colorful transparent squares float r, g, b, t; //color value variables color box_1, box_2, box_3, box_4; void setup() { size (400, 400); //screen size r = random(0, 255); //sets random number for color value variable g = random(0, 255); b = random(0, 255); t = random(0, 255); //transparency random value box_1 = color(r, g, b, t); //calling a random numerical color series, box_1 r = random(0, 255); g = random(0, 255); b = random(0, 255); t = random(0, 255); box_2 = color(r, g, b, t); //calling a random numerical color series, box_2 r = random(0, 255); g = random(0, 255); b = random(0, 255); t = random(0, 255); box_3 = color(r, g, b, t); //calling a random numerical color series, box_3 r = random(0, 255); g = random(0, 255); b = random(0, 255); t = random(0, 255); box_4 = color(r, g, b, t); //calling a random numerical color series, box_4 } void draw() { translate(mouseX, mouseY); //box moves with mouse coordinates fill(box_1); //fills box with random color rect(200, 200, 50, 50); //box location and size translate(mouseX, mouseY); fill(box_2); rect(0, 0, 50, 50); translate(mouseX, mouseY); fill(box_3); rect(200, 0, 50, 50); translate(mouseX, mouseY); fill(box_4); rect(0, 200, 50, 50); } void mousePressed() { //boxes random colors change on click. r = random(0, 255); g = random(0, 255); b = random(0, 255); t = random(0, 255); box_1 = color(r, g, b, t); r = random(0, 255); g = random(0, 255); b = random(0, 255); t = random(0, 255); box_2 = color(r, g, b, t); r = random(0, 255); g = random(0, 255); b = random(0, 255); t = random(0, 255); box_3 = color(r, g, b, t); r = random(0, 255); g = random(0, 255); b = random(0, 255); t = random(0, 255); box_4 = color(r, g, b, t); }