ssleert / nitch

nitch - incredibly fast system fetch written in nim
MIT License
519 stars 52 forks source link

Can colors show the 16 colors of terminal? #21

Open ywpkwon opened 1 year ago

ywpkwon commented 1 year ago

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?

M-Duardo commented 2 months ago

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"