MrZoraman
MrZoraman

Reputation: 431

How do I get ANSI bright colors to work in the windows cmd?

I am using java, the jline library and jansi. I have regular colors working just fine, either using \u001B[32m for example, or Ansi.ansi().fg(Ansi.Color.GREEN).

However, I cannot seem to get the bright set of colors working. I've tried both \u001B[92m or Ansi.ansi().fgBright(Ansi.Color.GREEN).

When I try to use bright colors, I don't see anything strange show up in the console, but the color does not change.

Additional Info:

One final note: my goal is to be multiplatform.

Upvotes: 0

Views: 1216

Answers (1)

MrZoraman
MrZoraman

Reputation: 431

I've found a solution! Here's what it looks like jansi requires in order to change between dark and light colors. For example:

Ansi.ansi().a(Attribute.RESET).fg(Ansi.Color.MAGENTA).boldOff().toString() Dark Purple Ansi.ansi().a(Attribute.RESET).fg(Ansi.Color.MAGENTA).bold().toString() Light Purple

And so on...

Upvotes: 1

Related Questions