Some bounds checking on the setColor function.