Fix color conversion code