Split rgb_to_xyz() into two parts.