make sure color is not overflow