From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.emacs.gnus.general/74268 Path: news.gmane.org!not-for-mail From: Julien Danjou Newsgroups: gmane.emacs.devel,gmane.emacs.gnus.general Subject: Colour blindness correction (was: Colour manipulation) Date: Tue, 23 Nov 2010 19:32:31 +0100 Message-ID: <87sjyrhow0.fsf_-_@keller.adm.naquadah.org> References: <87pquvldcs.fsf@lifelogs.com> <87oc9yp21w.fsf@lifelogs.com> <87lj4pmgu7.fsf@keller.adm.naquadah.org> <87oc9ihjbk.fsf@keller.adm.naquadah.org> <8739quh5gk.fsf@keller.adm.naquadah.org> <87zkt1b0nv.fsf@lifelogs.com> <87pqtw9jon.fsf@lifelogs.com> <87eiac9fsz.fsf@lifelogs.com> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Trace: dough.gmane.org 1290537181 18221 80.91.229.12 (23 Nov 2010 18:33:01 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Tue, 23 Nov 2010 18:33:01 +0000 (UTC) Cc: ding@gnus.org, emacs-devel@gnu.org To: Ted Zlatanov Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Tue Nov 23 19:32:57 2010 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1PKxfk-0003u7-Vf for ged-emacs-devel@m.gmane.org; Tue, 23 Nov 2010 19:32:57 +0100 Original-Received: from localhost ([127.0.0.1]:36053 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PKxfk-0006FC-5j for ged-emacs-devel@m.gmane.org; Tue, 23 Nov 2010 13:32:56 -0500 Original-Received: from [140.186.70.92] (port=47947 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PKxfW-0006Ex-Gh for emacs-devel@gnu.org; Tue, 23 Nov 2010 13:32:51 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PKxfR-0007vu-3W for emacs-devel@gnu.org; Tue, 23 Nov 2010 13:32:42 -0500 Original-Received: from prometheus.naquadah.org ([212.85.154.174]:53216 helo=mx1.naquadah.org) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PKxfQ-0007va-S3 for emacs-devel@gnu.org; Tue, 23 Nov 2010 13:32:37 -0500 Original-Received: by mx1.naquadah.org (Postfix, from userid 8) id D56795C1E9; Tue, 23 Nov 2010 19:32:34 +0100 (CET) Original-Received: from keller.adm.naquadah.org (unknown [IPv6:2a01:e35:2e39:e900:222:faff:fe9d:ce44]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.naquadah.org (Postfix) with ESMTPSA id A3A9C5C160; Tue, 23 Nov 2010 19:32:32 +0100 (CET) Original-Received: from jd by keller.adm.naquadah.org with local (Exim 4.72) (envelope-from ) id 1PKxfL-0003ff-Ge; Tue, 23 Nov 2010 19:32:31 +0100 Mail-Followup-To: Ted Zlatanov , ding@gnus.org, emacs-devel@gnu.org In-Reply-To: <87eiac9fsz.fsf@lifelogs.com> (Ted Zlatanov's message of "Tue, 23 Nov 2010 10:15:56 -0600") User-Agent: Gnus/5.110011 (No Gnus v0.11) Emacs/24.0.50 (gnu/linux) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:133070 gmane.emacs.gnus.general:74268 Archived-At: On Tue, Nov 23 2010, Ted Zlatanov wrote: > On Tue, 23 Nov 2010 16:54:34 +0100 Julien Danjou wro= te:=20 > > JD> On Tue, Nov 23 2010, Ted Zlatanov wrote: >>> I would recommend to let users customize a color vision profile as part >>> of color-lab (see my original long explanation of my work with colors in >>> GUI design). Maybe just a list of colors and their contrasting pairs >>> (with a reasonable set of defaults for each of the various kinds of >>> colorblindness), from which we can approximate what will look good >>> anywhere in the colorspace, will be sufficient. The algorithms are nice >>> to have but not essential to the original requirement. > > JD> That sounds like an option indeed. I'll probably use that if I can't = do > JD> something better. > > JD> Now, what I have in mind=E2=80=A6 > > JD> I think the only colour blindness types we should consider are all fo= rms > JD> of dichromacy. In that case, since we use RGB (hehe), dropping one of > JD> the 3 components (depending of the dichromacy type) and using the same > JD> computing could work. > > JD> If I simulate protanopia with the following code and then correct it, > JD> this is what I got: > JD> (let* ((fg "#ffaabb") > JD> (bg "#aaffbb") > JD> (fg-cb (mapcar (lambda (x) (/ x 256)) (x-color-values fg))) > JD> (bg-cb (mapcar (lambda (x) (/ x 256)) (x-color-values bg)))) > JD> (shr-color-check > JD> ;; No red color blindness > JD> (apply 'format "#00%02X%02X" (cdr fg-cb)) > JD> (apply 'format "#00%02X%02X" (cdr bg-cb)))) > > JD> =3D=3D> ("#3effce" "#0096a6") > > JD> I simulate it by setting red to 0, and let the code correct the color. > JD> It generates 2 new colors: #3effce #0096a6, which are 2 different blu= es. > JD> Even #3effce without the red component (#00ffce) seems visible. > > JD> If I use 2 different reds like #ff0000 and #bb0000 it generates black > JD> and grey: #000000 and #5e5e5e. The grey is probably viewed as #005e5e > JD> which is some green-blue, and should be visible. > > JD> This is probably not perfect, but is this good enough? Any color blind > JD> people in there? :) > > You can test at http://colorschemedesigner.com/ > > The colors you mentioned looked OK to me and yes, killing the red is > probably a good way to fix it for most people (maybe it's as simple as a > custom set of RGB adjustment constants for general use?). You may want > to take the discussion to emacs-devel to find both more opinions and > more testers. There may be someone that knows about existing similar > work for Emacs Lisp; I already searched but didn't find any. Good idea. I'm following up to emacs-devel as well, so maybe there some people willing to help. Having at least a function to simulate blindness like on http://colorschemedesigner.com/ would be helpful to enhance shr-color-check. --=20 Julien Danjou // =E1=90=B0 http://julien.danjou.info