From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.ciao.gmane.io!not-for-mail From: =?utf-8?Q?Mattias_Engdeg=C3=A5rd?= Newsgroups: gmane.emacs.devel Subject: Re: master 68ae6fa: Improved light/dark colour predicate (bug#41544) Date: Thu, 11 Jun 2020 18:15:02 +0200 Message-ID: References: <20200610181238.9796.44750@vcs0.savannah.gnu.org> <20200610181239.947C4204DF@vcs0.savannah.gnu.org> Mime-Version: 1.0 (Mac OS X Mail 12.4 \(3445.104.14\)) Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="ciao.gmane.io:159.69.161.202"; logging-data="113238"; mail-complaints-to="usenet@ciao.gmane.io" Cc: Stefan Monnier , Emacs developers To: Yuri Khan Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Thu Jun 11 18:23:59 2020 Return-path: Envelope-to: ged-emacs-devel@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1jjPzh-000TNO-2s for ged-emacs-devel@m.gmane-mx.org; Thu, 11 Jun 2020 18:23:57 +0200 Original-Received: from localhost ([::1]:48366 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jjPzg-0004TZ-1V for ged-emacs-devel@m.gmane-mx.org; Thu, 11 Jun 2020 12:23:56 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:51650) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jjPrH-0000Ew-OB for emacs-devel@gnu.org; Thu, 11 Jun 2020 12:15:15 -0400 Original-Received: from mail178c50.megamailservers.eu ([91.136.10.188]:47476 helo=mail70c50.megamailservers.eu) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jjPrF-0003vR-4b for emacs-devel@gnu.org; Thu, 11 Jun 2020 12:15:15 -0400 X-Authenticated-User: mattiase@bredband.net DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=megamailservers.eu; s=maildub; t=1591892105; bh=0w4wMdIHYf/JZa7YY6sBBWO+bCV68KLuvxUZt8BqQ1A=; h=Subject:From:In-Reply-To:Date:Cc:References:To:From; b=JrqFC6Qut1B3GI6Tvj1K+2SZRMVPme+Z+uVHTtgEMulvqAA0tBWTNb0eFitwJ8Bxf aGnIY7NPMR+WHPK59FGwHnWexzhEkKHBEskKyIBJvC+F4JhsWlITSNPXAlln5627EU khrbgR9C1aCRkGfEbZU4qvV+hncdGpvUnHBwOrbk= Feedback-ID: mattiase@acm.or Original-Received: from [192.168.0.4] (c188-150-171-71.bredband.comhem.se [188.150.171.71]) (authenticated bits=0) by mail70c50.megamailservers.eu (8.14.9/8.13.1) with ESMTP id 05BGF2id013670; Thu, 11 Jun 2020 16:15:04 +0000 In-Reply-To: X-Mailer: Apple Mail (2.3445.104.14) X-CTCH-RefID: str=0001.0A782F17.5EE2580E.003C, ss=1, re=0.000, recu=0.000, reip=0.000, cl=1, cld=1, fgs=0 X-CTCH-VOD: Unknown X-CTCH-Spam: Unknown X-CTCH-Score: 0.000 X-CTCH-Flags: 0 X-CTCH-ScoreCust: 0.000 X-CSC: 0 X-CHA: v=2.3 cv=OKBZIhSB c=1 sm=1 tr=0 a=SF+I6pRkHZhrawxbOkkvaA==:117 a=SF+I6pRkHZhrawxbOkkvaA==:17 a=IkcTkHD0fZMA:10 a=M51BFTxLslgA:10 a=pGLkceISAAAA:8 a=iRZporoAAAAA:8 a=NkH0z-YEYWxvJnkjA_MA:9 a=7Zwj6sZBwVKJAoWSPKxL6X1jA+E=:19 a=QEXdDO2ut3YA:10 a=NOBgFS-JBQ2l-kSd6-zu:22 Received-SPF: softfail client-ip=91.136.10.188; envelope-from=mattiase@acm.org; helo=mail70c50.megamailservers.eu X-detected-operating-system: by eggs.gnu.org: First seen = 2020/06/11 12:15:07 X-ACL-Warn: Detected OS = Linux 2.2.x-3.x (no timestamps) [generic] X-Spam_score_int: -11 X-Spam_score: -1.2 X-Spam_bar: - X-Spam_report: (-1.2 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, SPF_HELO_NONE=0.001, SPF_SOFTFAIL=0.665, URIBL_BLOCKED=0.001 autolearn=_AUTOLEARN X-Spam_action: no action X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.io gmane.emacs.devel:252118 Archived-At: 11 juni 2020 kl. 07.15 skrev Yuri Khan : >=20 > On Thu, 11 Jun 2020 at 02:20, Stefan Monnier = wrote: >>=20 >> Where does this 0.6 come from? This is an excellent question and so is Yuri's, so I'm going to try to = answer both at the same time. Originally, 0.6^2.2=3D0.325 was chosen in order to preserve the = greyscale behaviour of the otherwise dubious R+G+B<0.6 criterion used by = Emacs in various places, with the assumption that at least the = brightness was carefully chosen. This appears to be sort-of true. > L =3D (1.05 * 0.05)^0.5 - 0.05 =E2=89=88 0.18 corresponding to a gray = around #767576 Yes, and moreover Y=3D0.18 corresponds to a lightness of 50%, so I very = much thought that it would be better than 0.325. However, the machines = and screens I've looked at (various LCD and CRT displays, macOS, Linux, = etc) don't bear that out. For example, white text is decidedly more = readable than black onto a background of #8b7500 (gold4) everywhere. Of = course, your equipment may be different! (I'll be more careful to keep a lab notebook next time -- mostly do that = for paid work/research only.) > Experimentally, I find white and black over #767576 about equally easy > to read; over a light gray #cccbcc (L=3D0.6), black is much more > readable than white. Unfortunately I only have access to my Mac right now, but here I find = white to be somewhat easier to read than black against #767576 as = background. That colour certainly looks darker than the balance point. As it turned out, however, the exact cut-off value matters a lot less = than anticipated. The most important property of contrasting colour = selection is not picking the slightly better one but avoiding a = disastrous choice, and there is a fairly wide interval of cut-off values = that do reasonably well; a lot of colours in the middle work with either = black or white. In addition, although different screens and systems vary in their = calibration and policy, it doesn't seem to matter much in this case. = When the colours move, so does white, keeping the relations roughly the = same. Precision may be more important when the same predicate is used for = selecting prearranged palettes for use against 'light' and 'dark' = backgrounds. This still needs to be investigated.