Documented color difference formula
Correct palette index guesses when smaller palette is picked

Fixes #39.