color
Adds a color picker input to your indicator’s Inputs panel. Users can choose a base color (from predefined constants) or a custom RGBA color. Ideal for customizing the look of plots, bands, and overlays.
Syntax
input.color(title, value, id?, group?, tooltip?, inline?)
Parameters
title
string— Label shown in the Inputs panel.value
BaseColors | RGBAColor— Default color. Can be either:BaseColors (predefined named colors like
color.red,color.blue).RGBAColor object
{ r, g, b, a }(whereais transparency 0–1).
id
string(optional) — Unique key for referencing this input. If omitted, auto-generated fromtitle(lowercased, spaces removed).group
string(optional) — Groups this input under a collapsible section.tooltip
string(optional) — Small helper text shown on hover.inline
string(optional) — Aligns multiple inputs in the same row if they share the same key.
Return Value
{ id: string } — The assigned id, either provided or auto-generated.
Example
Result

Tips
Use
BaseColorswhen you want simple predefined colors; usergba()when you need transparency.Tooltips are especially useful here—help users understand what element they are coloring (line, background, band).
Warning
If using RGBAColor, ensure values are in valid ranges: r, g, b = 0–255, a = 0–1. Out-of-range values may cause errors or unexpected colors.
Last updated