Functions
color.new()
Takes a colour and an opacity, and returns that colour at that opacity. Opacity runs from 0 to 1, where 1 is solid and 0 invisible. A value outside the range is clamped to it rather than rejected, so an out-of-range number neither fails the script nor warns you.
Syntax · 1 of 4
color.new(const color color, const float alpha) → const color
Arguments
color required const color The base color (e.g., color.red, #00ff7f, rgb(255, 0, 0)). alpha required const float Transparency level (0 to 100, where 1 is fully opaque and 0 is fully transparent). Return Type
const color Syntax · 2 of 4
color.new(input color color, input float alpha) → input color
Arguments
color required input color The base color (e.g., color.red, #00ff7f, rgb(255, 0, 0)). alpha required input float Transparency level (0 to 100, where 1 is fully opaque and 0 is fully transparent). Return Type
input color Syntax · 3 of 4
color.new(simple color color, simple float alpha) → simple color
Arguments
color required simple color The base color (e.g., color.red, #00ff7f, rgb(255, 0, 0)). alpha required simple float Transparency level (0 to 100, where 1 is fully opaque and 0 is fully transparent). Return Type
simple color Syntax · 4 of 4
color.new(series color color, series float alpha) → series color
Arguments
color required series color The base color (e.g., color.red, #00ff7f, rgb(255, 0, 0)). alpha required series float Transparency level (0 to 100, where 1 is fully opaque and 0 is fully transparent). Return Type
series color Example
//@lipi=2
indicator("color.new Example", overlay=true)
c = color.new(color.blue, 0.3)
bgcolor(c)