[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: ISO-8613-6 sequences for RGB color
From: |
Thomas Dickey |
Subject: |
Re: ISO-8613-6 sequences for RGB color |
Date: |
Tue, 15 Jan 2019 21:30:46 -0500 |
User-agent: |
Mutt/1.5.23 (2014-03-12) |
On Tue, Jan 15, 2019 at 09:57:36AM -0600, Bryan Christ wrote:
> Okay, that being the case, is there a way to coerce ncurses into always
> emitting (instead of / along side) of with the longer:
>
> ESC [ 38 ; 2 ; Pi ; Pr ; Pg ; Pb ; m
ncurses does what the user configures - starting with $TERM
In principle, you could force everyone to use the direct color sequence
(by only accepting a terminal description that does that). But it would
break all of the scripts/programs which use indexed color (ANSI 8 colors, etc).
> On Mon, Jan 14, 2019 at 7:32 PM Thomas Dickey <address@hidden> wrote:
>
> > On Mon, Jan 14, 2019 at 10:46:34AM -0600, Bryan Christ wrote:
> > > Thomas,
> > >
> > > Is it possible to query the underlying terminal regarding a color? I
> >
> > not in general (xterm has escape sequences, but ncurses is general)
> >
> > > assume it has to be possible since the following sequence has to be
> > > interpreted somehow. It presupposes that a terminal would know what
> > color
> > > Ps actually is.
> > >
> > > ESC [ 38 ; 5 ; Ps; m
> > >
> > > Hoping to work it backward, I've looked through the source code for
> > ncurses
> > > to see how init_color() informs the underlying terminal but I'm not
> > finding
> > > the relevant code.
> >
> > in ncurses/base/lib_color.c around line 740, that's this chunk:
> >
> > #ifdef USE_TERM_DRIVER
> > CallDriver_4(sp, td_initcolor, color, r, g, b);
> > #else
> > NCURSES_PUTP2("initialize_color",
> > TPARM_4(initialize_color, color, r, g, b));
> > #endif
> >
> > which sends the escape sequence.
--
Thomas E. Dickey <address@hidden>
https://invisible-island.net
ftp://ftp.invisible-island.net
signature.asc
Description: Digital signature