bug-ncurses
[Top][All Lists]
Advanced

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

Re: XTerm: Incorrect Colors in Printed Output


From: Mike Gran
Subject: Re: XTerm: Incorrect Colors in Printed Output
Date: Sun, 19 Nov 2023 15:28:14 +0000 (UTC)

Hello,
> Hi, again.

> Does anyone know what the purpose of the following code is (from send_SGR of  
> “print.c”):

> > #if OPT_ISO_COLORS && OPT_PC_COLORS
> >     if ((attr & FG_COLOR) && (fg != NO_COLOR)) {
> >         if (TScreenOf(xw)->boldColors
> >             && fg > 8
> >             && (attr & BOLD) != 0)
> >             fg -= 8;
> >     }
> > #endif

> The foreground is decremented by 8, and this results in incorrect colors for  
> me (for any foreground color of index >= 128 combined with BOLD).

> I cannot figure out what this code is trying to do, and commenting it out  
> seems to resolve the issue.  Is my XTerm built incorrectly?

If you are using the standard 16-colors on a terminal, colors 8 to 15
are brighter versions of colors 0 to 7. So this is swapping bright colors
for dim. But that code isn't relevant to 256 color palettes for colors
16 and above.

(Although, in the 256 color palettes, subtracting 8 off the color number
sometimes still gives a similar color.)



reply via email to

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