GNU bug report logs - #34001
26.1.90; :distant-foreground face property fails to work in most cases

Previous Next

Package: emacs;

Reported by: Tina Russell <tinakellyrussell <at> gmail.com>

Date: Sun, 6 Jan 2019 22:56:02 UTC

Severity: normal

Found in version 26.1.90

Done: Eli Zaretskii <eliz <at> gnu.org>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: help-debbugs <at> gnu.org (GNU bug Tracking System)
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: tracker <at> debbugs.gnu.org
Subject: bug#34001: closed (26.1.90; :distant-foreground face property
 fails to work in most cases)
Date: Fri, 01 Mar 2019 08:41:02 +0000
[Message part 1 (text/plain, inline)]
Your message dated Fri, 01 Mar 2019 10:40:10 +0200
with message-id <83o96vhtsl.fsf <at> gnu.org>
and subject line Re: bug#34001: 26.1.90; :distant-foreground face property fails to work in most cases
has caused the debbugs.gnu.org bug report #34001,
regarding 26.1.90; :distant-foreground face property fails to work in most cases
to be marked as done.

(If you believe you have received this mail in error, please contact
help-debbugs <at> gnu.org.)


-- 
34001: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=34001
GNU Bug Tracking System
Contact help-debbugs <at> gnu.org with problems
[Message part 2 (message/rfc822, inline)]
From: Tina Russell <tinakellyrussell <at> gmail.com>
To: bug-gnu-emacs <at> gnu.org
Subject: 26.1.90; :distant-foreground face property fails to work in most cases
Date: Sun, 6 Jan 2019 14:31:51 -0800
[Message part 3 (text/plain, inline)]
:distant-foreground is a very useful concept for a face property: text
will be rendered with the :foreground color, unless it’s too close to
the current background color, in which case :distant-foreground kicks
in. Like, try this in Eshell or IELM:

(propertize "Greetings, esteemed Emacs developers!" 'face '(:foreground
"yellow" :background "yellow"))

You’ll get a solid band of yellow, of course. But, with
:distant-foreground…

(propertize "Greetings, esteemed Emacs developers!" 'face '(:foreground
"yellow" :background "yellow" :distant-foreground "black"))

Now it is a friendly greeting. (Naturally, you wouldn’t normally set
:background and :distant-foreground in the same face, this is just an
example.)

But, try this:

(propertize "Greetings, esteemed Emacs developers!" 'face '(:foreground
"yellow" :background "white" :distant-foreground "black"))

:distant-foreground doesn’t kick in—and you’re left with yellow-on-white
text that’s impossible to read, the exact scenario that
:distant-foreground was quite rightly designed to avoid.

I’m not the only one who’s noticed this; there’s a good StackExchange
thread from 2015 here:
https://emacs.stackexchange.com/questions/7982/ The author notes that
there should be a user option to set the amount of “distance” (between
foreground and background colors) that is required for
distant-foreground to kick in, and adds that a good way to measure
color distance in real-world circumstances is described here:
http://web.mst.edu/~rhall/web_design/color_readability.html A commenter
suggested that he file a bug, but I can’t find an Emacs bug report
related to this issue, so I’m filing this now.

I really hope this gets addressed, because :distant-foreground is a
really nice and clever feature. Thanks!

In GNU Emacs 26.1.90 (build 2, x86_64-pc-linux-gnu, GTK+ Version 3.22.30)
 of 2019-01-02 built on pannychis
Repository revision: 08840f2f7bfc6144bd163dd85efe87d28541e425
Windowing system distributor 'The X.Org Foundation', version 11.0.11906000
System Description: Ubuntu 18.04.1 LTS

Configured using:
 'configure --with-xaw3d --with-modules --with-xwidgets'
[Message part 4 (text/html, inline)]
[Message part 5 (message/rfc822, inline)]
From: Eli Zaretskii <eliz <at> gnu.org>
To: Federico Tedin <federicotedin <at> gmail.com>
Cc: 34001-done <at> debbugs.gnu.org, tinakellyrussell <at> gmail.com
Subject: Re: bug#34001: 26.1.90;
 :distant-foreground face property fails to work in most cases
Date: Fri, 01 Mar 2019 10:40:10 +0200
> From: Federico Tedin <federicotedin <at> gmail.com>
> Date: Tue, 15 Jan 2019 22:08:15 -0300
> 
> I've created a patch that introduces a new variable
> `face-near-same-color-threshold', with a default value of 30000 (as was
> defined in NEAR_SAME_COLOR_THRESHOLD in xfaces.c). Changing this
> variable's value will make certain color combinations be considered as
> 'same', which will lead to :distant-foreground being used. For example:

Sorry for the long delay, I've now pushed your change to the master
branch.

Please in the future provide a ChangeLog-style commit log message for
your changes, and also accompany them with the pertinent updates for
the documentation.  I did that for this change.

Thanks again for working on this.


This bug report was last modified 6 years and 80 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.