phaserjs / phaser-ce

Phaser CE is a fun, free and fast 2D game framework for making HTML5 games for desktop and mobile web browsers, supporting Canvas and WebGL rendering.
http://phaser.io
MIT License
1.34k stars 491 forks source link

Adaptability enhancement: daltonization filter for people with colorblindness #689

Open jgordon510 opened 3 years ago

jgordon510 commented 3 years ago

I work for a puzzle company which uses Phaser CE in our games. We wanted a way to implement daltonization, which is an algorithm to compensate for the three major types of colorblindness.

You can read more about it here: http://www.daltonize.org/2010/05/lms-daltonization-algorithm.html

I created a phaser filter class and adapted the algorithm to work with a shader. I have a running example here with code: https://replit.com/@jgordon510/daltonizer-prototype#script.js

I'd be happy to do a pull request if you're interested in implementing some version of it into the codebase. I know these things are usually done as plugins, but since it's an accessibility enhancement, I thought you might be interested in incorporating it into the project itself.

samme commented 3 years ago

You're welcome to add it to filters.