Skip to content

Instantly share code, notes, and snippets.

@mindwing
Last active December 29, 2015 07:22
Show Gist options
  • Save mindwing/7dd766e9b5c75e308a11 to your computer and use it in GitHub Desktop.
Save mindwing/7dd766e9b5c75e308a11 to your computer and use it in GitHub Desktop.
ANSI escape code 를 이용해서 지원되는 console 에 컬러를 표현해보는 snippet
public class AnsiColor {
public static final String ANSI_RESET = "\u001B[0m";
public static final String ANSI_BLACK = "\u001B[30m";
public static final String ANSI_RED = "\u001B[31m";
public static final String ANSI_GREEN = "\u001B[32m";
public static final String ANSI_YELLOW = "\u001B[33m";
public static final String ANSI_BLUE = "\u001B[34m";
public static final String ANSI_PURPLE = "\u001B[35m";
public static final String ANSI_CYAN = "\u001B[36m";
public static final String ANSI_WHITE = "\u001B[37m";
public static void main(String[] args) {
System.out.println(ANSI_RED + "Red Power!!!: " + ANSI_RESET);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment