跳到主要内容

渐变停靠点(GradientStop)

渐变(Gradient) 中的颜色停靠点(color stop),由位置([0,1])和该位置颜色组成。

字段(Fields)

position

停靠点在渐变中的位置。0 为起点,1 为终点。

local g = Gradient.linear(Vector.xy(0, 0), Vector.xy(100, 0), {
{
position = 0,
color = Color.rgb(255, 0, 0)
},
{
position = 1,
color = Color.rgb(0, 0, 255)
},
})

color

该位置对应的 颜色(Color)

local g = Gradient.linear(Vector.xy(0, 0), Vector.xy(100, 0), {
{
position = 0,
color = Color.rgb(255, 0, 0)
},
{
position = 1,
color = Color.rgb(0, 0, 255)
},
})