Calculating maximum base color after creating palette