color.a
Reads the opacity of a colour. Reading is asymmetric with writing: this one returns a fraction from 0 to 1, while the three component functions return whole numbers from 0 to 255.
color.a(const color color) → const floatcolor.a(input color color) → input floatcolor.a(series color color) → series floatcolor.a(simple color color) → simple float| Parameter | Type | Required | Description |
|---|---|---|---|
color | const color | yes | the colour to inspect |
Returns const float or input float or series float or simple float — A float from 0 to 1, or na where the colour is na.
indicator("Opacity of a colour")
plot(color.a(color.blue))See also colour · color.b · color.g · color.new
Part of the function index.
Ready to put this into practice?
Try GoCharting Premium
Unlock advanced orderflow, market profile, options desk, and real-time data — everything you just read about, live in your charts.