Factor out colorTest into a util and test it