2 min read

Source: Roblox Creator Hub · CC BY 4.0 · View source · Code samples: MIT Imported 2026-10-03. Formatting adapted for this site.

ColorSequenceKeypoint

The ColorSequenceKeypoint data type represents a single keypoint in a ColorSequence. Each keypoint has a time position between 0 and 1 and a Color3 value that defines the color at that point in the sequence. Properties that use a ColorSequence, such as ParticleEmitter.Color, Beam.Color, and Trail.Color, interpolate linearly between consecutive keypoints in RGB color space.

local keypoints = {
    ColorSequenceKeypoint.new(0, Color3.fromRGB(255, 0, 0)),
    ColorSequenceKeypoint.new(0.5, Color3.fromRGB(0, 255, 0)),
    ColorSequenceKeypoint.new(1, Color3.fromRGB(0, 0, 255)),
}
local colorSequence = ColorSequence.new(keypoints)

Constructors

NameType / ReturnsDescription
ColorSequenceKeypoint.newReturns a ColorSequenceKeypoint from the given time and color.

ColorSequenceKeypoint.new

Returns a ColorSequenceKeypoint with the given time and color. The time parameter should be a number between 0 and 1, where 0 represents the beginning of the sequence and 1 represents the end. The color parameter is a Color3 whose components must each be between 0 and 1.

Parameters

NameTypeDefaultDescription
timenumberThe position of the keypoint along the sequence, a number between 0 and 1.
colorColor3The color value at this keypoint.

Properties

NameType / ReturnsDescription
ColorSequenceKeypoint.TimenumberThe relative time at which the keypoint is located.
ColorSequenceKeypoint.ValueColor3The Color3 value of the keypoint.

ColorSequenceKeypoint.Time

The relative time at which this keypoint is positioned within the parent ColorSequence, expressed as a number from 0 to 1 where 0 is the beginning of the sequence and 1 is the end. Within a ColorSequence, the first keypoint must have a time of 0 and the last keypoint must have a time of 1; any intermediate keypoints must be in ascending time order. The engine linearly interpolates colors between consecutive keypoints in RGB color space based on their time positions. Defaults to 0.

FieldValue
typenumber

ColorSequenceKeypoint.Value

The Color3 color value at this keypoint's position in the sequence. When the engine evaluates a ColorSequence, it linearly interpolates between adjacent keypoints' color values in RGB color space based on time. Each component of the color (red, green, blue) must be between 0 and 1. Defaults to (0, 0, 0) (black).

FieldValue
typeColor3