Skip to content

Data type

ColorSequenceKeypoint

Official docs ↗

A color and time value that represents a keypoint in a ColorSequence.

About 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 1

  • ColorSequenceKeypoint.new(time: number, color: Color3)Returns a ColorSequenceKeypoint from the given time and color.

Properties 2

  • Time: numberThe relative time at which the keypoint is located.

    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.

  • Value: Color3The Color3 value of the keypoint.

    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).

Reference text from the Roblox Creator Documentation, licensed CC BY 4.0, reorganized by rbxtoolshub.com · Studio 0.743.0.7431133.