Utilities / Reference
alerta.color.from_gradient
TradingView-compatible spelling: color.from_gradient, runs without warnings
Interpolates between two colors based on source value inside min/max range.
alerta.color.from_gradient(source, min, max, colorA, colorB) → series colorParameters
| Name | Type | Required | Default | Description |
|---|---|---|---|---|
source | series float | Yes | — | Source value. |
min | float | Yes | — | Minimum bound. |
max | float | Yes | — | Maximum bound. |
colorA | color | Yes | — | Color at min. |
colorB | color | Yes | — | Color at max. |
Returns
series colorExample
alerta.color.from_gradient
v = rsi(close, 14)grad = color.from_gradient(v, 0, 100, color.red, color.green)plot(v, { color: grad, pane: "oscillator" })Names and aliases
Guides and navigation are localized. Built-in reference descriptions and code examples are maintained in English.