ColorSequence
Overview
Defines a smooth color gradient by combining multiple color keypoints (ColorSequenceKeypoint).
Each keypoint specifies a color at a particular point in time, and these values are sequentially connected to create a smooth color transitions. This structure is commonly used in various elements that emphasize visual color changes, such as particle effects, trails, and beams.
Constructors
new
Creates a ColorSequence that applies the passed single color across the entire range. The result contains two ColorSequenceKeypoints with identical color values at the start and end positions, maintaining a constant color throughout without changes.
Parameters
Color3 color
The single color value to be applied across all points of the ColorSequence. This color remains constant from start to end.
Return
ColorSequence
A new ColorSequence with the passed color set.
Code Samples
local Color = Color3.fromRGB(255, 0, 0)
local MyColorSequence = ColorSequence.new(Color)new
Creates a ColorSequence with a passed array consisting of ColorSequenceKeypoint.
Each keypoint must be sorted by time value in ascending order without shuffling. At least two keypoints are required to form a sequence, and the starting keypoint must have a time value of 0 while the ending keypoint must have a time value of 1.
Parameters
array colorSequenceKeyPoints
An array consisting of ColorSequenceKeypoint. Each keypoint defines a position (time value) within the ColorSequence and the color at that point. Keypoints must be sorted by time value in ascending order, with at least two required. The first keypoint's time value must be 0, and the last keypoint's time value must be 1.
Return
ColorSequence
A new ColorSequence with the passed color set.
Code Samples
new
Creates a ColorSequence with color c0 at the starting point and color c1 at the ending point. Smooth interpolation is applied between the two colors, creating a smooth color transition from start to end.
Parameters
Color3 c0
The color to be applied to the starting point of the sequence, defining the color at time value 0.
Color3 c1
The color to be applied to the ending point of the sequence, defining the color at time value 1.
Return
ColorSequence
A new ColorSequence with the passed color set.
Code Samples
Properties
KeyPoints
array
Returns an array consisting of ColorSequenceKeypoint.
Code Samples
Methods
Last updated