--- Begin Message ---
Subject: |
CSS mode colour highlighting makes text hard to read |
Date: |
Tue, 30 Jan 2018 16:55:14 +0000 |
In CSS mode, the value "green" or "#0f0" or "rgba(0,255,0,0.5)" is
displayed with a white foreground and a 100%-green background, which
is difficult to see.
A white foreground is chosen on even lighter colours, for example,
"#5e5" and "#87e087".
See functions css--contrasty-color in textmodes/css-mode.el and
color-distance in src/xfaces.c, and
<https://debbugs.gnu.org/cgi/bugreport.cgi?bug=25525>, and
<https://www.compuphase.com/cmetric.htm>.
If the color-distance is to be used, the appropriate formula is:
(if (> (color-distance name "black") (color-distance name "white"))
"black" "white")
That formula still maps "green" to "white", but it does at least map
lighter colours such as "#38e038" to "black".
For what it's worth, in my inexpert opinion it makes more sense to
compare the luma against that of mid-grey as Tom originally proposed.
--- End Message ---
--- Begin Message ---
Subject: |
Re: bug#30295: CSS mode colour highlighting makes text hard to read |
Date: |
Mon, 15 Jun 2020 22:12:53 +0200 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/27.0.91 (gnu/linux) |
The problem with these colors should now be fixed with Mattias' recent
changes in commit 68ae6faa7f1b4c348740667f98fbf1d1ce5a7979 on
master. Closing.
-- Simen
--- End Message ---