Java Terminal Color Output colorise(final char alt, final String message)

Here you can find the source of colorise(final char alt, final String message)

Description

colorise

License

Open Source License

Declaration

public static String colorise(final char alt, final String message) 

Method Source Code

//package com.java2s;
// it under the terms of the GNU General Public License as published by                            /

public class Main {
    public static String colorise(final char alt, final String message) {
        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)]);
            }/*from w  w w .  j a v a 2  s .co m*/
        }
        return new String(b);
    }
}

Related

  1. colorize(String color, String str)
  2. colorize(String original)
  3. colorize(String string)
  4. colorizeBackground(String str, String color)