all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Eli Zaretskii <eliz@gnu.org>
To: Gerry Agbobada <gerry@fiberplane.com>
Cc: 70941@debbugs.gnu.org
Subject: bug#70941: 30.0.50; Low RGB color values use the terminal palette in TUI
Date: Sat, 18 May 2024 13:23:30 +0300	[thread overview]
Message-ID: <86bk53e7vh.fsf@gnu.org> (raw)
In-Reply-To: <51962D32-7656-442E-9DFD-07A4AA533057@fiberplane.com> (message from Gerry Agbobada on Tue, 14 May 2024 21:45:13 +0200)

> From: Gerry Agbobada <gerry@fiberplane.com>
> Date: Tue, 14 May 2024 21:45:13 +0200
> Cc: 70941@debbugs.gnu.org
> 
> > Emacs doesn't have a lisp/term/wezterm.el file, so the question is
> > what is your TERM environment variable set to?
> 
> My bad, the TERM environment variable is set to xterm-256color
> there. But infocmp -x still does not show any setf24 or setb24,
> only setab and setaf again, this time (it seems to be the exact same)
> 
> #+begin_src
> setab=\E[%?%p1%{8}%<%t4%p1%d%e%p1%{16}%<%t10%p1%{8}%-%d%e48;5;%p1%d%;m,
> setaf=\E[%?%p1%{8}%<%t3%p1%d%e%p1%{16}%<%t9%p1%{8}%-%d%e38;5;%p1%d%;m,
> #+end_src

Might be a problem with infocmp, perhaps?

> > You expect the terminal to obey the X RGB color specification
> > directly, but that is not how TTY color support works in Emacs.  Emacs
> > approximates each X color using the colors that the terminal actually
> > supports.  So we should start by looking at the color setup and how
> > many colors that yields.  What does "M-x list-colors-display" produce?
> 
> What bothers me is that there seems to be an inconsistency there. I expect
> Emacs in a terminal that supports 24-bit to show the colour `#000000` as
> pitch black. Instead it’s the 0th colour of the terminal emulator palette. All
> the colours seems to be displayed exactly as they should, except the
> first 8 ones.

That's because you use #RGB with 2 hex digits per color component.
Emacs, by contrast, uses 16-bit color components, i.e. 4 hex digits
per component.  When you use 2 hex digits, Emacs scales them to 16-bit
values, and that causes the effect you see, because 01 is not scaled
to 0001, but to 0100 instead.  So try with "#000000000001" etc. in
your recipe, and I think you should see what you expect.

> To answer your question, `M-x list-colors-display` seems to show the
> maximum amount possible (all the colours are named like « goldenrod » 
> etc.), but the first 8 ones definitely don’t look right.

Why do you think the first 8 are not right?  list-colors-display does
not show the colors in the numerical order, it shows first the
standard colors, and then the rest.  This order is unrelated to the
issue at hand.





  reply	other threads:[~2024-05-18 10:23 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-05-14 15:18 bug#70941: 30.0.50; Low RGB color values use the terminal palette in TUI Gerry Agbobada
2024-05-14 17:33 ` Eli Zaretskii
2024-05-14 19:45   ` Gerry Agbobada
2024-05-18 10:23     ` Eli Zaretskii [this message]
     [not found]       ` <CAJ=DXSnmZxC20Xd_cB+3n_T3GeKmbSo=7xZG9DKYGKfOD965Pw@mail.gmail.com>
2024-05-18 15:41         ` Eli Zaretskii
2024-05-19 13:54           ` Gerry Agbobada
2024-05-19 15:34             ` Eli Zaretskii
2024-05-19 15:54               ` Gerry Agbobada
2024-05-19 16:27                 ` Eli Zaretskii

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=86bk53e7vh.fsf@gnu.org \
    --to=eliz@gnu.org \
    --cc=70941@debbugs.gnu.org \
    --cc=gerry@fiberplane.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.