Contrast ratio or Contrast / Brightness differenceYou can choose between two algorithms to determine if the colors are good for accessibility.
Color deficiency simulationTo simulate the color deficiences, I just copied the source code of the gimp (an image manipulation program) module and ported it to javascript. The gimp version I used is 2.3 and the algorithm is based on an article by Hans Brettel, Francoise Vienot and John Mollon in the Journal of the Optical Society of America V14(10), pg 2647. (See http://vischeck.com/ for more info). The credits for this algorithm are at the end of the page. Javascript isn't the optimum for the number crunching the algorithm requires, so the results aren't identical to the ones in gimp. Anyway they're are not too bad and almost always they look very similar. After computing the new colors by this algorithm I calculate c and d for them. If all 4 values (normal,deuteranope,protanope and tritanope) are good, the script displays OK!. Keep in mind that tritanopia is very rare. That's all. If you have any proposal to improve the page, the javascript code , the layout or whatever, just mail me at gmazzocato@gmail.com. This is an open project and I would be glad to improve it! CreditsThe authors of the gimp module are:
Go to the accessibility color wheel |