rgba
Syntax Format
rgba(r, g, b, a)
Overview
The rgba
function provides the color customization to the indicator's plot. You can use this function to set specific colors in a script. You can also specify the color's opacity by using the a parameter.
Parameters
Parameter | Type | Purpose |
---|---|---|
r | integer | The red component of the color in the range of [0,255] |
g | integer | The green component of the color in the range of [0,255] |
b | integer | The blue component of the color in the range of [0,255] |
a | numeric | The alpha component of the color in the range of [0,1], representing the color opacity |
Returns: color
.
Example
plot_color = rgba(0, 255, 0, 0.3) -- green color with 0.3 opacity as a result