ColorfulArt.java
1    package Miscellaneous;
2    
3    import painter.SPainter;
4    import shapes.SCircle;
5    import shapes.SRectangle;
6    import shapes.SSquare;
7    import shapes.SPolygon;
8    
9    import javax.swing.*;
10   import java.awt.*;
11   import java.util.Arrays;
12   import java.util.Scanner;
13   
14   
15   public class ColorfulArt {
16       public static void main(String[] args) {
17           SwingUtilities.invokeLater(() -> {
18               try {new ColorfulArt();
19               } catch (Exception e) {
20                   e.printStackTrace();
21               }
22           });
23       }
24   
25       public ColorfulArt() throws Exception {
26           paintTheImage();
27       }
28   
29       private void paintTheImage() throws Exception {
30           int side = getNumber("Number from 1 to 10");
31           String colorChoice = getColor("Color");
32           String messingWith = getColor("Factor(s) to Mess with: Blue(blue), Red(red), Green(green), Blue&Red(blue&red),\n Red&Green(red&green), Green&Blue(green&blue), Blue&Red&Green(blue&red&green)");
33           String invertWith = getColor("Invert: Blue(blue), Red(red), Green(green), Blue&Red(blue&red), Red&Green(red&green), Green&Blue(green&blue),\n Blue&Red&Green(blue&red&green)");
34           String swapWith = getColor("Swapping: Blue&Red(blue<->red), Red&Green(red<->green), Green&Blue(green<->blue), Blue&Red&Green Left(left_all), Blue&Red&Green Right(right_all)");
35           String shiftingWith = getColor("Shifting: Blue(blue), Red(red), Green(green), Blue&Red(blue&red),\n Red&Green(red&green), Green&Blue(green&blue), Blue&Red&Green(blue&red&green)");
36           int shiftMovement = getNumber("Shifting by how much(from 1 to 255)");
37           String powerWith = getColor("Power: Blue(blue), Red(red), Green(green), Blue&Red(blue&red), Red&Green(red&green), Green&Blue(green&blue), Blue&Red&Green(blue&red&green)");
38           int powerExponent = getNumber("Power by how much(from 1 to 5)");
39           String logWith = getColor("Log: Blue(blue), Red(red), Green(green), Blue&Red(blue&red), Red&Green(red&green), Green&Blue(green&blue), Blue&Red&Green(blue&red&green)");
40           String sqrtWith = getColor("Sqrt: Blue(blue), Red(red), Green(green), Blue&Red(blue&red), Red&Green(red&green), Green&Blue(green&blue), Blue&Red&Green(blue&red&green)");
41           String multiplyWith = getColor("Multiply: Blue(blue), Red(red), Green(green), Blue&Red(blue&red), Red&Green(red&green), Green&Blue(green&blue), Blue&Red&Green(blue&red&green)");
42           int multiplyFactor = getNumber("Multiply by how much(1 to 100)");
43           SPainter painter = new SPainter("Art", side * 100, side * 100);
44           paintImage(painter, colorChoice, messingWith, invertWith, swapWith, shiftingWith, shiftMovement, powerWith, powerExponent, logWith, sqrtWith, multiplyWith, multiplyFactor, side);
45   
46       }
47   
48       private static int getNumber(String prompt) {
49           String nss = JOptionPane.showInputDialog(null, prompt + "?");
50           Scanner scanner = new Scanner(nss);
51           return scanner.nextInt();
52       }
53   
54       private static String getColor(String prompt) {
55           String nss = JOptionPane.showInputDialog(null, prompt + "?");
56           Scanner scanner = new Scanner(nss);
57           return scanner.next();
58       }
59   
60       private void paintImage(SPainter painter, String colorChoice, String messingWith, String invertWith, String swappingWith, String shiftingWith, int shiftMovement, String powerWith, int powerExponent, String logWith, String sqrtWith, String multiplyWith, int multiplyFactor, int side ) throws Exception {
61           SSquare box = new SSquare(side * 100);
62           SSquare box2 = new SSquare(side * 25);
63           SCircle hole = box2.inscribingCircle();
64           SSquare box3 = box2.inscribingCircle().inscribingSquare();
65           SPolygon pyramid = new SPolygon(3, side * 25);
66           SCircle hole2 = pyramid.inscribingCircle();
67           SSquare box4 = new SSquare(side * (37.5 - (12.5 * Math.sqrt(3))));
68           SCircle hole3 = box4.inscribingCircle();
69           SCircle hole4 = new SCircle(hole3.radius() / 2);
70           SSquare box5 = new SSquare(12.5 * side);
71           SCircle hole5 = new SCircle((6.25 / Math.sqrt(2)) * side);
72           SSquare box6 = new SSquare((12.5 / Math.sqrt(2)) * side);
73           SPolygon honeycomb = hole2.inscribingPolygon(6);
74           SSquare box7 = new SSquare(box4.side()/(Math.sqrt(2)));
75           SCircle hole7 = box7.inscribingCircle();
76           SRectangle brick = new SRectangle((box3.side()/(1+(2/Math.sqrt(2)))),box3.side());
77           painter.setColor(selectedColor(colorChoice));
78           painter.paint(box);
79           painter.setColor(colorModif(messingWith, selectedColor(colorChoice)));
80           painter.paint(box2);
81           int i = 0;
82           while (i <= 3) {
83               if (i == 0) {
84                   painter.mfd(side * 37.5);
85                   painter.mlt(side * 37.5);
86                   painter.paint(box2);
87               } else if (i == 1) {
88                   painter.mfd(side * 37.5);
89                   painter.mrt(side * 37.5);
90                   painter.paint(box2);
91               } else if (i == 2) {
92                   painter.mbk(side * 37.5);
93                   painter.mlt(side * 37.5);
94                   painter.paint(box2);
95               } else if (i == 3) {
96                   painter.mbk(side * 37.5);
97                   painter.mrt(side * 37.5);
98                   painter.paint(box2);
99               }
100              painter.setColor(invercolorModif(invertWith, colorModif(messingWith, selectedColor(colorChoice))));
101              painter.paint(hole);
102              painter.setColor(swapcolorModif(swappingWith, invercolorModif(invertWith, colorModif(messingWith, selectedColor(colorChoice)))));
103              painter.paint(box3);
104              painter.moveToCenter();
105              painter.setColor(colorModif(messingWith, selectedColor(colorChoice)));
106              i = i + 1;
107          }
108          painter.setColor(invercolorModif(invertWith, colorModif(messingWith, selectedColor(colorChoice))));
109          painter.paint(hole);
110          painter.setColor(swapcolorModif(swappingWith, invercolorModif(invertWith, colorModif(messingWith, selectedColor(colorChoice)))));
111          painter.paint(box3);
112          int j = 0;
113          while (j <= 3) {
114              painter.setColor(shiftingcolorModif(shiftingWith, swapcolorModif(swappingWith, invercolorModif(invertWith, colorModif(messingWith, selectedColor(colorChoice)))), shiftMovement));
115              painter.mfd(side * 19.53125);
116              painter.paint(pyramid);
117              painter.setColor(powercolorModif(powerWith, shiftingcolorModif(shiftingWith, swapcolorModif(swappingWith, invercolorModif(invertWith, colorModif(messingWith, selectedColor(colorChoice)))), shiftMovement), powerExponent));
118              painter.paint(hole2);
119              painter.moveToCenter();
120              painter.tr();
121              j = j + 1;
122          }
123          int k = 0;
124          while (k <= 3) {
125              painter.setColor(logcolorModif(logWith, powercolorModif(powerWith, shiftingcolorModif(shiftingWith, swapcolorModif(swappingWith, invercolorModif(invertWith, colorModif(messingWith, selectedColor(colorChoice)))), shiftMovement), powerExponent)));
126              if (k == 0) {
127                  painter.mfd(side * (144.140625 - (1.5 * (25 + (25 * Math.sqrt(3))))));
128              } else if (k == 1) {
129                  painter.mrt(side * (144.140625 - (1.5 * (25 + (25 * Math.sqrt(3))))));
130              } else if (k == 2) {
131                  painter.mbk(side * (144.140625 - (1.5 * (25 + (25 * Math.sqrt(3))))));
132              } else {
133                  painter.mlt(side * (144.140625 - (1.5 * (25 + (25 * Math.sqrt(3))))));
134              }
135              painter.paint(box4);
136              painter.setColor(avecolorModif(logcolorModif(logWith, powercolorModif(powerWith, shiftingcolorModif(shiftingWith, swapcolorModif(swappingWith, invercolorModif(invertWith, colorModif(messingWith, selectedColor(colorChoice)))), shiftMovement), powerExponent)), powercolorModif(powerWith, shiftingcolorModif(shiftingWith, swapcolorModif(swappingWith, invercolorModif(invertWith, colorModif(messingWith, selectedColor(colorChoice)))), shiftMovement), powerExponent), shiftingcolorModif(shiftingWith, swapcolorModif(swappingWith, invercolorModif(invertWith, colorModif(messingWith, selectedColor(colorChoice)))), shiftMovement), swapcolorModif(swappingWith, invercolorModif(invertWith, colorModif(messingWith, selectedColor(colorChoice)))), invercolorModif(invertWith, colorModif(messingWith, selectedColor(colorChoice))), colorModif(messingWith, selectedColor(colorChoice)), selectedColor(colorChoice)));
137              if (k % 2 == 0) {
138                  painter.mlt(side * (37.5 - (12.5 * Math.sqrt(3))));
139                  painter.paint(hole3);
140                  painter.setColor(highlowdiffcolormodif(avecolorModif(logcolorModif(logWith, powercolorModif(powerWith, shiftingcolorModif(shiftingWith, swapcolorModif(swappingWith, invercolorModif(invertWith, colorModif(messingWith, selectedColor(colorChoice)))), shiftMovement), powerExponent)), powercolorModif(powerWith, shiftingcolorModif(shiftingWith, swapcolorModif(swappingWith, invercolorModif(invertWith, colorModif(messingWith, selectedColor(colorChoice)))), shiftMovement), powerExponent), shiftingcolorModif(shiftingWith, swapcolorModif(swappingWith, invercolorModif(invertWith, colorModif(messingWith, selectedColor(colorChoice)))), shiftMovement), swapcolorModif(swappingWith, invercolorModif(invertWith, colorModif(messingWith, selectedColor(colorChoice)))), invercolorModif(invertWith, colorModif(messingWith, selectedColor(colorChoice))), colorModif(messingWith, selectedColor(colorChoice)), selectedColor(colorChoice)), logcolorModif(logWith, powercolorModif(powerWith, shiftingcolorModif(shiftingWith, swapcolorModif(swappingWith, invercolorModif(invertWith, colorModif(messingWith, selectedColor(colorChoice)))), shiftMovement), powerExponent)), powercolorModif(powerWith, shiftingcolorModif(shiftingWith, swapcolorModif(swappingWith, invercolorModif(invertWith, colorModif(messingWith, selectedColor(colorChoice)))), shiftMovement), powerExponent), shiftingcolorModif(shiftingWith, swapcolorModif(swappingWith, invercolorModif(invertWith, colorModif(messingWith, selectedColor(colorChoice)))), shiftMovement), swapcolorModif(swappingWith, invercolorModif(invertWith, colorModif(messingWith, selectedColor(colorChoice)))), invercolorModif(invertWith, colorModif(messingWith, selectedColor(colorChoice))), colorModif(messingWith, selectedColor(colorChoice)), selectedColor(colorChoice)));
141                  painter.paint(hole4);
142                  painter.mrt(2 * side * (37.5 - (12.5 * Math.sqrt(3))));
143                  painter.setColor(avecolorModif(logcolorModif(logWith, powercolorModif(powerWith, shiftingcolorModif(shiftingWith, swapcolorModif(swappingWith, invercolorModif(invertWith, colorModif(messingWith, selectedColor(colorChoice)))), shiftMovement), powerExponent)), powercolorModif(powerWith, shiftingcolorModif(shiftingWith, swapcolorModif(swappingWith, invercolorModif(invertWith, colorModif(messingWith, selectedColor(colorChoice)))), shiftMovement), powerExponent), shiftingcolorModif(shiftingWith, swapcolorModif(swappingWith, invercolorModif(invertWith, colorModif(messingWith, selectedColor(colorChoice)))), shiftMovement), swapcolorModif(swappingWith, invercolorModif(invertWith, colorModif(messingWith, selectedColor(colorChoice)))), invercolorModif(invertWith, colorModif(messingWith, selectedColor(colorChoice))), colorModif(messingWith, selectedColor(colorChoice)), selectedColor(colorChoice)));
144                  painter.paint(hole3);
145                  painter.setColor(highlowdiffcolormodif(avecolorModif(logcolorModif(logWith, powercolorModif(powerWith, shiftingcolorModif(shiftingWith, swapcolorModif(swappingWith, invercolorModif(invertWith, colorModif(messingWith, selectedColor(colorChoice)))), shiftMovement), powerExponent)), powercolorModif(powerWith, shiftingcolorModif(shiftingWith, swapcolorModif(swappingWith, invercolorModif(invertWith, colorModif(messingWith, selectedColor(colorChoice)))), shiftMovement), powerExponent), shiftingcolorModif(shiftingWith, swapcolorModif(swappingWith, invercolorModif(invertWith, colorModif(messingWith, selectedColor(colorChoice)))), shiftMovement), swapcolorModif(swappingWith, invercolorModif(invertWith, colorModif(messingWith, selectedColor(colorChoice)))), invercolorModif(invertWith, colorModif(messingWith, selectedColor(colorChoice))), colorModif(messingWith, selectedColor(colorChoice)), selectedColor(colorChoice)), logcolorModif(logWith, powercolorModif(powerWith, shiftingcolorModif(shiftingWith, swapcolorModif(swappingWith, invercolorModif(invertWith, colorModif(messingWith, selectedColor(colorChoice)))), shiftMovement), powerExponent)), powercolorModif(powerWith, shiftingcolorModif(shiftingWith, swapcolorModif(swappingWith, invercolorModif(invertWith, colorModif(messingWith, selectedColor(colorChoice)))), shiftMovement), powerExponent), shiftingcolorModif(shiftingWith, swapcolorModif(swappingWith, invercolorModif(invertWith, colorModif(messingWith, selectedColor(colorChoice)))), shiftMovement), swapcolorModif(swappingWith, invercolorModif(invertWith, colorModif(messingWith, selectedColor(colorChoice)))), invercolorModif(invertWith, colorModif(messingWith, selectedColor(colorChoice))), colorModif(messingWith, selectedColor(colorChoice)), selectedColor(colorChoice)));
146                  painter.paint(hole4);
147              } else {
148                  painter.mfd(side * (37.5 - (12.5 * Math.sqrt(3))));
149                  painter.paint(hole3);
150                  painter.setColor(highlowdiffcolormodif(avecolorModif(logcolorModif(logWith, powercolorModif(powerWith, shiftingcolorModif(shiftingWith, swapcolorModif(swappingWith, invercolorModif(invertWith, colorModif(messingWith, selectedColor(colorChoice)))), shiftMovement), powerExponent)), powercolorModif(powerWith, shiftingcolorModif(shiftingWith, swapcolorModif(swappingWith, invercolorModif(invertWith, colorModif(messingWith, selectedColor(colorChoice)))), shiftMovement), powerExponent), shiftingcolorModif(shiftingWith, swapcolorModif(swappingWith, invercolorModif(invertWith, colorModif(messingWith, selectedColor(colorChoice)))), shiftMovement), swapcolorModif(swappingWith, invercolorModif(invertWith, colorModif(messingWith, selectedColor(colorChoice)))), invercolorModif(invertWith, colorModif(messingWith, selectedColor(colorChoice))), colorModif(messingWith, selectedColor(colorChoice)), selectedColor(colorChoice)), logcolorModif(logWith, powercolorModif(powerWith, shiftingcolorModif(shiftingWith, swapcolorModif(swappingWith, invercolorModif(invertWith, colorModif(messingWith, selectedColor(colorChoice)))), shiftMovement), powerExponent)), powercolorModif(powerWith, shiftingcolorModif(shiftingWith, swapcolorModif(swappingWith, invercolorModif(invertWith, colorModif(messingWith, selectedColor(colorChoice)))), shiftMovement), powerExponent), shiftingcolorModif(shiftingWith, swapcolorModif(swappingWith, invercolorModif(invertWith, colorModif(messingWith, selectedColor(colorChoice)))), shiftMovement), swapcolorModif(swappingWith, invercolorModif(invertWith, colorModif(messingWith, selectedColor(colorChoice)))), invercolorModif(invertWith, colorModif(messingWith, selectedColor(colorChoice))), colorModif(messingWith, selectedColor(colorChoice)), selectedColor(colorChoice)));
151                  painter.paint(hole4);
152                  painter.mbk(2 * side * (37.5 - (12.5 * Math.sqrt(3))));
153                  painter.setColor(avecolorModif(logcolorModif(logWith, powercolorModif(powerWith, shiftingcolorModif(shiftingWith, swapcolorModif(swappingWith, invercolorModif(invertWith, colorModif(messingWith, selectedColor(colorChoice)))), shiftMovement), powerExponent)), powercolorModif(powerWith, shiftingcolorModif(shiftingWith, swapcolorModif(swappingWith, invercolorModif(invertWith, colorModif(messingWith, selectedColor(colorChoice)))), shiftMovement), powerExponent), shiftingcolorModif(shiftingWith, swapcolorModif(swappingWith, invercolorModif(invertWith, colorModif(messingWith, selectedColor(colorChoice)))), shiftMovement), swapcolorModif(swappingWith, invercolorModif(invertWith, colorModif(messingWith, selectedColor(colorChoice)))), invercolorModif(invertWith, colorModif(messingWith, selectedColor(colorChoice))), colorModif(messingWith, selectedColor(colorChoice)), selectedColor(colorChoice)));
154                  painter.paint(hole3);
155                  painter.setColor(highlowdiffcolormodif(avecolorModif(logcolorModif(logWith, powercolorModif(powerWith, shiftingcolorModif(shiftingWith, swapcolorModif(swappingWith, invercolorModif(invertWith, colorModif(messingWith, selectedColor(colorChoice)))), shiftMovement), powerExponent)), powercolorModif(powerWith, shiftingcolorModif(shiftingWith, swapcolorModif(swappingWith, invercolorModif(invertWith, colorModif(messingWith, selectedColor(colorChoice)))), shiftMovement), powerExponent), shiftingcolorModif(shiftingWith, swapcolorModif(swappingWith, invercolorModif(invertWith, colorModif(messingWith, selectedColor(colorChoice)))), shiftMovement), swapcolorModif(swappingWith, invercolorModif(invertWith, colorModif(messingWith, selectedColor(colorChoice)))), invercolorModif(invertWith, colorModif(messingWith, selectedColor(colorChoice))), colorModif(messingWith, selectedColor(colorChoice)), selectedColor(colorChoice)), logcolorModif(logWith, powercolorModif(powerWith, shiftingcolorModif(shiftingWith, swapcolorModif(swappingWith, invercolorModif(invertWith, colorModif(messingWith, selectedColor(colorChoice)))), shiftMovement), powerExponent)), powercolorModif(powerWith, shiftingcolorModif(shiftingWith, swapcolorModif(swappingWith, invercolorModif(invertWith, colorModif(messingWith, selectedColor(colorChoice)))), shiftMovement), powerExponent), shiftingcolorModif(shiftingWith, swapcolorModif(swappingWith, invercolorModif(invertWith, colorModif(messingWith, selectedColor(colorChoice)))), shiftMovement), swapcolorModif(swappingWith, invercolorModif(invertWith, colorModif(messingWith, selectedColor(colorChoice)))), invercolorModif(invertWith, colorModif(messingWith, selectedColor(colorChoice))), colorModif(messingWith, selectedColor(colorChoice)), selectedColor(colorChoice)));
156                  painter.paint(hole4);
157              }
158              painter.moveToCenter();
159              k = k + 1;
160          }
161          painter.setColor(sqrtcolorModif(sqrtWith, highlowdiffcolormodif(avecolorModif(logcolorModif(logWith, powercolorModif(powerWith, shiftingcolorModif(shiftingWith, swapcolorModif(swappingWith, invercolorModif(invertWith, colorModif(messingWith, selectedColor(colorChoice)))), shiftMovement), powerExponent)), powercolorModif(powerWith, shiftingcolorModif(shiftingWith, swapcolorModif(swappingWith, invercolorModif(invertWith, colorModif(messingWith, selectedColor(colorChoice)))), shiftMovement), powerExponent), shiftingcolorModif(shiftingWith, swapcolorModif(swappingWith, invercolorModif(invertWith, colorModif(messingWith, selectedColor(colorChoice)))), shiftMovement), swapcolorModif(swappingWith, invercolorModif(invertWith, colorModif(messingWith, selectedColor(colorChoice)))), invercolorModif(invertWith, colorModif(messingWith, selectedColor(colorChoice))), colorModif(messingWith, selectedColor(colorChoice)), selectedColor(colorChoice)), logcolorModif(logWith, powercolorModif(powerWith, shiftingcolorModif(shiftingWith, swapcolorModif(swappingWith, invercolorModif(invertWith, colorModif(messingWith, selectedColor(colorChoice)))), shiftMovement), powerExponent)), powercolorModif(powerWith, shiftingcolorModif(shiftingWith, swapcolorModif(swappingWith, invercolorModif(invertWith, colorModif(messingWith, selectedColor(colorChoice)))), shiftMovement), powerExponent), shiftingcolorModif(shiftingWith, swapcolorModif(swappingWith, invercolorModif(invertWith, colorModif(messingWith, selectedColor(colorChoice)))), shiftMovement), swapcolorModif(swappingWith, invercolorModif(invertWith, colorModif(messingWith, selectedColor(colorChoice)))), invercolorModif(invertWith, colorModif(messingWith, selectedColor(colorChoice))), colorModif(messingWith, selectedColor(colorChoice)), selectedColor(colorChoice))));
162          int l = 0;
163          while (l <= 3) {
164              if (l == 0) {
165                  painter.mlt(side * 18.75);
166                  painter.mbk(side * 18.75);
167              } else if (l == 1) {
168                  painter.mlt(side * 18.75);
169                  painter.mfd(side * 18.75);
170              } else if (l == 2) {
171                  painter.mrt(side * 18.75);
172                  painter.mbk(side * 18.75);
173              } else if (l == 3) {
174                  painter.mrt(side * 18.75);
175                  painter.mfd(side * 18.75);
176              }
177              painter.paint(box5);
178              painter.moveToCenter();
179              l = l + 1;
180          }
181          int m = 0;
182          while (m <= 3) {
183              if (m == 0) {
184                  painter.mlt(side * (6.25 / Math.sqrt(2)));
185                  painter.mbk(side * (6.25 / Math.sqrt(2)));
186              } else if (m == 1) {
187                  painter.mlt(side * (6.25 / Math.sqrt(2)));
188                  painter.mfd(side * (6.25 / Math.sqrt(2)));
189              } else if (m == 2) {
190                  painter.mrt(side * (6.25 / Math.sqrt(2)));
191                  painter.mbk(side * (6.25 / Math.sqrt(2)));
192              } else if (m == 3) {
193                  painter.mrt(side * (6.25 / Math.sqrt(2)));
194                  painter.mfd(side * (6.25 / Math.sqrt(2)));
195              }
196              painter.setColor(reciprocalcolorModif(sqrtcolorModif(sqrtWith, highlowdiffcolormodif(avecolorModif(logcolorModif(logWith, powercolorModif(powerWith, shiftingcolorModif(shiftingWith, swapcolorModif(swappingWith, invercolorModif(invertWith, colorModif(messingWith, selectedColor(colorChoice)))), shiftMovement), powerExponent)), powercolorModif(powerWith, shiftingcolorModif(shiftingWith, swapcolorModif(swappingWith, invercolorModif(invertWith, colorModif(messingWith, selectedColor(colorChoice)))), shiftMovement), powerExponent), shiftingcolorModif(shiftingWith, swapcolorModif(swappingWith, invercolorModif(invertWith, colorModif(messingWith, selectedColor(colorChoice)))), shiftMovement), swapcolorModif(swappingWith, invercolorModif(invertWith, colorModif(messingWith, selectedColor(colorChoice)))), invercolorModif(invertWith, colorModif(messingWith, selectedColor(colorChoice))), colorModif(messingWith, selectedColor(colorChoice)), selectedColor(colorChoice)), logcolorModif(logWith, powercolorModif(powerWith, shiftingcolorModif(shiftingWith, swapcolorModif(swappingWith, invercolorModif(invertWith, colorModif(messingWith, selectedColor(colorChoice)))), shiftMovement), powerExponent)), powercolorModif(powerWith, shiftingcolorModif(shiftingWith, swapcolorModif(swappingWith, invercolorModif(invertWith, colorModif(messingWith, selectedColor(colorChoice)))), shiftMovement), powerExponent), shiftingcolorModif(shiftingWith, swapcolorModif(swappingWith, invercolorModif(invertWith, colorModif(messingWith, selectedColor(colorChoice)))), shiftMovement), swapcolorModif(swappingWith, invercolorModif(invertWith, colorModif(messingWith, selectedColor(colorChoice)))), invercolorModif(invertWith, colorModif(messingWith, selectedColor(colorChoice))), colorModif(messingWith, selectedColor(colorChoice)), selectedColor(colorChoice)))));
197              painter.paint(hole5);
198              painter.moveToCenter();
199              m = m + 1;
200          }
201          painter.tr(45);
202          painter.setColor(productcolorModif(selectedColor(colorChoice), colorModif(messingWith, selectedColor(colorChoice)), invercolorModif(invertWith, colorModif(messingWith, selectedColor(colorChoice)))));
203          int n = 0;
204          while (n <= 3) {
205              if (n == 0) {
206                  painter.mlt(side * 18.75 * Math.sqrt(2));
207              } else if (n == 1) {
208                  painter.mfd(side * 18.75 * Math.sqrt(2));
209              } else if (n == 2) {
210                  painter.mbk(side * 18.75 * Math.sqrt(2));
211              } else if (n == 3) {
212                  painter.mrt(side * 18.75 * Math.sqrt(2));
213              }
214              painter.paint(box6);
215              painter.moveToCenter();
216              n = n + 1;
217          }
218          painter.tl(45);
219          int o = 0;
220          while (o <= 3) {
221              if (o == 0) {
222                  painter.mlt(side*19.580078125);
223              } else if (o == 1) {
224                  painter.mrt(side*19.580078125);
225              } else if (o == 2) {
226                  painter.tr();
227                  painter.mlt(side*19.580078125);
228              } else if (o == 3) {
229                  painter.mrt(side*19.580078125);
230              }
231              painter.setColor(binarycolorModif(productcolorModif(selectedColor(colorChoice), colorModif(messingWith, selectedColor(colorChoice)), invercolorModif(invertWith, colorModif(messingWith, selectedColor(colorChoice))))));
232              painter.paint(honeycomb);
233              painter.moveToCenter();
234              o = o + 1;
235          }
236          painter.tr(45);
237          int p = 0;
238          while (p <= 3){
239              if (p == 0) {
240                  painter.mrt(side * ((144.140625 - (1.5 * (25 + (25 * Math.sqrt(3)))))/Math.sqrt(2)));
241                  painter.mfd(side * ((144.140625 - (1.5 * (25 + (25 * Math.sqrt(3)))))/Math.sqrt(2)));
242              } else if (p == 1) {
243                  painter.mlt(side * ((144.140625 - (1.5 * (25 + (25 * Math.sqrt(3)))))/Math.sqrt(2)));
244                  painter.mfd(side * ((144.140625 - (1.5 * (25 + (25 * Math.sqrt(3)))))/Math.sqrt(2)));
245              } else if (p == 2) {
246                  painter.mrt(side * ((144.140625 - (1.5 * (25 + (25 * Math.sqrt(3)))))/Math.sqrt(2)));
247                  painter.mbk(side * ((144.140625 - (1.5 * (25 + (25 * Math.sqrt(3)))))/Math.sqrt(2)));
248              } else if (p == 3) {
249                  painter.mlt(side * ((144.140625 - (1.5 * (25 + (25 * Math.sqrt(3)))))/Math.sqrt(2)));
250                  painter.mbk(side * ((144.140625 - (1.5 * (25 + (25 * Math.sqrt(3)))))/Math.sqrt(2)));
251              }
252              painter.setColor(mediancolorModif(selectedColor(colorChoice),colorModif(messingWith,selectedColor(colorChoice)),invercolorModif(invertWith,colorModif(messingWith,selectedColor(colorChoice))),binarycolorModif(productcolorModif(selectedColor(colorChoice), colorModif(messingWith, selectedColor(colorChoice)), invercolorModif(invertWith, colorModif(messingWith, selectedColor(colorChoice)))))));
253              painter.paint(box7);
254              painter.setColor(multiplycolorModif(multiplyWith,mediancolorModif(selectedColor(colorChoice),colorModif(messingWith,selectedColor(colorChoice)),invercolorModif(invertWith,colorModif(messingWith,selectedColor(colorChoice))),binarycolorModif(productcolorModif(selectedColor(colorChoice), colorModif(messingWith, selectedColor(colorChoice)), invercolorModif(invertWith, colorModif(messingWith, selectedColor(colorChoice)))))),multiplyFactor));
255              painter.paint(hole7);
256              painter.moveToCenter();
257              p = p + 1;
258          }
259          painter.tl(45);
260          int q = 0;
261          while (q <= 3) {
262              if (q == 0) {
263                  painter.mfd(side * 37.5);
264                  painter.mlt(side * 37.5);
265              } else if (q == 1) {
266                  painter.mfd(side * 37.5);
267                  painter.mrt(side * 37.5);
268              } else if (q == 2){
269                  painter.mbk(side * 37.5);
270                  painter.mlt(side * 37.5);
271              } else if (q == 3) {
272                  painter.mbk(side * 37.5);
273                  painter.mrt(side * 37.5);
274              }
275              painter.setColor(sumcolorModif(multiplycolorModif(multiplyWith,mediancolorModif(selectedColor(colorChoice),colorModif(messingWith,selectedColor(colorChoice)),invercolorModif(invertWith,colorModif(messingWith,selectedColor(colorChoice))),binarycolorModif(productcolorModif(selectedColor(colorChoice), colorModif(messingWith, selectedColor(colorChoice)), invercolorModif(invertWith, colorModif(messingWith, selectedColor(colorChoice)))))),multiplyFactor),highlowdiffcolormodif(avecolorModif(logcolorModif(logWith, powercolorModif(powerWith, shiftingcolorModif(shiftingWith, swapcolorModif(swappingWith, invercolorModif(invertWith, colorModif(messingWith, selectedColor(colorChoice)))), shiftMovement), powerExponent)), powercolorModif(powerWith, shiftingcolorModif(shiftingWith, swapcolorModif(swappingWith, invercolorModif(invertWith, colorModif(messingWith, selectedColor(colorChoice)))), shiftMovement), powerExponent), shiftingcolorModif(shiftingWith, swapcolorModif(swappingWith, invercolorModif(invertWith, colorModif(messingWith, selectedColor(colorChoice)))), shiftMovement), swapcolorModif(swappingWith, invercolorModif(invertWith, colorModif(messingWith, selectedColor(colorChoice)))), invercolorModif(invertWith, colorModif(messingWith, selectedColor(colorChoice))), colorModif(messingWith, selectedColor(colorChoice)), selectedColor(colorChoice)), logcolorModif(logWith, powercolorModif(powerWith, shiftingcolorModif(shiftingWith, swapcolorModif(swappingWith, invercolorModif(invertWith, colorModif(messingWith, selectedColor(colorChoice)))), shiftMovement), powerExponent)), powercolorModif(powerWith, shiftingcolorModif(shiftingWith, swapcolorModif(swappingWith, invercolorModif(invertWith, colorModif(messingWith, selectedColor(colorChoice)))), shiftMovement), powerExponent), shiftingcolorModif(shiftingWith, swapcolorModif(swappingWith, invercolorModif(invertWith, colorModif(messingWith, selectedColor(colorChoice)))), shiftMovement), swapcolorModif(swappingWith, invercolorModif(invertWith, colorModif(messingWith, selectedColor(colorChoice)))), invercolorModif(invertWith, colorModif(messingWith, selectedColor(colorChoice))), colorModif(messingWith, selectedColor(colorChoice)), selectedColor(colorChoice)), selectedColor(colorChoice)));
276              painter.paint(brick);
277              painter.tr(45);
278              painter.paint(brick);
279              painter.tr(45);
280              painter.paint(brick);
281              painter.tr(45);
282              painter.paint(brick);
283              painter.tr(225);
284              painter.moveToCenter();
285              q = q + 1;
286          }
287      }
288  
289          private Color selectedColor(String colorChoice) throws Exception {
290              if (colorChoice.equalsIgnoreCase("blue")) {
291                  int r = 0;
292                  int g = 0;
293                  int b = 255;
294                  return new Color(r, g, b);
295              } else if (colorChoice.equalsIgnoreCase("red")) {
296                  int r = 255;
297                  int g = 0;
298                  int b = 0;
299                  return new Color(r, g, b);
300              } else if (colorChoice.equalsIgnoreCase("green")) {
301                  int r = 0;
302                  int g = 255;
303                  int b = 0;
304                  return new Color(r, g, b);
305              } else if (colorChoice.equalsIgnoreCase("black")) {
306                  int r = 0;
307                  int g = 0;
308                  int b = 0;
309                  return new Color(r, g, b);
310              } else if (colorChoice.equalsIgnoreCase("white")) {
311                  int r = 255;
312                  int g = 255;
313                  int b = 255;
314                  return new Color(r, g, b);
315              } else if (colorChoice.equalsIgnoreCase("orange")) {
316                  int r = 255;
317                  int g = 165;
318                  int b = 0;
319                  return new Color(r, g, b);
320              } else if (colorChoice.equalsIgnoreCase("yellow")) {
321                  int r = 255;
322                  int g = 255;
323                  int b = 0;
324                  return new Color(r, g, b);
325              } else if (colorChoice.equalsIgnoreCase("purple")) {
326                  int r = 128;
327                  int g = 0;
328                  int b = 128;
329                  return new Color(r, g, b);
330              } else if (colorChoice.equalsIgnoreCase("pink")) {
331                  int r = 255;
332                  int g = 192;
333                  int b = 203;
334                  return new Color(r, g, b);
335              } else if (colorChoice.equalsIgnoreCase("cyan")) {
336                  int r = 0;
337                  int g = 255;
338                  int b = 255;
339                  return new Color(r, g, b);
340              } else if (colorChoice.equalsIgnoreCase("magenta")) {
341                  int r = 255;
342                  int g = 0;
343                  int b = 255;
344                  return new Color(r, g, b);
345              } else if (colorChoice.equalsIgnoreCase("maroon")) {
346                  int r = 128;
347                  int g = 0;
348                  int b = 0;
349                  return new Color(r, g, b);
350              } else if (colorChoice.equalsIgnoreCase("beige")) {
351                  int r = 255;
352                  int g = 255;
353                  int b = 220;
354                  return new Color(r, g, b);
355              } else if (colorChoice.equalsIgnoreCase("violet")) {
356                  int r = 238;
357                  int g = 130;
358                  int b = 238;
359                  return new Color(r, g, b);
360              } else if (colorChoice.equalsIgnoreCase("silver")) {
361                  int r = 192;
362                  int g = 192;
363                  int b = 192;
364                  return new Color(r, g, b);
365              } else if (colorChoice.equalsIgnoreCase("indigo")) {
366                  int r = 75;
367                  int g = 0;
368                  int b = 130;
369                  return new Color(r, g, b);
370              } else if (colorChoice.equalsIgnoreCase("gold")) {
371                  int r = 255;
372                  int g = 215;
373                  int b = 0;
374                  return new Color(r, g, b);
375              } else if (colorChoice.equalsIgnoreCase("olive")) {
376                  int r = 128;
377                  int g = 128;
378                  int b = 0;
379                  return new Color(r, g, b);
380              } else if (colorChoice.equalsIgnoreCase("brown")) {
381                  int r = 165;
382                  int g = 42;
383                  int b = 42;
384                  return new Color(r, g, b);
385              } else if (colorChoice.equalsIgnoreCase("crimson")) {
386                  int r = 220;
387                  int g = 20;
388                  int b = 60;
389                  return new Color(r, g, b);
390              } else if (colorChoice.equalsIgnoreCase("chartreuse")) {
391                  int r = 127;
392                  int g = 255;
393                  int b = 0;
394                  return new Color(r, g, b);
395              } else if (colorChoice.equalsIgnoreCase("chocolate")) {
396                  int r = 210;
397                  int g = 105;
398                  int b = 30;
399                  return new Color(r, g, b);
400              } else if (colorChoice.equalsIgnoreCase("lavender")) {
401                  int r = 230;
402                  int g = 230;
403                  int b = 250;
404                  return new Color(r, g, b);
405              } else if (colorChoice.equalsIgnoreCase("aquamarine")) {
406                  int r = 127;
407                  int g = 255;
408                  int b = 212;
409                  return new Color(r, g, b);
410              } else if (colorChoice.equalsIgnoreCase("turquoise")) {
411                  int r = 64;
412                  int g = 224;
413                  int b = 208;
414                  return new Color(r, g, b);
415              } else if (colorChoice.equalsIgnoreCase("tan")) {
416                  int r = 210;
417                  int g = 180;
418                  int b = 140;
419                  return new Color(r, g, b);
420              } else if (colorChoice.equalsIgnoreCase("lime")) {
421                  int r = 0;
422                  int g = 255;
423                  int b = 0;
424                  return new Color(r, g, b);
425              } else if (colorChoice.equalsIgnoreCase("navy")) {
426                  int r = 0;
427                  int g = 0;
428                  int b = 128;
429                  return new Color(r, g, b);
430              } else if (colorChoice.equalsIgnoreCase("plum")) {
431                  int r = 221;
432                  int g = 160;
433                  int b = 221;
434                  return new Color(r, g, b);
435              } else if (colorChoice.equalsIgnoreCase("teal")) {
436                  int r = 0;
437                  int g = 128;
438                  int b = 128;
439                  return new Color(r, g, b);
440              } else if (colorChoice.equalsIgnoreCase("bronze")) {
441                  int r = 205;
442                  int g = 127;
443                  int b = 50;
444                  return new Color(r, g, b);
445              } else if (colorChoice.equalsIgnoreCase("bisque")) {
446                  int r = 255;
447                  int g = 228;
448                  int b = 196;
449                  return new Color(r, g, b);
450              } else if (colorChoice.equalsIgnoreCase("fuchsia")) {
451                  int r = 255;
452                  int g = 0;
453                  int b = 255;
454                  return new Color(r, g, b);
455              } else if (colorChoice.equalsIgnoreCase("peru")) {
456                  int r = 255;
457                  int g = 133;
458                  int b = 63;
459                  return new Color(r, g, b);
460              } else if (colorChoice.equalsIgnoreCase("coral")) {
461                  int r = 255;
462                  int g = 127;
463                  int b = 50;
464                  return new Color(r, g, b);
465              } else if (colorChoice.equalsIgnoreCase("cornsilk")) {
466                  int r = 255;
467                  int g = 248;
468                  int b = 220;
469                  return new Color(r, g, b);
470              } else if (colorChoice.equalsIgnoreCase("gainsboro")) {
471                  int r = 220;
472                  int g = 220;
473                  int b = 220;
474                  return new Color(r, g, b);
475              } else if (colorChoice.equalsIgnoreCase("ivory")) {
476                  int r = 255;
477                  int g = 255;
478                  int b = 240;
479                  return new Color(r, g, b);
480              } else if (colorChoice.equalsIgnoreCase("linen")) {
481                  int r = 250;
482                  int g = 240;
483                  int b = 230;
484                  return new Color(r, g, b);
485              } else if (colorChoice.equalsIgnoreCase("khaki")) {
486                  int r = 240;
487                  int g = 230;
488                  int b = 140;
489                  return new Color(r, g, b);
490              } else if (colorChoice.equalsIgnoreCase("moccasin")) {
491                  int r = 255;
492                  int g = 228;
493                  int b = 181;
494                  return new Color(r, g, b);
495              } else if (colorChoice.equalsIgnoreCase("orchid")) {
496                  int r = 218;
497                  int g = 122;
498                  int b = 214;
499                  return new Color(r, g, b);
500              } else if (colorChoice.equalsIgnoreCase("salmon")) {
501                  int r = 250;
502                  int g = 128;
503                  int b = 114;
504                  return new Color(r, g, b);
505              } else if (colorChoice.equalsIgnoreCase("snow")) {
506                  int r = 255;
507                  int g = 250;
508                  int b = 250;
509                  return new Color(r, g, b);
510              } else if (colorChoice.equalsIgnoreCase("thistle")) {
511                  int r = 216;
512                  int g = 191;
513                  int b = 216;
514                  return new Color(r, g, b);
515              } else if (colorChoice.equalsIgnoreCase("tomato")) {
516                  int r = 255;
517                  int g = 99;
518                  int b = 71;
519                  return new Color(r, g, b);
520              } else if (colorChoice.equalsIgnoreCase("wheat")) {
521                  int r = 245;
522                  int g = 222;
523                  int b = 179;
524                  return new Color(r, g, b);
525              } else if (colorChoice.equalsIgnoreCase("night")) {
526                  int r = 12;
527                  int g = 9;
528                  int b = 10;
529                  return new Color(r, g, b);
530              } else if (colorChoice.equalsIgnoreCase("charcoal")) {
531                  int r = 54;
532                  int g = 40;
533                  int b = 44;
534                  return new Color(r, g, b);
535              } else if (colorChoice.equalsIgnoreCase("oil")) {
536                  int r = 59;
537                  int g = 49;
538                  int b = 49;
539                  return new Color(r, g, b);
540              } else if (colorChoice.equalsIgnoreCase("iridium")) {
541                  int r = 61;
542                  int g = 60;
543                  int b = 58;
544                  return new Color(r, g, b);
545              } else if (colorChoice.equalsIgnoreCase("granite")) {
546                  int r = 131;
547                  int g = 126;
548                  int b = 124;
549                  return new Color(r, g, b);
550              } else if (colorChoice.equalsIgnoreCase("platinum")) {
551                  int r = 229;
552                  int g = 228;
553                  int b = 226;
554                  return new Color(r, g, b);
555              } else if (colorChoice.equalsIgnoreCase("iceberg")) {
556                  int r = 86;
557                  int g = 165;
558                  int b = 236;
559                  return new Color(r, g, b);
560              } else if (colorChoice.equalsIgnoreCase("water")) {
561                  int r = 235;
562                  int g = 244;
563                  int b = 250;
564                  return new Color(r, g, b);
565              } else if (colorChoice.equalsIgnoreCase("celeste")) {
566                  int r = 80;
567                  int g = 235;
568                  int b = 236;
569                  return new Color(r, g, b);
570              } else if (colorChoice.equalsIgnoreCase("jellyfish")) {
571                  int r = 70;
572                  int g = 179;
573                  int b = 179;
574                  return new Color(r, g, b);
575              } else if (colorChoice.equalsIgnoreCase("gunmetal")) {
576                  int r = 44;
577                  int g = 53;
578                  int b = 57;
579                  return new Color(r, g, b);
580              } else if (colorChoice.equalsIgnoreCase("jade")) {
581                  int r = 0;
582                  int g = 163;
583                  int b = 108;
584                  return new Color(r, g, b);
585              } else if (colorChoice.equalsIgnoreCase("emerald")) {
586                  int r = 80;
587                  int g = 200;
588                  int b = 120;
589                  return new Color(r, g, b);
590              } else if (colorChoice.equalsIgnoreCase("mint")) {
591                  int r = 62;
592                  int g = 180;
593                  int b = 137;
594                  return new Color(r, g, b);
595              } else if (colorChoice.equalsIgnoreCase("parchment")) {
596                  int r = 255;
597                  int g = 255;
598                  int b = 194;
599                  return new Color(r, g, b);
600              } else if (colorChoice.equalsIgnoreCase("cream")) {
601                  int r = 255;
602                  int g = 255;
603                  int b = 204;
604                  return new Color(r, g, b);
605              } else if (colorChoice.equalsIgnoreCase("blonde")) {
606                  int r = 251;
607                  int g = 246;
608                  int b = 217;
609                  return new Color(r, g, b);
610              } else if (colorChoice.equalsIgnoreCase("champagne")) {
611                  int r = 248;
612                  int g = 231;
613                  int b = 206;
614                  return new Color(r, g, b);
615              } else if (colorChoice.equalsIgnoreCase("peach")) {
616                  int r = 255;
617                  int g = 229;
618                  int b = 180;
619                  return new Color(r, g, b);
620              } else if (colorChoice.equalsIgnoreCase("saffron")) {
621                  int r = 251;
622                  int g = 185;
623                  int b = 23;
624                  return new Color(r, g, b);
625              } else if (colorChoice.equalsIgnoreCase("vanilla")) {
626                  int r = 243;
627                  int g = 229;
628                  int b = 179;
629                  return new Color(r, g, b);
630              } else if (colorChoice.equalsIgnoreCase("beer")) {
631                  int r = 251;
632                  int g = 177;
633                  int b = 23;
634                  return new Color(r, g, b);
635              } else if (colorChoice.equalsIgnoreCase("sand")) {
636                  int r = 194;
637                  int g = 178;
638                  int b = 128;
639                  return new Color(r, g, b);
640              } else if (colorChoice.equalsIgnoreCase("sage")) {
641                  int r = 188;
642                  int g = 184;
643                  int b = 138;
644                  return new Color(r, g, b);
645              } else if (colorChoice.equalsIgnoreCase("brass")) {
646                  int r = 181;
647                  int g = 166;
648                  int b = 66;
649                  return new Color(r, g, b);
650              } else if (colorChoice.equalsIgnoreCase("caramel")) {
651                  int r = 198;
652                  int g = 142;
653                  int b = 23;
654                  return new Color(r, g, b);
655              } else if (colorChoice.equalsIgnoreCase("cinnamon")) {
656                  int r = 197;
657                  int g = 137;
658                  int b = 23;
659                  return new Color(r, g, b);
660              } else if (colorChoice.equalsIgnoreCase("copper")) {
661                  int r = 184;
662                  int g = 115;
663                  int b = 51;
664                  return new Color(r, g, b);
665              } else if (colorChoice.equalsIgnoreCase("hazel")) {
666                  int r = 142;
667                  int g = 118;
668                  int b = 24;
669                  return new Color(r, g, b);
670              } else if (colorChoice.equalsIgnoreCase("wood")) {
671                  int r = 150;
672                  int g = 111;
673                  int b = 51;
674                  return new Color(r, g, b);
675              } else if (colorChoice.equalsIgnoreCase("sandstone")) {
676                  int r = 120;
677                  int g = 109;
678                  int b = 95;
679                  return new Color(r, g, b);
680              } else if (colorChoice.equalsIgnoreCase("taupe")) {
681                  int r = 72;
682                  int g = 60;
683                  int b = 50;
684                  return new Color(r, g, b);
685              } else if (colorChoice.equalsIgnoreCase("mocha")) {
686                  int r = 73;
687                  int g = 61;
688                  int b = 28;
689                  return new Color(r, g, b);
690              } else if (colorChoice.equalsIgnoreCase("coffee")) {
691                  int r = 111;
692                  int g = 78;
693                  int b = 55;
694                  return new Color(r, g, b);
695              } else if (colorChoice.equalsIgnoreCase("sepia")) {
696                  int r = 127;
697                  int g = 70;
698                  int b = 44;
699                  return new Color(r, g, b);
700              } else if (colorChoice.equalsIgnoreCase("sienna")) {
701                  int r = 160;
702                  int g = 82;
703                  int b = 45;
704                  return new Color(r, g, b);
705              } else if (colorChoice.equalsIgnoreCase("sangria")) {
706                  int r = 126;
707                  int g = 56;
708                  int b = 23;
709                  return new Color(r, g, b);
710              } else if (colorChoice.equalsIgnoreCase("chestnut")) {
711                  int r = 149;
712                  int g = 69;
713                  int b = 53;
714                  return new Color(r, g, b);
715              } else if (colorChoice.equalsIgnoreCase("mahogany")) {
716                  int r = 192;
717                  int g = 64;
718                  int b = 0;
719                  return new Color(r, g, b);
720              } else if (colorChoice.equalsIgnoreCase("rust")) {
721                  int r = 195;
722                  int g = 98;
723                  int b = 65;
724                  return new Color(r, g, b);
725              } else if (colorChoice.equalsIgnoreCase("sedona")) {
726                  int r = 204;
727                  int g = 102;
728                  int b = 0;
729                  return new Color(r, g, b);
730              } else if (colorChoice.equalsIgnoreCase("tangerine")) {
731                  int r = 231;
732                  int g = 138;
733                  int b = 97;
734                  return new Color(r, g, b);
735              } else if (colorChoice.equalsIgnoreCase("scarlet")) {
736                  int r = 255;
737                  int g = 36;
738                  int b = 0;
739                  return new Color(r, g, b);
740              } else if (colorChoice.equalsIgnoreCase("grapefruit")) {
741                  int r = 220;
742                  int g = 56;
743                  int b = 31;
744                  return new Color(r, g, b);
745              } else if (colorChoice.equalsIgnoreCase("cranberry")) {
746                  int r = 159;
747                  int g = 0;
748                  int b = 15;
749                  return new Color(r, g, b);
750              } else if (colorChoice.equalsIgnoreCase("burgundy")) {
751                  int r = 140;
752                  int g = 0;
753                  int b = 26;
754                  return new Color(r, g, b);
755              } else if (colorChoice.equalsIgnoreCase("midnight")) {
756                  int r = 43;
757                  int g = 27;
758                  int b = 23;
759                  return new Color(r, g, b);
760              } else if (colorChoice.equalsIgnoreCase("puce")) {
761                  int r = 127;
762                  int g = 90;
763                  int b = 88;
764                  return new Color(r, g, b);
765              } else if (colorChoice.equalsIgnoreCase("rose")) {
766                  int r = 232;
767                  int g = 173;
768                  int b = 170;
769                  return new Color(r, g, b);
770              } else if (colorChoice.equalsIgnoreCase("blush")) {
771                  int r = 255;
772                  int g = 230;
773                  int b = 232;
774                  return new Color(r, g, b);
775              } else if (colorChoice.equalsIgnoreCase("raspberry")) {
776                  int r = 227;
777                  int g = 11;
778                  int b = 93;
779                  return new Color(r, g, b);
780              } else if (colorChoice.equalsIgnoreCase("eggplant")) {
781                  int r = 97;
782                  int g = 64;
783                  int b = 81;
784                  return new Color(r, g, b);
785              } else if (colorChoice.equalsIgnoreCase("grape")) {
786                  int r = 94;
787                  int g = 90;
788                  int b = 128;
789                  return new Color(r, g, b);
790              } else if (colorChoice.equalsIgnoreCase("periwinkle")) {
791                  int r = 204;
792                  int g = 204;
793                  int b = 255;
794                  return new Color(r, g, b);
795              } else if (colorChoice.equalsIgnoreCase("mauve")) {
796                  int r = 224;
797                  int g = 176;
798                  int b = 255;
799                  return new Color(r, g, b);
800              } else if (colorChoice.equalsIgnoreCase("lilac")) {
801                  int r = 200;
802                  int g = 162;
803                  int b = 200;
804                  return new Color(r, g, b);
805              } else if (colorChoice.equalsIgnoreCase("pearl")) {
806                  int r = 253;
807                  int g = 238;
808                  int b = 244;
809                  return new Color(r, g, b);
810              } else if (colorChoice.equalsIgnoreCase("rice")) {
811                  int r = 250;
812                  int g = 245;
813                  int b = 239;
814                  return new Color(r, g, b);
815              } else if (colorChoice.equalsIgnoreCase("cotton")) {
816                  int r = 251;
817                  int g = 251;
818                  int b = 249;
819                  return new Color(r, g, b);
820              } else {
821                  throw new Exception("THE COLOR " + colorChoice + " IS NOT FOUND");
822              }
823          }
824  
825          private Color colorModif(String messingWith, Color colorChoice) throws Exception {
826              int red = colorChoice.getRed();
827              int blue = colorChoice.getBlue();
828              int green = colorChoice.getGreen();
829              if (messingWith.equalsIgnoreCase("blue")) {
830                  Color newBlue = new Color(red, green, blue / 2);
831                  return newBlue;
832              } else if (messingWith.equalsIgnoreCase("red")) {
833                  Color newRed = new Color(red / 2, green, blue);
834                  return newRed;
835              } else if (messingWith.equalsIgnoreCase("green")) {
836                  Color newGreen = new Color(red, green / 2, blue);
837                  return newGreen;
838              } else if (messingWith.equalsIgnoreCase("blue&red")) {
839                  Color newBlueAndRed = new Color(red / 2, green, blue / 2);
840                  return newBlueAndRed;
841              } else if (messingWith.equalsIgnoreCase("red&green")) {
842                  Color newRedAndGreen = new Color(red / 2, green / 2, blue);
843                  return newRedAndGreen;
844              } else if (messingWith.equalsIgnoreCase("green&blue")) {
845                  Color newGreenAndBlue = new Color(red, green / 2, blue / 2);
846                  return newGreenAndBlue;
847              } else if (messingWith.equalsIgnoreCase("blue&red&green")) {
848                  Color newBlueAndRedAndGreen = new Color(red / 2, green / 2, blue / 2);
849                  return newBlueAndRedAndGreen;
850              } else {
851                  throw new Exception("THE COLOR " + messingWith + " IS NOT FOUND");
852              }
853          }
854  
855          private Color invercolorModif (String invertWith, Color colorModif) throws Exception {
856              int red2 = colorModif.getRed();
857              int blue2 = colorModif.getBlue();
858              int green2 = colorModif.getGreen();
859              if (invertWith.equalsIgnoreCase("blue")) {
860                  Color newInvBlue = new Color(red2, green2, 255 - blue2);
861                  return newInvBlue;
862              } else if (invertWith.equalsIgnoreCase("red")) {
863                  Color newInvRed = new Color(255 - red2, green2, blue2);
864                  return newInvRed;
865              } else if (invertWith.equalsIgnoreCase("green")) {
866                  Color newInvGreen = new Color(red2, 255 - green2, blue2);
867                  return newInvGreen;
868              } else if (invertWith.equalsIgnoreCase("blue&red")) {
869                  Color newInvBlueAndInvRed = new Color(255 - red2, green2, 255 - blue2);
870                  return newInvBlueAndInvRed;
871              } else if (invertWith.equalsIgnoreCase("red&green")) {
872                  Color newInvRedAndInvGreen = new Color(255 - red2, 255 - green2, blue2);
873                  return newInvRedAndInvGreen;
874              } else if (invertWith.equalsIgnoreCase("green&blue")) {
875                  Color newInvGreenAndInvBlue = new Color(red2, 255 - green2, 255 - blue2);
876                  return newInvGreenAndInvBlue;
877              } else if (invertWith.equalsIgnoreCase("blue&red&green")) {
878                  Color newInvBlueAndInvRedAndInvGreen = new Color(255 - red2, 255 - green2, 255 - blue2);
879                  return newInvBlueAndInvRedAndInvGreen;
880              } else {
881                  throw new Exception("THE COLOR " + invertWith + " IS NOT FOUND");
882              }
883          }
884  
885          private Color swapcolorModif (String swappingWith, Color invercolorModif) throws Exception {
886              int red3 = invercolorModif.getRed();
887              int blue3 = invercolorModif.getBlue();
888              int green3 = invercolorModif.getGreen();
889              if (swappingWith.equalsIgnoreCase("blue<->red")) {
890                  Color swapBlueAndRed = new Color(blue3, green3, red3);
891                  return swapBlueAndRed;
892              } else if (swappingWith.equalsIgnoreCase("red<->green")) {
893                  Color swapRedAndGreen = new Color(green3, red3, blue3);
894                  return swapRedAndGreen;
895              } else if (swappingWith.equalsIgnoreCase("green<->blue")) {
896                  Color swapGreenAndBlue = new Color(red3, blue3, green3);
897                  return swapGreenAndBlue;
898              } else if (swappingWith.equalsIgnoreCase("left_all")) {
899                  Color swapBlueAndRedAndGreenLeft = new Color(blue3, green3, red3);
900                  return swapBlueAndRedAndGreenLeft;
901              } else if (swappingWith.equalsIgnoreCase("right_all")) {
902                  Color swapBlueAndRedAndGreenRight = new Color(green3, red3, blue3);
903                  return swapBlueAndRedAndGreenRight;
904              } else {
905                  throw new Exception("THE COLOR " + swappingWith + " IS NOT FOUND");
906              }
907          }
908  
909          private Color shiftingcolorModif (String shiftingWith, Color swapcolorModif,int shiftMovement) throws Exception {
910              int red4 = swapcolorModif.getRed();
911              int blue4 = swapcolorModif.getBlue();
912              int green4 = swapcolorModif.getGreen();
913              if (shiftingWith.equalsIgnoreCase("blue")) {
914                  Color newShiftBlue = new Color(red4, green4, (blue4 + shiftMovement) % 256);
915                  return newShiftBlue;
916              } else if (shiftingWith.equalsIgnoreCase("red")) {
917                  Color newShiftRed = new Color((red4 + shiftMovement) % 256, green4, blue4);
918                  return newShiftRed;
919              } else if (shiftingWith.equalsIgnoreCase("green")) {
920                  Color newShiftGreen = new Color(red4, (green4 + shiftMovement) % 256, blue4);
921                  return newShiftGreen;
922              } else if (shiftingWith.equalsIgnoreCase("blue&red")) {
923                  Color newShiftBlueAndShiftRed = new Color((red4 + shiftMovement) % 256, green4, (blue4 + shiftMovement) % 256);
924                  return newShiftBlueAndShiftRed;
925              } else if (shiftingWith.equalsIgnoreCase("red&green")) {
926                  Color newShiftRedAndShiftGreen = new Color((red4 + shiftMovement) % 256, (green4 + shiftMovement) % 256, blue4);
927                  return newShiftRedAndShiftGreen;
928              } else if (shiftingWith.equalsIgnoreCase("green&blue")) {
929                  Color newShiftGreenAndShiftBlue = new Color(red4, (green4 + shiftMovement) % 256, (blue4 + shiftMovement) % 256);
930                  return newShiftGreenAndShiftBlue;
931              } else if (shiftingWith.equalsIgnoreCase("blue&red&green")) {
932                  Color newShiftBlueAndShiftRedAndShiftGreen = new Color((red4 + shiftMovement) % 256, (green4 + shiftMovement) % 256, (blue4 + shiftMovement) % 256);
933                  return newShiftBlueAndShiftRedAndShiftGreen;
934              } else {
935                  throw new Exception("THE COLOR " + shiftingWith + " IS NOT FOUND");
936              }
937          }
938  
939          private Color powercolorModif (String powerWith, Color shiftingcolorModif,int powerExponent) throws Exception {
940              int red5 = shiftingcolorModif.getRed();
941              int blue5 = shiftingcolorModif.getBlue();
942              int green5 = shiftingcolorModif.getGreen();
943              if (powerWith.equalsIgnoreCase("blue")) {
944                  Color newPowerBlue = new Color(red5, green5, ((int) Math.pow(blue5, powerExponent)) % 256);
945                  return newPowerBlue;
946              } else if (powerWith.equalsIgnoreCase("red")) {
947                  Color newPowerRed = new Color(((int) Math.pow(red5, powerExponent)) % 256, green5, blue5);
948                  return newPowerRed;
949              } else if (powerWith.equalsIgnoreCase("green")) {
950                  Color newPowerGreen = new Color(red5, (int) Math.pow(green5, powerExponent) % 256, blue5);
951                  return newPowerGreen;
952              } else if (powerWith.equalsIgnoreCase("blue&red")) {
953                  Color newPowerBlueAndPowerRed = new Color((int) Math.pow(red5, powerExponent) % 256, green5, ((int) Math.pow(blue5, powerExponent)) % 256);
954                  return newPowerBlueAndPowerRed;
955              } else if (powerWith.equalsIgnoreCase("red&green")) {
956                  Color newPowerRedAndPowerGreen = new Color(((int) Math.pow(red5, powerExponent)) % 256, (int) Math.pow(green5, powerExponent) % 256, blue5);
957                  return newPowerRedAndPowerGreen;
958              } else if (powerWith.equalsIgnoreCase("green&blue")) {
959                  Color newPowerGreenAndPowerBlue = new Color(red5, (int) Math.pow(green5, powerExponent) % 256, ((int) Math.pow(blue5, powerExponent)) % 256);
960                  return newPowerGreenAndPowerBlue;
961              } else if (powerWith.equalsIgnoreCase("blue&red&green")) {
962                  Color newPowerBlueAndPowerRedAndPowerGreen = new Color(((int) Math.pow(red5, powerExponent)) % 256, ((int) Math.pow(green5, powerExponent)) % 256, ((int) Math.pow(blue5, powerExponent)) % 256);
963                  return newPowerBlueAndPowerRedAndPowerGreen;
964              } else {
965                  throw new Exception("THE COLOR " + powerWith + " IS NOT FOUND");
966              }
967          }
968  
969          private Color logcolorModif (String logWith, Color powercolorModif) throws Exception {
970              int red6 = powercolorModif.getRed() + 1;
971              int blue6 = powercolorModif.getBlue() + 1;
972              int green6 = powercolorModif.getGreen() + 1;
973              if (logWith.equalsIgnoreCase("blue")) {
974                  Color newLogBlue = new Color(red6, green6, (int) Math.log(blue6));
975                  return newLogBlue;
976              } else if (logWith.equalsIgnoreCase("red")) {
977                  Color newLogRed = new Color((int) Math.log(red6), green6, blue6);
978                  return newLogRed;
979              } else if (logWith.equalsIgnoreCase("green")) {
980                  Color newLogGreen = new Color(red6, (int) Math.log(green6), blue6);
981                  return newLogGreen;
982              } else if (logWith.equalsIgnoreCase("blue&red")) {
983                  Color newLogBlueAndLogRed = new Color((int) Math.log(red6), green6, (int) Math.log(blue6));
984                  return newLogBlueAndLogRed;
985              } else if (logWith.equalsIgnoreCase("red&green")) {
986                  Color newLogRedAndLogGreen = new Color((int) Math.log(red6), (int) Math.log(green6), blue6);
987                  return newLogRedAndLogGreen;
988              } else if (logWith.equalsIgnoreCase("green&blue")) {
989                  Color newLogGreenAndLogBlue = new Color(red6, (int) Math.log(green6), (int) Math.log(blue6));
990                  return newLogGreenAndLogBlue;
991              } else if (logWith.equalsIgnoreCase("blue&red&green")) {
992                  Color newLogBlueAndLogRedAndLogGreen = new Color((int) Math.log(red6), (int) Math.log(green6), (int) Math.log(blue6));
993                  return newLogBlueAndLogRedAndLogGreen;
994              } else {
995                  throw new Exception("THE COLOR " + logWith + " IS NOT FOUND");
996              }
997          }
998  
999          private Color avecolorModif (Color logcolorModif, Color powercolorModif, Color shiftingcolorModif, Color swapcolorModif, Color invercolorModif, Color factorModif, Color colorChoice){
1000             int red7 = (logcolorModif.getRed() + powercolorModif.getRed() + shiftingcolorModif.getRed() + swapcolorModif.getRed() + invercolorModif.getRed() + factorModif.getRed() + colorChoice.getRed()) / 7;
1001             int blue7 = (logcolorModif.getBlue() + powercolorModif.getBlue() + shiftingcolorModif.getBlue() + swapcolorModif.getBlue() + invercolorModif.getBlue() + factorModif.getBlue() + colorChoice.getBlue()) / 7;
1002             int green7 = (logcolorModif.getGreen() + powercolorModif.getGreen() + shiftingcolorModif.getGreen() + swapcolorModif.getGreen() + invercolorModif.getGreen() + factorModif.getGreen() + colorChoice.getGreen()) / 7;
1003             Color newAveBlueAndAveRedAndAveGreen = new Color(red7, green7, blue7);
1004             return newAveBlueAndAveRedAndAveGreen;
1005         }
1006 
1007         private Color highlowdiffcolormodif (Color avecolorModif, Color logcolorModif, Color powercolorModif, Color shiftingcolorModif, Color swapcolorModif, Color invercolorModif, Color factorModif, Color colorChoice){
1008             int[] redArray = new int[]{avecolorModif.getRed(), logcolorModif.getRed(), powercolorModif.getRed(), shiftingcolorModif.getRed(), swapcolorModif.getRed(), invercolorModif.getRed(), factorModif.getRed(), colorChoice.getRed()};
1009             int[] blueArray = new int[]{avecolorModif.getBlue(), logcolorModif.getBlue(), powercolorModif.getBlue(), shiftingcolorModif.getBlue(), swapcolorModif.getBlue(), invercolorModif.getBlue(), factorModif.getBlue(), colorChoice.getBlue()};
1010             int[] greenArray = new int[]{avecolorModif.getGreen(), logcolorModif.getGreen(), powercolorModif.getGreen(), shiftingcolorModif.getGreen(), swapcolorModif.getGreen(), invercolorModif.getGreen(), factorModif.getGreen(), colorChoice.getGreen()};
1011             Arrays.sort(redArray);
1012             Arrays.sort(greenArray);
1013             Arrays.sort(blueArray);
1014             int red8 = redArray[redArray.length - 1];
1015             int blue8 = blueArray[blueArray.length - 1];
1016             int green8 = greenArray[greenArray.length - 1];
1017             int red9 = redArray[0];
1018             int blue9 = blueArray[0];
1019             int green9 = greenArray[0];
1020             Color newHighLowDiffBlueAndHighLowDiffRedAndHighLowDiffGreen = new Color(red8 - red9, green8 - green9, blue8 - blue9);
1021             return newHighLowDiffBlueAndHighLowDiffRedAndHighLowDiffGreen;
1022         }
1023 
1024         private Color sqrtcolorModif (String sqrtWith, Color highlowdiffcolormodif) throws Exception {
1025             int red10 = highlowdiffcolormodif.getRed();
1026             int blue10 = highlowdiffcolormodif.getBlue();
1027             int green10 = highlowdiffcolormodif.getGreen();
1028             if (sqrtWith.equalsIgnoreCase("blue")) {
1029                 Color newSqrtBlue = new Color(red10, green10, (int) Math.sqrt(blue10));
1030                 return newSqrtBlue;
1031             } else if (sqrtWith.equalsIgnoreCase("red")) {
1032                 Color newSqrtRed = new Color((int) Math.sqrt(red10), green10, blue10);
1033                 return newSqrtRed;
1034             } else if (sqrtWith.equalsIgnoreCase("green")) {
1035                 Color newSqrtGreen = new Color(red10, (int) Math.sqrt(green10), blue10);
1036                 return newSqrtGreen;
1037             } else if (sqrtWith.equalsIgnoreCase("blue&red")) {
1038                 Color newSqrtBlueAndSqrtRed = new Color((int) Math.sqrt(red10), green10, (int) Math.sqrt(blue10));
1039                 return newSqrtBlueAndSqrtRed;
1040             } else if (sqrtWith.equalsIgnoreCase("red&green")) {
1041                 Color newSqrtRedAndSqrtGreen = new Color((int) Math.sqrt(red10), (int) Math.sqrt(green10), blue10);
1042                 return newSqrtRedAndSqrtGreen;
1043             } else if (sqrtWith.equalsIgnoreCase("green&blue")) {
1044                 Color newSqrtGreenAndSqrtBlue = new Color(red10, (int) Math.sqrt(green10), (int) Math.sqrt(blue10));
1045                 return newSqrtGreenAndSqrtBlue;
1046             } else if (sqrtWith.equalsIgnoreCase("blue&red&green")) {
1047                 Color newSqrtBlueAndSqrtRedSqrtGreen = new Color((int) Math.sqrt(red10), (int) Math.sqrt(green10), (int) Math.sqrt(blue10));
1048                 return newSqrtBlueAndSqrtRedSqrtGreen;
1049             } else {
1050                 throw new Exception("THE COLOR " + sqrtWith + " IS NOT FOUND");
1051             }
1052         }
1053 
1054         private Color reciprocalcolorModif(Color sqrtcolorModif){
1055             int red11 = (1 / (sqrtcolorModif.getRed() + 1)) * 256;
1056             int blue11 = (1 / (sqrtcolorModif.getBlue() + 1)) * 256;
1057             int green11 = (1 / (sqrtcolorModif.getGreen() + 1)) * 256;
1058             return new Color(red11, green11, blue11);
1059         }
1060 
1061         private Color productcolorModif(Color selectedColor, Color colorModif, Color invercolorModif){
1062             int red12 = ((selectedColor.getRed()*colorModif.getRed()*invercolorModif.getRed())%256);
1063             int blue12 = ((selectedColor.getBlue()*colorModif.getBlue()*invercolorModif.getBlue())%256);
1064             int green12 = ((selectedColor.getGreen()*colorModif.getGreen()*invercolorModif.getGreen())%256);
1065             return new Color(red12, green12, blue12);
1066         }
1067 
1068         private Color binarycolorModif(Color productcolorModif){
1069             int red13 = Integer.parseInt(Integer.toBinaryString(productcolorModif.getRed()))%256;
1070             int green13 = Integer.parseInt(Integer.toBinaryString(productcolorModif.getGreen()))%256;
1071             int blue13 = Integer.parseInt(Integer.toBinaryString(productcolorModif.getBlue()))%256;
1072             return new Color(red13, green13, blue13);
1073         }
1074 
1075         private Color mediancolorModif(Color selectedColor, Color colorModif, Color invercolorModif, Color binarycolorModif){
1076             int[] redArray2 = new int[]{selectedColor.getRed(), colorModif.getRed(), invercolorModif.getRed(), binarycolorModif.getRed()};
1077             int[] greenArray2 = new int[]{selectedColor.getGreen(), colorModif.getGreen(), invercolorModif.getGreen(), binarycolorModif.getGreen()};
1078             int[] blueArray2 = new int[]{selectedColor.getBlue(), colorModif.getBlue(), invercolorModif.getBlue(), binarycolorModif.getBlue()};
1079             Arrays.sort(redArray2);
1080             Arrays.sort(greenArray2);
1081             Arrays.sort(blueArray2);
1082             int red14 = (redArray2[2] + redArray2[1])/2;
1083             int green14 = (greenArray2[2] + greenArray2[1])/2;
1084             int blue14 = (blueArray2[2] + blueArray2[1])/2;
1085             return new Color(red14, green14, blue14);
1086         }
1087 
1088     private Color multiplycolorModif (String multiplyWith, Color mediancolorModif,int multiplyFactor) throws Exception {
1089         int red15 = mediancolorModif.getRed();
1090         int blue15 = mediancolorModif.getBlue();
1091         int green15 = mediancolorModif.getGreen();
1092         if (multiplyWith.equalsIgnoreCase("blue")) {
1093             Color newShiftBlue = new Color(red15, green15, (blue15 * multiplyFactor) % 256);
1094             return newShiftBlue;
1095         } else if (multiplyWith.equalsIgnoreCase("red")) {
1096             Color newShiftRed = new Color((red15 * multiplyFactor) % 256, green15, blue15);
1097             return newShiftRed;
1098         } else if (multiplyWith.equalsIgnoreCase("green")) {
1099             Color newShiftGreen = new Color(red15, (green15 * multiplyFactor) % 256, blue15);
1100             return newShiftGreen;
1101         } else if (multiplyWith.equalsIgnoreCase("blue&red")) {
1102             Color newShiftBlueAndShiftRed = new Color((red15 * multiplyFactor) % 256, green15, (blue15 * multiplyFactor) % 256);
1103             return newShiftBlueAndShiftRed;
1104         } else if (multiplyWith.equalsIgnoreCase("red&green")) {
1105             Color newShiftRedAndShiftGreen = new Color((red15 * multiplyFactor) % 256, (green15 * multiplyFactor) % 256, blue15);
1106             return newShiftRedAndShiftGreen;
1107         } else if (multiplyWith.equalsIgnoreCase("green&blue")) {
1108             Color newShiftGreenAndShiftBlue = new Color(red15, (green15 * multiplyFactor) % 256, (blue15 * multiplyFactor) % 256);
1109             return newShiftGreenAndShiftBlue;
1110         } else if (multiplyWith.equalsIgnoreCase("blue&red&green")) {
1111             Color newShiftBlueAndShiftRedAndShiftGreen = new Color((red15 * multiplyFactor) % 256, (green15 * multiplyFactor) % 256, (blue15 * multiplyFactor) % 256);
1112             return newShiftBlueAndShiftRedAndShiftGreen;
1113         } else {
1114             throw new Exception("THE COLOR " + multiplyWith + " IS NOT FOUND");
1115         }
1116     }
1117 
1118     private Color sumcolorModif(Color multiplycolorModif, Color highlowdiffcolormodif, Color selectedColor) {
1119         int red16 = (multiplycolorModif.getRed() + highlowdiffcolormodif.getRed() + selectedColor.getRed())%256;
1120         int blue16 = (multiplycolorModif.getBlue() + highlowdiffcolormodif.getBlue() + selectedColor.getBlue())%256;
1121         int green16 = (multiplycolorModif.getGreen() + highlowdiffcolormodif.getGreen() + selectedColor.getGreen())%256;
1122         return new Color (red16,green16,blue16);
1123     }
1124 }
1125