color.from_gradient
Color between bottom_color and top_color by where value sits between bottom_value and top_value. With color.theme colors the dark and light parts each get their own gradient.
color.from_gradient(value: int/float, bottom_value: int/float, top_value: int/float, bottom_color: color, top_color: color) -> color
Parameters
valueint/float: Where on the scale this bar is; na gives na.bottom_valueint/float: The value that gets bottom_color; below it the color stays bottom_color.top_valueint/float: The value that gets top_color; above it the color stays top_color. Equal to bottom_value gives bottom_color.bottom_colorcolor: The color at bottom_value.top_colorcolor: The color at top_value; red, green, blue and transparency are mixed in a straight line between the two.
Example
rsiColor = color.from_gradient(ta.rsi(close, 14), 30, 70, color.red, color.teal)