move color space conversion to its own class