Skip to content

ColorSequenceKeypoint ​

颜色序列关键帧是构成 ColorSequence 的基本单元,用时间位置与颜色值描述渐变中某一时刻的颜色状态;Time 与 Value 按当前公开契约可读写。

概览 ​

颜色序列关键帧是构成 ColorSequence 的基本单元,用时间位置与颜色值描述渐变中某一时刻的颜色状态;Time 与 Value 按当前公开契约可读写。

可通过 ColorSequenceKeypoint.New(time, color) 构造

代码示例 ​

构造颜色序列关键帧并读取时间与颜色

lua
-- @runtime client
local startKeypoint = ColorSequenceKeypoint.New(0, Color3.New(1, 0, 0))
local endKeypoint = ColorSequenceKeypoint.New(1, Color3.New(0, 0, 1))
print("起始时间=", startKeypoint.Time, ",结束时间=", endKeypoint.Time)
print("起始颜色=", startKeypoint.Value:ToHex(), ",结束颜色=", endKeypoint.Value:ToHex())

属性 ​

名称类型默认值说明
TimeFloat-关键帧所在的时间点,取值范围通常为 0 到 1,表示在颜色序列中的相对位置。
ValueColor3-关键帧的颜色值,类型为 Color3。