I have tried this with kitty, wezterm and foot and it works perfectly:
https://www.gnu.org/software/emacs/manual/html_node/efaq/Colors-on-a-TTY.html
The issue is probably the one mentioned at the bottom of the linked page:
> Terminals with ‘RGB’ capability treat pixels #000001 - #000007 as indexed colors to maintain backward compatibility with applications that are unaware of direct color mode. Therefore the seven darkest blue shades may not be available. If this is a problem, you can always use custom terminal definition with ‘setb24’ and ‘setf24’.
I am not sure why they exclude #000000 which is evidently not mapped
to actual black. I also thought Emacs 29 would alleviate the need to
maintain a custom terminfo source file, but apparently the situation
with terminals is quite messy...
Hello Dimitri,
> From: Dimitris Triantafyllidis <dimitris.triantafyllidis@gmail.com>
> Date: Fri, 4 Aug 2023 08:23:00 +0300
>
> I have tried this with kitty, wezterm and foot and it works perfectly:
> https://www.gnu.org/software/emacs/manual/html_node/efaq/Colors-on-a-TTY.html
>
> The issue is probably the one mentioned at the bottom of the linked page:
>
>> Terminals with ‘RGB’ capability treat pixels #000001 - #000007 as
>> indexed colors to maintain backward compatibility with applications
>> that are unaware of direct color mode. Therefore the seven darkest
>> blue shades may not be available. If this is a problem, you can
>> always use custom terminal definition with ‘setb24’ and ‘setf24’.
>
> I am not sure why they exclude #000000 which is evidently not mapped
> to actual black. I also thought Emacs 29 would alleviate the need to
> maintain a custom terminfo source file, but apparently the situation
> with terminals is quite messy...
I have these entries in the manual, based on the experiments I have
done:
- "Range of color with terminal emulators":
https://protesilaos.com/emacs/modus-themes#h:6b8211b0-d11b-4c00-9543-4685ec3b742f
- "More accurate colors in terminal emulators":
https://protesilaos.com/emacs/modus-themes#h:fbb5e254-afd6-4313-bb05-93b3b4f67358
The issue with the main background is that Emacs cannot produce a value
outside the outer boundaries of termcolor0 (black) and termcolor15
(bright white), so if the terminal emulator maps termcolor0 to, say,
#333333 then modus-vivendi will use that as its "black".
Emacs in the terminal seems to work fine on my end when termcolor0 is
#000000 and termcolor15 is #ffffff, notwithstanding the note I include
about improved colour accuracy.
Those granted, I still get the best results with GUI Emacs.
All the best,
Protesilaos (or simply "Prot")
--
Protesilaos Stavrou
https://protesilaos.com