Taken from: http://world.std.com/~wware/xyz2rgb.html