Reputation: 431
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:
I'm on a preview build of windows 10, but I've tried my code on windows server 2012 R2.
jansi says that ansi is both detected and enabled.
Issuing AnsiConsole.systemInstall();
at the beginning does not fix my issue.
One final note: my goal is to be multiplatform.
Upvotes: 0
Views: 1216
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