-
Notifications
You must be signed in to change notification settings - Fork 177
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
ncruses init_extended_pair, init_extended_color, extended_color_content, extended_pair_content #117
Comments
I don't really see these as useful. COLORS and COLOR_PAIRS are already limited to values well within short range, and are likely to remain so even in future revisions. And init_color() values are 0-1000, also well within short range, while I don't even know what init_extended_color() is supposed to do differently, based on its man page. (Sure, it takes ints, but no greater range is specified.) I would begrudgingly adopt these for compatibility's sake, only, if they come to be widely used. I hope they are not. |
I should add -- ncurses seems to automatically set COLOR_PAIRS to be COLORS * COLORS. While there's a certain logic to that (allowing pairs of every foreground / background combo), it's not actually necessary. But AFAICT, it's the rationale for the extended_pair stuff. |
That was the idea
Github is definitely not the place where most curses related stuff happens, but event that shows > 3400 results (and brought up one source that seems to be handle the different color variants (none, classic colors, extended colors) quite reasonable. Of course I'm interested to see what the possible implementation here brings - do you consider it reasonable to at least adding it as int wrappers for the existing functions "sooner" and possibly consider an actual support of increased COLOR_PAIRS later? |
"...I don't even know what Without it, you can't initialize a color palette index past 32767. (Not a problem you expect to have, I realize.) As you say, the RGB values don't go past 1000; they could have been left as short ints. (Though allowing them to be "real" integers lets you avoid all sorts of nuisance casts.) Most of those >3400 results look to be cases where somebody declared those functions and then didn't actually use them. 256 colors and pairs seem to be enough for (almost) anybody. (Though PDCurses does implement 768 colors on some platforms.) I don't regret implementing more than 32K colors and pairs; the end result was actually a little simpler and (usually) less memory-intensive than the previous code. But outside the demo programs that show that the extended colors/functions work, they have been used (as far as I know) a total of zero times, including by me. The |
Yeah, I did alloc_pair() et al this morning, indirectly inspired by this issue. (And then, I saw there's also reset_color_pairs(), whose usefulness is less clear.) It's a nice idea; it would've been nice if it were always there; but as with most innovations in curses, I'd hesitate to actually use it. |
"...I did I believe As you say, actual use of "innovations" in curses can be risky. In particular, I've been burned by the fact that OS/X defaults to an extremely elderly implementation of ncurses, such that you can't really count on much of anything since about 2008 (IIRC) to be present. Caveat programmer. |
These were added to ncurses in early 2017 and are documented in its manpage.
I assume that not all ports will support those, but many should be able to do so.
Note: the initial addition from PDCursesMod (without any actual functionality) may be used as a starter (the implementation itself will be different), its current handling may be reasonable for some parts, too.
The text was updated successfully, but these errors were encountered: