Simplify coloring logic (thanks ericmj)