Colorblind simulation shader.
This is for Unity, but you'll be able to port it to other systems easily.
If you uncomment a define "USE_HCIRN" in Colorblind.shader,
You can use a method by Matthew Wickline and the Human-Computer Interaction Resource Network.
That method is more accurate, they say.
Note that their code is under a license as below,
The Color Blind Simulation function is
copyright (c) 2000-2001 by Matthew Wickline and the
Human-Computer Interaction Resource Network ( http://hcirn.com/ ).
It is used with the permission of Matthew Wickline and HCIRN,
and is freely available for non-commercial use. For commercial use, please
contact the Human-Computer Interaction Resource Network ( http://hcirn.com/ ).