Better color space conversion

Fixes some serious rounding errors. Still, we should only care about color accuracy to 1/255.0 since it's the native minimum difference for pixel values on iPhones (for now, mwahaha).