cleaned horrific printColor

This commit is contained in:
eneller
2020-08-02 21:53:34 +02:00
parent d937db983f
commit e6f12cef97

View File

@@ -521,51 +521,38 @@ public class main{
String ANSI_GREEN = "\u001B[32m"; String ANSI_GREEN = "\u001B[32m";
boolean returnBool= true; boolean returnBool= true;
String color= colorvar.toLowerCase(); String color= "";
if (color.equals("white")){ switch(colorvar.toLowerCase()){
color=ANSI_WHITE; case "white":
} color = ANSI_WHITE;
else{ break;
if (color.equals("black")){ case "black":
color=ANSI_BLACK; color = ANSI_BLACK;
} break;
else{ case "red":
if (color.equals("yellow")){ color = ANSI_RED;
color=ANSI_YELLOW; break;
} case "yellow":
else{ color = ANSI_YELLOW;
if (color.equals("blue")){ break;
color=ANSI_BLUE; case "blue":
} color = ANSI_BLUE;
else{ break;
if (color.equals("purple")){ case "purple":
color=ANSI_PURPLE; color = ANSI_PURPLE;
} break;
else{ case "cyan":
if (color.equals("cyan")){ color = ANSI_CYAN;
color=ANSI_CYAN; break;
} case "green":
else{ color = ANSI_GREEN;
if (color.equals("red")){ break;
color=ANSI_RED;
} default: returnBool = false;
else{
if (color.equals("green")){
color=ANSI_GREEN;
}
else{
System.out.print(text);
returnBool = false;
}
}
}
}
}
}
}
} }
System.out.print(color+text + ANSI_RESET); System.out.print(color+text + ANSI_RESET);
if (lineBreak){ if (lineBreak){