gather color conversion code and kick out unused code