From: Richard Copley <rcopley@gmail.com>
To: 30295@debbugs.gnu.org
Subject: bug#30295: CSS mode colour highlighting makes text hard to read
Date: Tue, 30 Jan 2018 16:55:14 +0000 [thread overview]
Message-ID: <CAPM58ojA5GYKoPvOVPT404E-+HoHoXEtaHqyf++Ddj1CqTP8kg@mail.gmail.com> (raw)
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.
next reply other threads:[~2018-01-30 16:55 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-01-30 16:55 Richard Copley [this message]
2018-02-01 21:17 ` bug#30295: CSS mode colour highlighting makes text hard to read Juri Linkov
2018-02-01 23:03 ` Richard Copley
2020-06-15 20:12 ` Simen Heggestøyl
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=CAPM58ojA5GYKoPvOVPT404E-+HoHoXEtaHqyf++Ddj1CqTP8kg@mail.gmail.com \
--to=rcopley@gmail.com \
--cc=30295@debbugs.gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.