Skip to content
AlertaChartAlertaScript / docs
AlertaScript / alerta.color.from_gradient
On this pageSignatureParametersReturnsExample

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 color

Parameters

NameTypeRequiredDefaultDescription
sourceseries floatYes—Source value.
minfloatYes—Minimum bound.
maxfloatYes—Maximum bound.
colorAcolorYes—Color at min.
colorBcolorYes—Color at max.

Returns

series color

Example

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.

AlertaScript

No results found.

Search by name, alias, or keyword.