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