Linearly interpolates between two colors using the parameter t, where
t = 0 returns ‘from’ and t = 1 returns ‘to’.
Copy
Ask AI
local black = Color.rgb(0, 0, 0)local white = Color.rgb(255, 255, 255)local t = 0.5-- Linearly interpolate halfway between black and whitelocal gray = Color.lerp(black, white, t)print(gray)-- Returns a gray color between black and white
Returns the opacity of the color as a normalized value in the range
[0.0, 1.0], or returns a new color with its alpha set from the specified
opacity.
Copy
Ask AI
local myColor = Color.rgba(255, 0, 0, 128)-- Get the opacity of a colorlocal myOpacity = Color.opacity(myColor)print(myOpacity)-- 0.5-- Get a new color with the specified opacitylocal newColor = Color.opacity(myColor, 1.0)print(Color.opacity(newColor))-- 1.0