Re: 256 Colors

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

 



Hi Samuel,

On Wed, 9 Jun 2021, Samuel Thibault wrote:
AFAIK the Linux console does not support more than 16 colors for
foreground and 8 colors for the background (+ blinking). How do you get
up to 256 colors?

I use screen. I have this in my screenrc:

I will happily send a patch if I get it working, but I honestly don't know C, so I'm most likely going to need some help.

# 256 colors
terminfo xterm Co=256
termcap  xterm Co=256
termcap  xterm AF=\E[38;5;%dm
terminfo xterm AF=\E[38;5;%p1%dm
termcap  xterm AB=\E[48;5;%dm
terminfo xterm AB=\E[48;5;%p1%dm


What I've managed to do so far is

2. Use i18n colors for colors 9 through 15 instead of prepending "bright"
before  colors 1 through 7

Patch welcome :)

I think the below function is what needs to be changed.
update_color_buffer

This function is only for the background color:

bi = (vc->vc_attr & 0x70) >> 4;

is getting the 3-bit background color, and the rest is indexed on that.

Samuel






[Index of Archives]     [Linux for the Blind]     [Fedora Discussioin]     [Linux Kernel]     [Yosemite News]     [Big List of Linux Books]

  Powered by Linux