Skip to main content

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​

ParameterTypePurpose
rintegerThe red component of the color in the range of [0,255]
gintegerThe green component of the color in the range of [0,255]
bintegerThe blue component of the color in the range of [0,255]
anumeric 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