[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: (OS X) Color component values of more than 680 only show as red
From: |
Thomas Dickey |
Subject: |
Re: (OS X) Color component values of more than 680 only show as red |
Date: |
Tue, 07 May 2013 19:56:03 -0400 |
User-agent: |
Mutt/1.5.20 (2009-06-14) |
On Tue, May 07, 2013 at 11:12:47PM +0100, Ben Fox-Moore wrote:
> I've noticed some strange behaviour with Ncurses 5.7 on my OS X 10.8
> machine. If I try to create a custom color with (r,g,b) values
> (681,681,681), instead of showing up pretty much identical to COLOR_WHITE,
> it becomes a shade of red. (The same also applies to values above 681,
> always displaying the same shade of red.)
>
> Here's some example code which has the problem:
> https://gist.github.com/InfernoZeus/5536379
> and here's the result in OS X: http://i.imgur.com/GgaBP1p.png
>
> First off, am I doing something wrong in my code? If not, is this a bug in
> OS X?
I think the problem is OS X.
They've set $TERM to xterm-256color, which raises expectations about the
behavior of the terminal emulator. The entries which we've recommended
are the "nsterm" ones (including nsterm-256color). The xterm-256color
entry does define initc (which your program assumes, more or less), but
the nsterm ones do not.
Checking now to see if that was overlooked (and perhaps scaled
inconsistently) using the ncurses test-program menu 'd', I don't see any
sign that the initc capability is honored (so the recommended entries
still are nsterm, etc). Since you're not able to set the palette, then
your program will give odd results.
--
Thomas E. Dickey <address@hidden>
http://invisible-island.net
ftp://invisible-island.net
signature.asc
Description: Digital signature