ruby / curses

Ruby binding for curses, ncurses, and PDCurses. Formerly part of the ruby standard library.
Other
297 stars 34 forks source link

Can I use more than 8 colors? #17

Closed lstrzebinczyk closed 7 years ago

lstrzebinczyk commented 8 years ago

Hi

I can use 8 colors provided, but I would very much like to use more than that. Is there any nice way for me to define my own colors? I can't find any reasonable resources on this idea. This might be helpful: can_change_colors?, returns false for me, but I have no idea why.

puts "\e[1;90mt\e[0m"

will render me a nice, grey "t"

drbrain commented 8 years ago

This depends upon your curses version, it seems. ncurses 6.0 seems to support more than 16 colors:

Extend the cchar_t structure to allow more than 16 colors to be encoded.

lstrzebinczyk commented 8 years ago

It would seem that I have ncurses 5 installed (I'm using ubuntu 14.04). Does that mean no colors for me, if I'm not willing to install ncurses 6?

drbrain commented 8 years ago

You will need to upgrade to ncurses 6 to get more than 8 colors (I'm guessing it ncurses 5 supports 8 foreground and 8 background).

The curses gem may need an update to support more colors too, so I am leaving this open.

lstrzebinczyk commented 8 years ago

Understood, thank you for your answers.

shugo commented 7 years ago

It seems that the problem has been solved, so I close this issue.