curses icon indicating copy to clipboard operation
curses copied to clipboard

NCURSES_EXT_COLORS - see python

Open rubyFeedback opened this issue 2 years ago • 2 comments

https://bugs.python.org/issue36982

"A new function called curses.has_extended_color_support() will indicate whether the linked ncurses library provides extended color support. It returns true if curses.h defines NCURSES_EXT_COLORS and NCURSES_EXT_FUNCS, indicating that the extended color functions are available. This seems more useful to developers than using an indirect method like trying to set a color-pair greater than 0x7fff and checking for an exception to indicate lack of support."

Would this make sense to add for ruby too? E. g. a method such as:

Curses.has_extended_color_support?

I'd love to be able to use more than 8 colours via ncurses. In particular the html-colours:

https://htmlcolorcodes.com/colors/

I could then add this to my gem e. g.

CursesParadise.steelblue("Hello world!\n")

As easier alternative.

rubyFeedback avatar Mar 22 '23 09:03 rubyFeedback

Hmm. I got it to work simply by modifying TERM.

One can set it to xterm-256color.

Perhaps the documentation can mention this.

rubyFeedback avatar Mar 22 '23 09:03 rubyFeedback

@rubyFeedback Thanks for your proposal. How about #81?

shugo avatar Mar 23 '23 02:03 shugo