contrast number function