0

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.

4

1 回答 1

1

我找到了解决方案!这是 jansi 为了在深色和浅色之间切换而需要的东西。例如:

Ansi.ansi().a(Attribute.RESET).fg(Ansi.Color.MAGENTA).boldOff().toString()深紫色 Ansi.ansi().a(Attribute.RESET).fg(Ansi.Color.MAGENTA).bold().toString()浅紫色

等等...

于 2015-05-21T07:48:03.470 回答