From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.emacs.gnus.general/74263 Path: news.gmane.org!not-for-mail From: Julien Danjou Newsgroups: gmane.emacs.gnus.general Subject: Re: Colour manipulation Date: Tue, 23 Nov 2010 16:54:34 +0100 Message-ID: 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> 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 1290527727 1470 80.91.229.12 (23 Nov 2010 15:55:27 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Tue, 23 Nov 2010 15:55:27 +0000 (UTC) Cc: ding@gnus.org To: Ted Zlatanov Original-X-From: ding-owner+M22628@lists.math.uh.edu Tue Nov 23 16:55:23 2010 Return-path: Envelope-to: ding-account@gmane.org Original-Received: from util0.math.uh.edu ([129.7.128.18]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1PKvDF-00028f-An for ding-account@gmane.org; Tue, 23 Nov 2010 16:55:21 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.math.uh.edu) by util0.math.uh.edu with smtp (Exim 4.63) (envelope-from ) id 1PKvCd-0001OR-1l; Tue, 23 Nov 2010 09:54:43 -0600 Original-Received: from mx1.math.uh.edu ([129.7.128.32]) by util0.math.uh.edu with esmtps (TLSv1:AES256-SHA:256) (Exim 4.63) (envelope-from ) id 1PKvCa-0001OH-CA for ding@lists.math.uh.edu; Tue, 23 Nov 2010 09:54:40 -0600 Original-Received: from quimby.gnus.org ([80.91.231.51]) by mx1.math.uh.edu with esmtp (Exim 4.72) (envelope-from ) id 1PKvCX-0007i0-3u for ding@lists.math.uh.edu; Tue, 23 Nov 2010 09:54:39 -0600 Original-Received: from coquelicot-s.easter-eggs.com ([213.215.37.94]) by quimby.gnus.org with esmtp (Exim 3.36 #1 (Debian)) id 1PKvCU-0005yS-00 for ; Tue, 23 Nov 2010 16:54:34 +0100 Original-Received: from cigue.easter-eggs.fr (cigue.easter-eggs.fr [10.0.0.33]) by rose.easter-eggs.fr (Postfix) with ESMTPS id E7CEC140E7; Tue, 23 Nov 2010 16:54:30 +0100 (CET) Original-Received: from jdanjou by cigue.easter-eggs.fr with local (Exim 4.72) (envelope-from ) id 1PKvCU-0002kY-GG; Tue, 23 Nov 2010 16:54:34 +0100 Mail-Followup-To: Ted Zlatanov , ding@gnus.org In-Reply-To: <87pqtw9jon.fsf@lifelogs.com> (Ted Zlatanov's message of "Tue, 23 Nov 2010 08:52:08 -0600") User-Agent: Gnus/5.110011 (No Gnus v0.11) Emacs/24.0.50 (gnu/linux) X-Spam-Score: -1.9 (-) List-ID: Precedence: bulk Xref: news.gmane.org gmane.emacs.gnus.general:74263 Archived-At: On Tue, Nov 23 2010, Ted Zlatanov wrote: > BTW, the source code for color-lab.el is beautiful. I like to see > Unicode used properly like this, in code and identifiers. I am > surprised and glad that Emacs is happy with it all. It works perfectly, and I'm even happier than you can imagine, because using Unicode symbols is just easier when you re-read your work with some math paper on your side. Reading things like DeltaLPrime just makes things harder for your brain. :) > I'm not personally colorblind, just interested in helping people with > that disability. So I can't test things too much without a conversion > tool. Still, it seems that color-lab.el will quickly become the > standard place for color formulas in Emacs so I think we should > anticipate this common need instead of fixing it later. I agree. :) > I posted a link to the color designer page at > http://colorschemedesigner.com that lets you see any colors as a > colorblind person would. The source code is JavaScript and probably > easy to obtain. That kind of conversion tool is valuable. Here are > some more links: > > http://jfly.iam.u-tokyo.ac.jp/color/ > http://www.vischeck.com/info/ (LOTS of good links, check out Daltonize to= o) > > Vischeck came from open-source software and they may be willing to > license their algorithm to the FSF. That would be great. I don't think we even need the whole algorithm because they are using S-CIELAB on images, something we can't do (but we should to do better processing!). So even without the S-CIELAB part, but with some color substitution algorithm we could do some good job. > 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. That sounds like an option indeed. I'll probably use that if I can't do something better. Now, what I have in mind=E2=80=A6 I think the only colour blindness types we should consider are all forms of dichromacy. In that case, since we use RGB (hehe), dropping one of the 3 components (depending of the dichromacy type) and using the same computing could work. If I simulate protanopia with the following code and then correct it, this is what I got: --8<---------------cut here---------------start------------->8--- (let* ((fg "#ffaabb") (bg "#aaffbb") (fg-cb (mapcar (lambda (x) (/ x 256)) (x-color-values fg))) (bg-cb (mapcar (lambda (x) (/ x 256)) (x-color-values bg)))) (shr-color-check ;; No red color blindness (apply 'format "#00%02X%02X" (cdr fg-cb)) (apply 'format "#00%02X%02X" (cdr bg-cb)))) =3D=3D> ("#3effce" "#0096a6") --8<---------------cut here---------------end--------------->8--- I simulate it by setting red to 0, and let the code correct the color. It generates 2 new colors: #3effce #0096a6, which are 2 different blues. Even #3effce without the red component (#00ffce) seems visible. If I use 2 different reds like #ff0000 and #bb0000 it generates black and grey: #000000 and #5e5e5e. The grey is probably viewed as #005e5e which is some green-blue, and should be visible. This is probably not perfect, but is this good enough? Any color blind people in there? :) --=20 Julien Danjou // =E1=90=B0 http://julien.danjou.info