all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Juri Linkov <juri@linkov.net>
To: Richard Copley <rcopley@gmail.com>
Cc: 30295@debbugs.gnu.org
Subject: bug#30295: CSS mode colour highlighting makes text hard to read
Date: Thu, 01 Feb 2018 23:17:47 +0200	[thread overview]
Message-ID: <87zi4s8l1o.fsf@mail.linkov.net> (raw)
In-Reply-To: <CAPM58ojA5GYKoPvOVPT404E-+HoHoXEtaHqyf++Ddj1CqTP8kg@mail.gmail.com> (Richard Copley's message of "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.

Indeed, luma is more suitable than mid-grey, customizing
‘list-colors-sort’ to “luminance” shows that distinguishable colors with
the black foreground start closer to the beginning of the color list.

Or we could use both luma and distance like in ‘shr-color-visible’
with two customizable options:
‘shr-color-visible-luminance-min’ and
‘shr-color-visible-distance-min’.





  reply	other threads:[~2018-02-01 21:17 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-01-30 16:55 bug#30295: CSS mode colour highlighting makes text hard to read Richard Copley
2018-02-01 21:17 ` Juri Linkov [this message]
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=87zi4s8l1o.fsf@mail.linkov.net \
    --to=juri@linkov.net \
    --cc=30295@debbugs.gnu.org \
    --cc=rcopley@gmail.com \
    /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.