input.color() - Pine Script Function
input.color()
Section titled “input.color()”Overview
Section titled “Overview”Adds an input to the Inputs tab of your script’s Settings, which allows you to provide configuration options to script users. This function adds a color picker that allows the user to select a color and transparency, either from a palette or a hex value.
Syntax
Section titled “Syntax”input.color(defval, title, tooltip, inline, group, confirm, display, active) → input colorParameters
Section titled “Parameters”| Name | Type | Description |
|---|---|---|
| defval | const color | Determines the default value of the input variable proposed in the script’s “Settings/Inputs” tab |
| from | — | where the user can change it. |
Returns
Section titled “Returns”Value of input variable.
Remarks
Section titled “Remarks”- Result of input.color function always should be assigned to a variable, see examples above.
Examples
Section titled “Examples”Example 1
Section titled “Example 1”//@version=6indicator("input.color", overlay=true)i_col = input.color(color.red, "Plot Color")plot(close, color=i_col)