GNU bug report logs -
#34001
26.1.90; :distant-foreground face property fails to work in most cases
Previous Next
To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 34001 in the body.
You can then email your comments to 34001 AT debbugs.gnu.org in the normal way.
Toggle the display of automated, internal messages from the tracker.
Report forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#34001
; Package
emacs
.
(Sun, 06 Jan 2019 22:56:02 GMT)
Full text and
rfc822 format available.
Acknowledgement sent
to
Tina Russell <tinakellyrussell <at> gmail.com>
:
New bug report received and forwarded. Copy sent to
bug-gnu-emacs <at> gnu.org
.
(Sun, 06 Jan 2019 22:56:02 GMT)
Full text and
rfc822 format available.
Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):
[Message part 1 (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 2 (text/html, inline)]
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#34001
; Package
emacs
.
(Wed, 16 Jan 2019 01:09:02 GMT)
Full text and
rfc822 format available.
Message #8 received at 34001 <at> debbugs.gnu.org (full text, mbox):
[Message part 1 (text/plain, inline)]
Tina Russell <tinakellyrussell <at> gmail.com> writes:
> :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'
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:
M-: (setq face-near-same-color-threshold 200000)
M-: (clear-font-cache)
Then, using your third example, the text will be displayed with a black
foregound.
Is this a reasonable fix, or should we consider implementing another way
of measuring distance between colors like Tina mentioned?
[foreground.patch (text/x-diff, attachment)]
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#34001
; Package
emacs
.
(Sun, 20 Jan 2019 03:21:01 GMT)
Full text and
rfc822 format available.
Message #11 received at 34001 <at> debbugs.gnu.org (full text, mbox):
Well, even if we change the backend for how color distance is
measured, we’ll probably still need a user option for “how much color
distance is required for two colors to be considered appropriately
distant,” so it seems like a good place to start in any event.
Thanks!
On Tue, Jan 15, 2019 at 5:08 PM Federico Tedin <federicotedin <at> gmail.com> wrote:
>
> Tina Russell <tinakellyrussell <at> gmail.com> writes:
>
> > :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'
>
> 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:
>
> M-: (setq face-near-same-color-threshold 200000)
> M-: (clear-font-cache)
>
> Then, using your third example, the text will be displayed with a black
> foregound.
>
> Is this a reasonable fix, or should we consider implementing another way
> of measuring distance between colors like Tina mentioned?
>
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#34001
; Package
emacs
.
(Sun, 20 Jan 2019 17:16:01 GMT)
Full text and
rfc822 format available.
Message #14 received at 34001 <at> debbugs.gnu.org (full text, mbox):
> Well, even if we change the backend for how color distance is
> measured, we’ll probably still need a user option for “how much color
> distance is required for two colors to be considered appropriately
> distant,” so it seems like a good place to start in any event.
I agree! Either option should be configurable. We should wait and see if
a maintainer has any thoughts on this as well.
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#34001
; Package
emacs
.
(Mon, 21 Jan 2019 22:59:01 GMT)
Full text and
rfc822 format available.
Message #17 received at 34001 <at> debbugs.gnu.org (full text, mbox):
Tina Russell <tinakellyrussell <at> gmail.com> writes:
> 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
It would be nice if any work in this area took into consideration
existing efforts by Julien Danjou (CCed) in lisp/net/shr-color.el
(see e.g. user options shr-color-visible-luminance-min and
shr-color-visible-distance-min and function shr-color-visible).
For example, the library may end up either duplicating existing core
logic, or prove sufficiently useful that it is moved to a less
SHR-specific location (I'm just speculating).
> , 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.
FWIW, there has been some discussion of colour distances in bug#25525
and bug#30295:
https://debbugs.gnu.org/25525
https://debbugs.gnu.org/30295
--
Basil
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#34001
; Package
emacs
.
(Mon, 21 Jan 2019 23:10:02 GMT)
Full text and
rfc822 format available.
Message #20 received at 34001 <at> debbugs.gnu.org (full text, mbox):
On 1/21/19 5:58 PM, Basil L. Contovounesios wrote:
> Tina Russell <tinakellyrussell <at> gmail.com> writes:
>
>> 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
>
> It would be nice if any work in this area took into consideration
> existing efforts by Julien Danjou (CCed) in lisp/net/shr-color.el
> (see e.g. user options shr-color-visible-luminance-min and
> shr-color-visible-distance-min and function shr-color-visible).
>
> For example, the library may end up either duplicating existing core
> logic, or prove sufficiently useful that it is moved to a less
> SHR-specific location (I'm just speculating).
>
>> , 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.
>
> FWIW, there has been some discussion of colour distances in bug#25525
> and bug#30295:
>
> https://debbugs.gnu.org/25525
> https://debbugs.gnu.org/30295
>
I think I had a proposal a long time ago to just call into lisp during
redisplay in order to compute the color composition.
Reply sent
to
Eli Zaretskii <eliz <at> gnu.org>
:
You have taken responsibility.
(Fri, 01 Mar 2019 08:41:01 GMT)
Full text and
rfc822 format available.
Notification sent
to
Tina Russell <tinakellyrussell <at> gmail.com>
:
bug acknowledged by developer.
(Fri, 01 Mar 2019 08:41:02 GMT)
Full text and
rfc822 format available.
Message #25 received at 34001-done <at> debbugs.gnu.org (full text, mbox):
> 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.
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#34001
; Package
emacs
.
(Fri, 01 Mar 2019 12:45:02 GMT)
Full text and
rfc822 format available.
Message #28 received at 34001-done <at> debbugs.gnu.org (full text, mbox):
[Message part 1 (text/plain, inline)]
Thanks Eli!
I have a question regarding commit messages and documentation: should I
include them in the first iteration of the patch I created, or should I
wait until there’s been some conversation first? Until now I’ve chosen the
first option since I’m not always sure the patch I created is
correct/applicable/etc.
On Fri, 1 Mar 2019 at 05:40 Eli Zaretskii <eliz <at> gnu.org> wrote:
> > 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.
>
[Message part 2 (text/html, inline)]
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#34001
; Package
emacs
.
(Fri, 01 Mar 2019 13:50:02 GMT)
Full text and
rfc822 format available.
Message #31 received at 34001 <at> debbugs.gnu.org (full text, mbox):
> From: Federico Tedin <federicotedin <at> gmail.com>
> Date: Fri, 1 Mar 2019 09:44:30 -0300
> Cc: 34001-done <at> debbugs.gnu.org, tinakellyrussell <at> gmail.com
>
> I have a question regarding commit messages and documentation: should I include them in the first iteration
> of the patch I created, or should I wait until there’s been some conversation first? Until now I’ve chosen the
> first option since I’m not always sure the patch I created is correct/applicable/etc.
Please include them with all the iterations, so that whoever ends up
pushing the changes will only need to look at a single email message.
bug archived.
Request was from
Debbugs Internal Request <help-debbugs <at> gnu.org>
to
internal_control <at> debbugs.gnu.org
.
(Sat, 30 Mar 2019 11:24:03 GMT)
Full text and
rfc822 format available.
This bug report was last modified 6 years and 79 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.