gradient
Colour gradients (input.gradient, gradient.at).
#Functions
#gradient.atfunction
The colour of a gradient at value, lo..hi mapped onto it (outside: the end colours; na: na).
gradient.at(gradient: string, value: float, lo: float, hi: float): color| Parameter | Type | Description |
|---|---|---|
gradient | string | A gradient (gradient.new or input.gradient). |
value | float | The value. |
lo | float | The value at 0 %. |
hi | float | The value at 100 %. |
Returns color.
Example
const g = input.gradient(gradient.new(color.blue, color.red), "Heat")
const c = gradient.at(g, ta.rsi(close, 14), 30, 70)Since ChartScript 1
#gradient.newfunction
A colour gradient: 2 to 8 colours spread evenly from 0 to 100 %.
gradient.new(stops: const color, …): string| Parameter | Type | Description |
|---|---|---|
stops | const color | The colours, low to high. |
Returns string.
Example
const g = input.gradient(gradient.new(color.blue, color.yellow, color.red), "Heat")Since ChartScript 1