* Colour blindness correction (was: Colour manipulation)
[not found] ` <87eiac9fsz.fsf@lifelogs.com>
@ 2010-11-23 18:32 ` Julien Danjou
0 siblings, 0 replies; only message in thread
From: Julien Danjou @ 2010-11-23 18:32 UTC (permalink / raw
To: Ted Zlatanov; +Cc: ding, emacs-devel
On Tue, Nov 23 2010, Ted Zlatanov wrote:
> On Tue, 23 Nov 2010 16:54:34 +0100 Julien Danjou <julien@danjou.info> wrote:
>
> 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…
>
> JD> I think the only colour blindness types we should consider are all forms
> 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> ==> ("#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 blues.
> 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.
--
Julien Danjou
// ᐰ <julien@danjou.info> http://julien.danjou.info
^ permalink raw reply [flat|nested] only message in thread