A function that defines a color gradient for bars.