I'm working on a pixel game that has a limited palette, but lighting and translucency can cause colors to go out of the palette. To make the overall picture uniform, I need a color approximation algorithm with low time complexity.
I've searched about how to find the differences between colors, and find that the distance between colors is not consistent with the distance of their color space coordinates. So I may need a way to optimize the distance finding algorithm for non-uniform spaces, but I'm completely confused about it.
This project is an Webapp game which run on browser, but at this stage it is only planned to be compatible with electron.