prevent color value overflowing