List of utility methods to do Terminal Color Output
String | colorizeText(String str, String fgc, String bgc) Creates a string with the given foreground and backgroundcolor. return INTERNAL_MARKER + fgc + INTERNAL_MARKER + bgc.toLowerCase() + str + INTERNAL_MARKER + RESET_ALL;
|
String | colors(String string) COLORIZE STRING if (string == null) return null; string = string.replaceAll("&([0-9a-fA-Fk-pK-PrR])", "\u00A7$1"); string = string.replaceAll("\u00A7P", "\u00A7p"); return string; |
String | colorString(String input) color String return input.replaceAll("&&", COLOR_CODE); |
String | colorString(String string) color String return colorString(string, '&'); |
String | colorText(final int color) Color to text representation final char[] characters = new char[8]; for (int i = 0, shift = 28; i < 8; i++, shift -= 4) { characters[i] = Integer.toHexString((color >> shift) & 0xF).charAt(0); return new String(characters); |
String | colorText(int v, int vlo, int vhi, int rlo, int glo, int blo, int rhi, int ghi, int bhi) Color a text using BBCode such that the color either increase or decrease one value to other value for each component of the color A gradient would be produced from vlo to vhi, as v varies. boolean rInc = true; boolean gInc = true; boolean bInc = true; int rSmall = rlo; int gSmall = glo; int bSmall = blo; if (rhi < rlo) { rInc = false; ... |