Returns how transparent a color is, from 0 for solid to 100 for invisible.
color.t reads the transparency that color.new or color.rgb set. A color with no transparency set returns 0.
Use it to read a setting back, or to make a second color with the same see-through level.
Syntax
color.t(color: series color) -> series float
color.t(color: const color) -> const float
color.t(color: input color) -> input float
color.t(color: simple color) -> simple floatArguments
| Name | Type | Default | Description |
|---|---|---|---|
| color | const/ | required | The color to take the transparency from, 0 to 100. na gives na. |
Returns
const/input/simple/series float: the transparency from 0 to 100; na if the color is na.
Remarks
- The value is rounded to a whole number.
Example
//@version=6
indicator("Transparency")
c = color.new(color.blue, 70)
plot(color.t(c), "Blue at 70", color = color.blue, style = plot.style_stepline)
plot(color.t(color.red), "Red solid", color = color.red, style = plot.style_stepline)See also
Runs on Sidechair