int rVal = (int)random(255);
int gVal = (int)random(255);
int bVal = (int)random(255);
PGraphics markDoubleMirror;
newpaint = new Painter();
markMirror = createGraphics(width,height);
markDoubleMirror = createGraphics(width,height);
markRotation = createGraphics(width,height);
markTwoMKal = createGraphics(width,height);
markThreeMKal = createGraphics(width,height);
markTiles = createGraphics(width,height);
dispBackgroundColorValues();
brushColor = color(rVal,gVal,bVal);
markMirror.fill(brushColor);
markMirror.ellipse(newpaint.x, newpaint.y, s, s);
markMirror.ellipse(width-newpaint.x, newpaint.y, s, s);
newpaint.paintDoubleMirror();
markDoubleMirror.beginDraw();
markDoubleMirror.fill(brushColor);
markDoubleMirror.noStroke();
markDoubleMirror.ellipse(newpaint.x, newpaint.y, s, s);
markDoubleMirror.ellipse(width-newpaint.x, newpaint.y, s, s);
markDoubleMirror.ellipse(newpaint.x, height-newpaint.y, s, s);
markDoubleMirror.ellipse(width-newpaint.x, height-newpaint.y, s, s);
markDoubleMirror.endDraw();
image(markDoubleMirror,0,0);
void dispBackgroundColorValues(){
text(nf(rVal,3,0),(width/10)*2,height-15);
text("Press E -",(width/10)*2-50, height-20);
text("+ Press T",(width/10)*2+60, height-20);
text(nf(gVal,3,0),(width/2),height-15);
text("Press F -",(width/2)-50, height-20);
text("+ Press H",(width/2)+60, height-20);
text(nf(bVal,3,0),(width/10)*8,height-15);
text("Press V -",(width/10)*8-50, height-20);
text("+ Press N",(width/10)*8+60, height-20);
triangle(135,25,130,20,130,30);
triangle(10,25,15,20,15,30);
text("Double Mirror",20,31);
text("Two Mirror Kaleidoscope",10,30);
text("Three Mirror Kaleidoscope",10,30);
text("Press C to Clear",(width-160),40);
text("Use left/right arrows to switch layout",width-365,20);
if(key == 'e' && rVal>0){
if(key == 't' && rVal<255){
if(key == 'f' && gVal>0){
if(key == 'h' && gVal<255){
if(key == 'v' && bVal>0){
if(key == 'n' && bVal<255){
if(key=='c' && option==1){
if(key=='c' && option==2){
markDoubleMirror.beginDraw();
markDoubleMirror.clear();
markDoubleMirror.endDraw();
x = x + (targetX - x) * easing;
y = y + (targetY - y) * easing;
ellipse(width-x, y, s, s);
void paintDoubleMirror() {
x = x + (targetX - x) * easing;
y = y + (targetY - y) * easing;
ellipse(width-x, y, s, s);
ellipse(x, height-y, s, s);
ellipse(width-x, height-y, s, s);