bug-ncurses
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Exceeding COLORS


From: Thomas Dickey
Subject: Re: Exceeding COLORS
Date: Wed, 29 Jan 2020 18:53:28 -0500
User-agent: NeoMutt/20170113 (1.7.2)

On Wed, Jan 29, 2020 at 03:21:21PM -0600, Bryan Christ wrote:
> When ncurses starts up, I know that it looks at the value of "colors" from
> the terminfo entry and sets COLORS accordingly.  However, I also know that
> the underlying terminal supports way more colors and pairs than is
> advertised by the terminfo entry.  Is there a way to forcibly exceed that
> limit?  The following script runs great on the native terminal, but as soon
> as I run in my emulator, under the confines of ncurses, I hit a 256 color
> wall.
> 
> !/bin/bash
> awk 'BEGIN{
>     s="/\\/\\/\\/\\/\\"; s=s s s s s s s s;
>     for (colnum = 0; colnum<77; colnum++) {
>         r = 255-(colnum*255/76);
>         g = (colnum*510/76);
>         b = (colnum*255/76);
>         if (g>255) g = 510-g;
>         printf "\033[48;2;%d;%d;%dm", r,g,b;
>         printf "\033[38;2;%d;%d;%dm", 255-r,255-g,255-b;
>         printf "%s\033[0m", substr(s,colnum+1,1);
>     }
>     printf "\n";
> }'

I suspect the issue to resolve is in your emulator - ncurses 6.1 can
_show_  2^24 colors using the xterm-direct terminal description
(though it requires some work to map to/from the different representations),
but it won't show 2^24 colors using xterm-256color

Using the full range of colors requires the *_extended functions,
as I did in picsmap:

https://github.com/ThomasDickey/ncurses-snapshots/blob/master/test/picsmap.c

e.g., these

extern NCURSES_EXPORT(int) init_extended_color(int, int, int, int);
extern NCURSES_EXPORT(int) init_extended_pair(int, int, int);

and the functions where an "opts" parameter was reserved to be null:

https://invisible-island.net/ncurses/man/curs_attr.3x.html

-- 
Thomas E. Dickey <address@hidden>
https://invisible-island.net
ftp://ftp.invisible-island.net

Attachment: signature.asc
Description: PGP signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]