From 201e2aa1fb739ff9db261c786c671bf24ae1eb6f Mon Sep 17 00:00:00 2001 From: David Hermann Date: Wed, 18 Jan 2023 18:55:52 +0100 Subject: [PATCH] Created class with ansi color codes --- .../java/org/bitbiome/classes/Colors.java | 56 +++++++++++++++++++ 1 file changed, 56 insertions(+) create mode 100644 src/main/java/org/bitbiome/classes/Colors.java diff --git a/src/main/java/org/bitbiome/classes/Colors.java b/src/main/java/org/bitbiome/classes/Colors.java new file mode 100644 index 0000000..d08f59e --- /dev/null +++ b/src/main/java/org/bitbiome/classes/Colors.java @@ -0,0 +1,56 @@ +package org.bitbiome.classes; + +public class Colors { + + 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 final String ANSI_BRIGHT_BLACK = "\u001B[90m"; + public static final String ANSI_BRIGHT_RED = "\u001B[91m"; + public static final String ANSI_BRIGHT_GREEN = "\u001B[92m"; + public static final String ANSI_BRIGHT_YELLOW = "\u001B[93m"; + public static final String ANSI_BRIGHT_BLUE = "\u001B[94m"; + public static final String ANSI_BRIGHT_PURPLE = "\u001B[95m"; + public static final String ANSI_BRIGHT_CYAN = "\u001B[96m"; + public static final String ANSI_BRIGHT_WHITE = "\u001B[97m"; + + public static final String[] FOREGROUNDS = { + ANSI_BLACK, ANSI_RED, ANSI_GREEN, ANSI_YELLOW, + ANSI_BLUE, ANSI_PURPLE, ANSI_CYAN, ANSI_WHITE, + ANSI_BRIGHT_BLACK, ANSI_BRIGHT_RED, ANSI_BRIGHT_GREEN, ANSI_BRIGHT_YELLOW, + ANSI_BRIGHT_BLUE, ANSI_BRIGHT_PURPLE, ANSI_BRIGHT_CYAN, ANSI_BRIGHT_WHITE + }; + + public static final String ANSI_BG_BLACK = "\u001B[40m"; + public static final String ANSI_BG_RED = "\u001B[41m"; + public static final String ANSI_BG_GREEN = "\u001B[42m"; + public static final String ANSI_BG_YELLOW = "\u001B[43m"; + public static final String ANSI_BG_BLUE = "\u001B[44m"; + public static final String ANSI_BG_PURPLE = "\u001B[45m"; + public static final String ANSI_BG_CYAN = "\u001B[46m"; + public static final String ANSI_BG_WHITE = "\u001B[47m"; + + public static final String ANSI_BRIGHT_BG_BLACK = "\u001B[100m"; + public static final String ANSI_BRIGHT_BG_RED = "\u001B[101m"; + public static final String ANSI_BRIGHT_BG_GREEN = "\u001B[102m"; + public static final String ANSI_BRIGHT_BG_YELLOW = "\u001B[103m"; + public static final String ANSI_BRIGHT_BG_BLUE = "\u001B[104m"; + public static final String ANSI_BRIGHT_BG_PURPLE = "\u001B[105m"; + public static final String ANSI_BRIGHT_BG_CYAN = "\u001B[106m"; + public static final String ANSI_BRIGHT_BG_WHITE = "\u001B[107m"; + + public static final String[] BACKGROUNDS = { + ANSI_BG_BLACK, ANSI_BG_RED, ANSI_BG_GREEN, ANSI_BG_YELLOW, + ANSI_BG_BLUE, ANSI_BG_PURPLE, ANSI_BG_CYAN, ANSI_BG_WHITE, + ANSI_BRIGHT_BG_BLACK, ANSI_BRIGHT_BG_RED, ANSI_BRIGHT_BG_GREEN, ANSI_BRIGHT_BG_YELLOW, + ANSI_BRIGHT_BG_BLUE, ANSI_BRIGHT_BG_PURPLE, ANSI_BRIGHT_BG_CYAN, ANSI_BRIGHT_BG_WHITE }; + +}