hex to color function and tests