RGB, XYZ, and Lab conversions in Javascript