Use contrast function for calculating text color in navbar