if (validateColor(strColor)) {
this.strColor = strColor;
} else {
- throw new IllegalArgumentException("Color must be" + new Eye().colorListToString());
+ throw new IllegalArgumentException("Color must be" + this.colorListToString());
}
}
*/
public void setColor(String color) {
if (validateColor(color)) {
- if (color.equals("brown"))
+ if (color.equals("black"))
+ this.color = Color.black;
+ else if (color.equals("blue"))
+ this.color = Color.blue;
+ else if (color.equals("brown"))
this.color = new Color(88, 41, 0);
- else
- this.color = Color.getColor(color);
-
+ else if (color.equals("green"))
+ this.color = Color.green;
} else {
- throw new IllegalArgumentException("Color must be" + new Eye().colorListToString());
+ throw new IllegalArgumentException("Color must be" + this.colorListToString());
}
}