Add contrast function.