color.rgb() - Pine Script Function
color.rgb()
Section titled “color.rgb()”Overview
Section titled “Overview”Creates a new color with transparency using the RGB color model.
Syntax
Section titled “Syntax”color.rgb(red, green, blue, transp) → const colorParameters
Section titled “Parameters”| Name | Type | Description |
|---|---|---|
| red | const int/float | Red color component. Possible values are from 0 to 255. |
Returns
Section titled “Returns”Color with specified transparency.
Remarks
Section titled “Remarks”- Using arguments that are not constants (e.g., ‘simple’, ‘input’ or ‘series’) will have an impact on the colors displayed in the script’s “Settings/Style” tab. See the User Manual for more information.
Examples
Section titled “Examples”Example 1
Section titled “Example 1”//@version=6indicator("color.rgb", overlay=true)plot(close, color=color.rgb(255, 0, 0, 50))