Move color transformation to a helper class