update colors for console version
This commit is contained in:
@@ -13,16 +13,6 @@ public class Console implements OutputSystem {
|
||||
private final Scanner scanner = new Scanner(System.in);
|
||||
private final CommandExecutor commandExecutor;
|
||||
private final ConsolePieceName consolePieceName = new ConsolePieceName();
|
||||
public static final String ANSI_BLACK_BACKGROUND = "\u001B[40m";
|
||||
public static final String ANSI_RED_BACKGROUND = "\u001B[41m";
|
||||
public static final String ANSI_GREEN_BACKGROUND = "\u001B[42m";
|
||||
public static final String ANSI_YELLOW_BACKGROUND = "\u001B[43m";
|
||||
public static final String ANSI_BLUE_BACKGROUND = "\u001B[44m";
|
||||
public static final String ANSI_PURPLE_BACKGROUND = "\u001B[45m";
|
||||
public static final String ANSI_CYAN_BACKGROUND = "\u001B[46m";
|
||||
public static final String ANSI_WHITE_BACKGROUND = "\u001B[47m";
|
||||
public static final String ANSI_RESET = "\u001B[0m";
|
||||
|
||||
|
||||
public Console(CommandExecutor commandExecutor) {
|
||||
this.commandExecutor = commandExecutor;
|
||||
@@ -98,16 +88,16 @@ public class Console implements OutputSystem {
|
||||
for (int j = 0; j < Coordinate.VALUE_MAX; j++) {
|
||||
Piece p = pieceAt(j, i);
|
||||
if ((i+j)%2==0) {
|
||||
string.append(ANSI_WHITE_BACKGROUND);
|
||||
string.append(Colors.WHITE_BACKGROUND_BRIGHT);
|
||||
}
|
||||
else {
|
||||
string.append(ANSI_BLACK_BACKGROUND);
|
||||
string.append(Colors.BLACK_BACKGROUND_BRIGHT);
|
||||
}
|
||||
if (p == null) {
|
||||
string.append(" " + ANSI_RESET);
|
||||
string.append(" " + Colors.RESET);
|
||||
}
|
||||
else {
|
||||
string.append(" " + consolePieceName.getString(p) + " " + ANSI_RESET );
|
||||
string.append(" " + consolePieceName.getString(p) + " " + Colors.RESET);
|
||||
}
|
||||
}
|
||||
string.append("\n");
|
||||
|
||||
Reference in New Issue
Block a user