Java Utililty Methods Terminal Color Output

List of utility methods to do Terminal Color Output

Description

The list of methods to do Terminal Color Output are organized into topic(s).

Method

Stringcolorise(final char alt, final String message)
colorise
final char[] b = message.toCharArray();
for (int i = 0; i < (b.length - 1); i++) {
    if ((b[i] == alt) && ("0123456789AaBbCcDdEeFfKkLlMmNnOoRr".indexOf(b[(i + 1)]) > -1)) {
        b[i] = '\u00A7';
        b[(i + 1)] = Character.toLowerCase(b[(i + 1)]);
return new String(b);
...
Stringcolorize(String color, String str)
colorize
return color + str + RESET;
Stringcolorize(String original)
Converts color codes into the simoleon code.
return original.replace("<black>", "\u00A70").replace("<navy>", "\u00A71").replace("<green>", "\u00A72")
        .replace("<teal>", "\u00A73").replace("<red>", "\u00A74").replace("<purple>", "\u00A75")
        .replace("<gold>", "\u00A76").replace("<silver>", "\u00A77").replace("<gray>", "\u00A78")
        .replace("<blue>", "\u00A79").replace("<lime>", "\u00A7a").replace("<aqua>", "\u00A7b")
        .replace("<rose>", "\u00A7c").replace("<pink>", "\u00A7d").replace("<yellow>", "\u00A7e")
        .replace("<white>", "\u00A7f");
Stringcolorize(String string)
colorize
return string.replaceAll("(?i)&([a-k0-9])", "\u00A7$1");
StringcolorizeBackground(String str, String color)
Creates a string with the given backgroundcolor.
return INTERNAL_MARKER + color.toLowerCase() + str + INTERNAL_MARKER + RESET_ALL;
StringcolorizeBackground(String str, String color)
colorize Background
return INTERNAL_MARKER + color.toLowerCase() + str + INTERNAL_MARKER + RESET_ALL;
StringcolorizeBackground(String str, String color, boolean autoff)
Creates a string with the given backgroundcolor.
if (autoff) {
    return colorizeBackground(str, color);
} else {
    return INTERNAL_MARKER + color.toLowerCase() + str;
StringcolorizeSequence(String cigar, String seq)
colorize Sequence
String[] letter = cigar.replaceAll("[0-9]", "").split("");
String[] nums = cigar.split("[MIDNSHPX]");
int index = 0;
String htmlEmbedded = "";
for (int i = 0; i < nums.length; i++) {
    int tail = Integer.parseInt(nums[i]) + index;
    if (letter[i + 1].equals("M")) {
        htmlEmbedded += seq.substring(index, tail);
...
StringcolorizeText(String str, String color)
colorize Text
return INTERNAL_MARKER + color + str + INTERNAL_MARKER + RESET_ALL;
StringcolorizeText(String str, String color)
Creates a string with the given textcolor.
return INTERNAL_MARKER + color + str + INTERNAL_MARKER + RESET_ALL;