help-gnu-emacs
[Top][All Lists]
Advanced

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

Re: Working with colors in --batch mode


From: Eli Zaretskii
Subject: Re: Working with colors in --batch mode
Date: Sun, 25 Dec 2022 20:05:59 +0200

> From: Kévin Le Gouguec <kevin.legouguec@gmail.com>
> Date: Sun, 25 Dec 2022 18:50:57 +0100
> 
> For some reason, today finds me playing with color contrast, and having
> a devil of a time doing so in --batch mode.
> 
> Specifically, I'm stumped by…
> 
> $ emacs --batch \
>     --eval '(message "color-name-to-rgb: %s"
>                      (color-name-to-rgb "#abcdef"))'
> 
> … returning…
> 
> > color-name-to-rgb: (0.0 1.0 1.0)
> 
> … whereas in a non-batch session on an X display, I get something more
> relevant to my usual Emacs experience (i.e. (window-system) ↦ x):
> 
> > color-name-to-rgb: (0.6705882352941176 0.803921568627451 0.9372549019607843)

Emacs doesn't (and cannot, I think) load X colors unless it
initializes the X display, and that doesn't happen in batch sessions.
Basically, batch sessions behave like a colorless TTY session.



reply via email to

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