From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Juri Linkov Newsgroups: gmane.emacs.bugs Subject: bug#30295: CSS mode colour highlighting makes text hard to read Date: Thu, 01 Feb 2018 23:17:47 +0200 Organization: LINKOV.NET Message-ID: <87zi4s8l1o.fsf@mail.linkov.net> References: NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Trace: blaine.gmane.org 1517521184 20504 195.159.176.226 (1 Feb 2018 21:39:44 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Thu, 1 Feb 2018 21:39:44 +0000 (UTC) User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (x86_64-pc-linux-gnu) Cc: 30295@debbugs.gnu.org To: Richard Copley Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Thu Feb 01 22:39:39 2018 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ehMZj-0003qY-N4 for geb-bug-gnu-emacs@m.gmane.org; Thu, 01 Feb 2018 22:39:19 +0100 Original-Received: from localhost ([::1]:37083 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ehMbk-0005VE-Pl for geb-bug-gnu-emacs@m.gmane.org; Thu, 01 Feb 2018 16:41:24 -0500 Original-Received: from eggs.gnu.org ([208.118.235.92]:35758) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ehMaX-0004ou-4n for bug-gnu-emacs@gnu.org; Thu, 01 Feb 2018 16:41:15 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ehMZT-0007Ii-4w for bug-gnu-emacs@gnu.org; Thu, 01 Feb 2018 16:40:09 -0500 Original-Received: from debbugs.gnu.org ([208.118.235.43]:44966) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1ehMZS-0007IB-Pu for bug-gnu-emacs@gnu.org; Thu, 01 Feb 2018 16:39:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1ehMZS-000189-77 for bug-gnu-emacs@gnu.org; Thu, 01 Feb 2018 16:39:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Juri Linkov Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 01 Feb 2018 21:39:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 30295 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 30295-submit@debbugs.gnu.org id=B30295.15175211004278 (code B ref 30295); Thu, 01 Feb 2018 21:39:02 +0000 Original-Received: (at 30295) by debbugs.gnu.org; 1 Feb 2018 21:38:20 +0000 Original-Received: from localhost ([127.0.0.1]:52859 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ehMYm-00016w-DN for submit@debbugs.gnu.org; Thu, 01 Feb 2018 16:38:20 -0500 Original-Received: from sub3.mail.dreamhost.com ([69.163.253.7]:50142 helo=homiemail-a20.g.dreamhost.com) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ehMYl-00016p-6Y for 30295@debbugs.gnu.org; Thu, 01 Feb 2018 16:38:19 -0500 Original-Received: from homiemail-a20.g.dreamhost.com (localhost [127.0.0.1]) by homiemail-a20.g.dreamhost.com (Postfix) with ESMTP id 5DD3B7EC072; Thu, 1 Feb 2018 13:38:18 -0800 (PST) Original-Received: from localhost.linkov.net (m91-129-107-8.cust.tele2.ee [91.129.107.8]) (using TLSv1 with cipher DHE-RSA-AES128-SHA (128/128 bits)) (No client certificate requested) (Authenticated sender: jurta@jurta.org) by homiemail-a20.g.dreamhost.com (Postfix) with ESMTPSA id 83D057EC060; Thu, 1 Feb 2018 13:38:17 -0800 (PST) In-Reply-To: (Richard Copley's message of "Tue, 30 Jan 2018 16:55:14 +0000") X-Spam-Score: 0.0 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-Spam-Score: 0.0 (/) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.org gmane.emacs.bugs:142784 Archived-At: > 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 > , and > . > > 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 =E2=80=98list-colors-sort=E2=80=99 to =E2=80=9Cluminance=E2=80=9D shows t= hat 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 =E2=80=98shr-color-visible= =E2=80=99 with two customizable options: =E2=80=98shr-color-visible-luminance-min=E2=80=99 and =E2=80=98shr-color-visible-distance-min=E2=80=99.