Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
added more color options
  • Loading branch information
cor11004 committed Dec 8, 2015
1 parent 971a6d7 commit f9a20a7
Showing 1 changed file with 62 additions and 13 deletions.
75 changes: 62 additions & 13 deletions main/main.pde
Expand Up @@ -8,7 +8,7 @@ boolean removeEdge = false;
Point removeEdgePoint;
boolean colorEdge = false;
Point colorEdgePoint;
int colorFaceColor = 0;
int colorFaceColor = 1;

public void setup() {
size(800, 500);
Expand Down Expand Up @@ -110,11 +110,38 @@ void keyPressed() {
case 'p':
mode = 3;
break;
case 'b':
case 'c':
mode = 4;
break;
case 'g':
mode = 5;
case '0':
colorFaceColor = 0;
break;
case '1':
colorFaceColor = 1;
break;
case '2':
colorFaceColor = 2;
break;
case '3':
colorFaceColor = 3;
break;
case '4':
colorFaceColor = 4;
break;
case '5':
colorFaceColor = 5;
break;
case '6':
colorFaceColor = 6;
break;
case '7':
colorFaceColor = 7;
break;
case '8':
colorFaceColor = 8;
break;
case '9':
colorFaceColor = 9;
break;
}

Expand All @@ -134,11 +161,6 @@ void mouseReleased() {
break;
case 4:
colorFace(x, y);
colorFaceColor = 0;
break;
case 5:
colorFace(x,y);
colorFaceColor = 1;
break;
}
}
Expand All @@ -152,10 +174,37 @@ public void colorFace(float x, float y) {
//System.out.println("h is not null");
Face f = new Face(h, list);
f.printFace();
if(colorFaceColor == 0) {
f.daColoring(0,0,255,list, width, height);
} else if(colorFaceColor ==1) {
f.daColoring(0,255,0,list, width, height);
switch (colorFaceColor) {
case 0:
f.daColoring(255,255,255,list, width, height);
break;
case 1:
f.daColoring(0,0,0,list, width, height);
break;
case 2:
f.daColoring(244, 67, 54,list, width, height);
break;
case 3:
f.daColoring(76, 175, 80,list, width, height);
break;
case 4:
f.daColoring(33, 150, 243,list,width,height);
break;
case 5:
f.daColoring(156, 39, 176,list,width,height);
break;
case 6:
f.daColoring(255, 235, 59,list,width,height);
break;
case 7:
f.daColoring(103, 58, 183,list,width,height);
break;
case 8:
f.daColoring(233, 30, 99,list,width,height);
break;
case 9:
f.daColoring(63, 81, 181,list,width,height);
break;
}
}
}
Expand Down

0 comments on commit f9a20a7

Please sign in to comment.