0

I am working on a project and I figured out that when i try to print the ANSI color code, the application interpretate the code color as a <-, as you can see in the images.

Terminal Outut:

outPut Image

My color codes:

public final class BaseCodigoCores {

    public static final String ANSI_RESET = "\u001B[0m";
    public static final String TEXTO_ANSI_BLACK = "\u001B[30m";

    public static final Cor ANSI_RED_BACKGROUND = new Cor("Vermelho","\u001B[41m");
    public static final Cor ANSI_GREEN_BACKGROUND =  new Cor("Verde","\u001B[42m");
    public static final Cor ANSI_YELLOW_BACKGROUND = new Cor("Amarelo", "\u001B[43m");
    public static final Cor ANSI_BLUE_BACKGROUND = new Cor("Azul","\u001B[44m");
    public static final Cor ANSI_PURPLE_BACKGROUND = new Cor("Roxo","\u001B[45m");
    public static final Cor ANSI_CYAN_BACKGROUND = new Cor("Ciano", "\u001B[46m");
    public static final Cor ANSI_WHITE_BACKGROUND = new Cor("Branco","\u001B[47m");


}

Would like to know how to change that configuration to able my terminal to print colors.

Thomas Dickey
  • 51,086
  • 7
  • 70
  • 105
Gabriel
  • 21
  • 1
  • 4
  • https://stackoverflow.com/questions/5762491/how-to-print-color-in-console-using-system-out-println – Reimeus Apr 30 '21 at 12:56
  • Does this answer your question? [How to print color in console using System.out.println?](https://stackoverflow.com/questions/5762491/how-to-print-color-in-console-using-system-out-println) – talex Apr 30 '21 at 12:59
  • Not yet, i also have this ANSI codes in my "Cor" object. The problem is when i print the color in terminal, thw \ turns into a <-, so the color does not apper. – Gabriel May 02 '21 at 15:04

0 Answers0