From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.help Subject: Re: Working with colors in --batch mode Date: Sun, 25 Dec 2022 20:05:59 +0200 Message-ID: <83pmc72wag.fsf@gnu.org> References: <87fsd3id8e.fsf@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="27733"; mail-complaints-to="usenet@ciao.gmane.io" To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Sun Dec 25 19:06:40 2022 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1p9VOQ-00073C-LX for geh-help-gnu-emacs@m.gmane-mx.org; Sun, 25 Dec 2022 19:06:38 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1p9VNm-0003NG-Ua; Sun, 25 Dec 2022 13:05:58 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1p9VNl-0003N7-JZ for help-gnu-emacs@gnu.org; Sun, 25 Dec 2022 13:05:57 -0500 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1p9VNl-0005o5-BD for help-gnu-emacs@gnu.org; Sun, 25 Dec 2022 13:05:57 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-version:References:Subject:In-Reply-To:To:From: Date; bh=qV6uitf05KWxuEj/+valcgH3x46PwA/bbVrabZxIxmI=; b=HNMEmJn3ll91jfcjcGiy Xva6x5yqkCN66xhBTshicjkt/EP7SDtQv1k5MfiVjRNMZFkeBlRVZOwiBjjQGnf10hDw9cZfTgf7N rNkOksgovOsGAG1tuCZKf+VSRIpLaxWzWMUFTmJvCvgdrNXq9jEyrHnV8S6/8sVWJufV7jcdhNze+ 9UNxhVVXw6cz++/C+xhOTkHvbwrixcUUNDJ5aOriULfhkvKkzHzJiYJpRFU17/CCVRwymMIKo+QMV EE1sC6AbxE90HrduFLtXt+PmgL86u1bD76xW15RRnYYNzp0CJR1Z/x/zVer9sLW41WKO5QeOYV/av INCxmlls6AmCkA==; Original-Received: from [87.69.77.57] (helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1p9VNk-0007dD-KU for help-gnu-emacs@gnu.org; Sun, 25 Dec 2022 13:05:56 -0500 In-Reply-To: <87fsd3id8e.fsf@gmail.com> (message from =?utf-8?Q?K=C3=A9vin?= Le Gouguec on Sun, 25 Dec 2022 18:50:57 +0100) X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.help:141937 Archived-At: > From: Kévin Le Gouguec > 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.