Use isinstance(color, int) to check for type.