Gnus development mailing list
 help / color / mirror / Atom feed
From: Julien Danjou <julien@danjou.info>
To: Ted Zlatanov <tzz@lifelogs.com>
Cc: ding@gnus.org
Subject: Re: Colour manipulation
Date: Tue, 23 Nov 2010 16:54:34 +0100	[thread overview]
Message-ID: <sa3aal0dohx.fsf@cigue.easter-eggs.fr> (raw)
In-Reply-To: <87pqtw9jon.fsf@lifelogs.com> (Ted Zlatanov's message of "Tue, 23 Nov 2010 08:52:08 -0600")

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 too)
>
> 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…

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))))

==> ("#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? :)

-- 
Julien Danjou
// ᐰ <julien@danjou.info>   http://julien.danjou.info



  reply	other threads:[~2010-11-23 15:54 UTC|newest]

Thread overview: 67+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <E1PArgx-0006dS-00@quimby.gnus.org>
2010-10-26 23:58 ` [gnus git] branch master updated: =1= shr.el (shr-tag-div): Added Lars Magne Ingebrigtsen
2010-10-27  0:15   ` Katsumi Yamaoka
2010-10-27  0:22     ` Katsumi Yamaoka
2010-10-27  0:28     ` Lars Magne Ingebrigtsen
2010-10-27  0:43       ` Katsumi Yamaoka
2010-10-27 18:06   ` Ted Zlatanov
2010-10-29 23:18     ` Lars Magne Ingebrigtsen
2010-11-09 22:25       ` Ted Zlatanov
2010-11-09 22:47         ` Lars Magne Ingebrigtsen
2010-11-09 23:02           ` Steinar Bang
2010-11-10  9:54           ` Julien Danjou
2010-11-10 17:49             ` Colourspace (was: [gnus git] branch master updated: =1= shr.el (shr-tag-div): Added.) Lars Magne Ingebrigtsen
2010-11-10 19:09               ` Colourspace Julien Danjou
2010-11-10 19:44                 ` Colourspace Ted Zlatanov
2010-11-10 19:56                   ` Colourspace Julien Danjou
2010-11-10 20:22                     ` ELPA and Gnus (was: Colourspace) Ted Zlatanov
2010-11-10 20:48                       ` ELPA and Gnus Lars Magne Ingebrigtsen
2010-11-10 21:23                         ` Ted Zlatanov
2010-11-10 21:32                           ` Lars Magne Ingebrigtsen
2010-11-11 13:19                             ` Ted Zlatanov
2010-11-14 16:07                               ` Lars Magne Ingebrigtsen
2010-11-15 15:43                               ` Julien Danjou
2010-11-11  9:06                         ` Julien Danjou
2010-11-14 16:07                           ` Lars Magne Ingebrigtsen
2010-11-10 20:48                 ` Colourspace Lars Magne Ingebrigtsen
2010-11-10 20:55                   ` Colourspace Lars Magne Ingebrigtsen
2010-11-11  8:59                     ` Colourspace Julien Danjou
2010-11-18 18:49               ` Colourspace Ted Zlatanov
2010-11-10 13:14           ` [gnus git] branch master updated: =1= shr.el (shr-tag-div): Added Ted Zlatanov
2010-11-19 16:13           ` Julien Danjou
2010-11-21  4:40             ` Lars Magne Ingebrigtsen
2010-11-21 13:55               ` Julien Danjou
2010-11-21 18:38                 ` Colour manipulation (was: [gnus git] branch master updated: =1= shr.el (shr-tag-div): Added.) Lars Magne Ingebrigtsen
2010-11-21 18:55                   ` Colour manipulation Julien Danjou
2010-11-21 19:02                     ` Lars Magne Ingebrigtsen
2010-11-21 19:26                       ` Julien Danjou
2010-11-21 19:42                         ` Lars Magne Ingebrigtsen
2010-11-22 14:49                         ` Julien Danjou
2010-11-24  2:27                           ` Katsumi Yamaoka
2010-11-24  5:45                             ` Katsumi Yamaoka
2010-11-24  6:39                               ` Lars Magne Ingebrigtsen
2010-11-24  8:43                                 ` Julien Danjou
2010-11-24 20:37                                   ` Lars Magne Ingebrigtsen
2010-11-24 20:48                                     ` Lars Magne Ingebrigtsen
2010-11-24 21:18                                     ` Julien Danjou
2010-11-24 21:27                                       ` Lars Magne Ingebrigtsen
2010-11-24  8:52                               ` Julien Danjou
2010-11-24  6:39                             ` Lars Magne Ingebrigtsen
2010-11-24  8:37                             ` Julien Danjou
2010-11-22 15:37                         ` Julien Danjou
2010-11-22 15:59                           ` Lars Magne Ingebrigtsen
2010-11-23  1:38                             ` Lars Magne Ingebrigtsen
2010-11-23  9:15                               ` Julien Danjou
2010-11-23 23:50                                 ` Lars Magne Ingebrigtsen
2010-11-23  9:48                               ` Julien Danjou
2010-11-23 23:52                                 ` Lars Magne Ingebrigtsen
2010-11-21 19:57                     ` Frank Schmitt
2010-11-22 19:47                     ` Ted Zlatanov
2010-11-23  9:10                       ` Julien Danjou
2010-11-23 14:52                         ` Ted Zlatanov
2010-11-23 15:54                           ` Julien Danjou [this message]
2010-11-23 16:15                             ` Ted Zlatanov
2010-11-23 18:32                               ` Colour blindness correction (was: Colour manipulation) Julien Danjou
2010-11-23 23:50                             ` Colour manipulation Lars Magne Ingebrigtsen
2010-11-24  8:32                               ` Julien Danjou
2010-11-26 20:17                             ` Adam Sjøgren
2010-11-24  1:09                         ` Greg Troxel

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=sa3aal0dohx.fsf@cigue.easter-eggs.fr \
    --to=julien@danjou.info \
    --cc=ding@gnus.org \
    --cc=tzz@lifelogs.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).