in reply to Re: Re: Color on TrueWhite in Curses - Redux
in thread Color on TrueWhite in Curses - Redux

My mistake on simplifying this. You've obviously dug in quite a bit here ...

As a first course of action I'd still see if it's a terminal/driver limitation or a bug in curses; i.e., get into a mode on the terminal that allows you to type in escape sequences. When I used to do this stuff we wrote a small program for this that set the terminal to raw mode and recognized a 'QUIT' sequence to get back to the shell. That allowed us to try out the documented sequences. As you probably already know, what's documented doesn't always work. At one point we had three configurations for 3 different SCO xterm consoles because they kept introducing new bugs with each driver ... but I digress. Get to this sort of mode, set the background to true white, then try setting foreground colors and see if they work. That should show you if this is a terminal/driver issue or a curses issue.

  • Comment on Re: Re: Re: Color on TrueWhite in Curses - Redux

Replies are listed 'Best First'.
Re: Re: Re: Re: Color on TrueWhite in Curses - Redux
by dvergin (Monsignor) on Feb 04, 2003 at 22:15 UTC
    steves, thanks for your efforts to be of help.

    Can the terminal/driver handle multiple colors on a true white background? Yes. A simple "ls" command at the command line in a directory that has several different types of dir entries makes that clear.

    Can Curses produce color on a true white background? Again, yes. But as far as I have been able to discover, only through the use of the non-standard color "8" (or some other number higher than 7) in an assume_default_colors() command. This code works:

    assume_default_colors(COLOR_RED, 8); # True White bg! Why? my $win = new Curses; $win->addstr(0, 0, "Red on White");
    I can find no way to use
    init_pair(...); ... attron( $win, COLOR_PAIR(...) );
    to achieve some color on a true white background. And that seems to be what would be needed to give me more than one foreground color on a true white background.

    If I were willing to settle for any of the 8 predefined colors as a background, I would be home free. But even the off-white color that Curses calls "WHITE" greatly reduces the contrast and readability of the display.

    So in terms of the questions you pose, this all means that it is a Curses/ncurses issue. And that is the way I tried to frame the question in my original post.

    Update: I have even tried multiple assume_default_colors(COLOR_SOMETHING, 8) commands -- but no joy. If you want the tutorial on how that fails under various creative strategies, I will be glad to oblige...

    I have done a lot of reading and a lot of experimenting/testing and learned a whole bunch about Curses -- everything except the one thing I need to move forward. I am currently looking at other tools... Does anyone know how to get the alternate character set (with box graphics) under Term::ScreenColor? <g>

      Well the good news is that ncurses is open source so you're likely to find help. Worst case you can do a source build and track it down yourself. I checked out the home page. There are no mailing lists mentioned but there is an email address for contacting the current maintainers. I'd probably give that a shot.