Lipi Reference
Lipi

Functions

color.r()

Reads the red component back out of a colour. The figure comes back on the scale it went in on, 0 to 255.

Syntax · 1 of 4

                color.r(const color color) → const int
              

Arguments

color required const color Color.

Return Type

const int

Syntax · 2 of 4

                color.r(input color color) → input int
              

Arguments

color required input color Color.

Return Type

input int

Syntax · 3 of 4

                color.r(simple color color) → simple int
              

Arguments

color required simple color Color.

Return Type

simple int

Syntax · 4 of 4

                color.r(series color color) → series int
              

Arguments

color required series color Color.

Return Type

series int

Example


          //@lipi=2
indicator("color.r Example", overlay=false)
c = close > open ? color.lime : color.red
plot(color.r(c), title="Red Component", color=color.red)