Add a check to setPartitionColor

This sets colorsUsed if a partition is colored with a color
greater than colorsUsed.