Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can colors show the 16 colors of terminal? #21

Open
Tracked by #1
ywpkwon opened this issue Oct 7, 2022 · 1 comment
Open
Tracked by #1

Can colors show the 16 colors of terminal? #21

ywpkwon opened this issue Oct 7, 2022 · 1 comment

Comments

@ywpkwon
Copy link

ywpkwon commented Oct 7, 2022

I want colors to show the 16 ANSI colors of terminal.

I tried to add fgBrightRed in addition to the default fgRed, but it's undeclared identifier.
What is the name for the base08 -- base0F?

@koaledu
Copy link

koaledu commented Apr 28, 2024

Apparently std/terminal bright colors do not work as intended and do not show the correct color.
You can use ANSI codes to display them but it's a bit painful.

for i in 0..7:
  stdout.write "\x1b[38;5;", i, "mAA"
stdout.write "\x1b[0m\n"
for i in 8..15:
  stdout.write "\x1b[38;5;", i, "mAA"
stdout.write "\x1b[0m\n"

for i in 0..7:
  stdout.write "\x1b[48;5;", i, "m  "
stdout.write "\x1b[0m\n"
for i in 8..15:
  stdout.write "\x1b[48;5;", i, "m  "
stdout.write "\x1b[0m\n"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants