ColorSequence

Overview

Description

The ColorSequence class represents a series of colors that can be used for creating gradients or transitions between colors in an array. It offers multiple constructor options to customize the initialization of the color sequence.

Properties

KeyPoints

array: Defines the key color points in the sequence to transition smoothly between colors.

Code Samples

local Time1 = 0
local Time2 = 1

local ColorKeyPoints = 
{ 
    ColorSequenceKeypoint.new(Time1, Color3.fromRGB(255, 0, 0)), 
    ColorSequenceKeypoint.new(Time2, Color3.fromRGB(0, 255, 0))
}
local MyColorSequence = ColorSequence.new(ColorKeyPoints)

Constructors

new

Creates a ColorSequence using a single Color3 color.

Parameters

Color3 color

The single color for all points in the sequence.

Return

ColorSequence

A new `ColorSequence` initialized with the provided color.

Code Samples

local Color = Color3.fromRGB(255, 0, 0)
local MyColorSequence = ColorSequence.new(Color)

new

Creates a ColorSequence using an array of ColorSequenceKeyPoint.

Parameters

array colorSequenceKeyPoints

An array defining the colors and their sequence positions.

Return

ColorSequence

A new `ColorSequence` based on the provided key points.

Code Samples

local Time1 = 0
local Time2 = 1

local ColorKeyPoints = 
{ 
    ColorSequenceKeypoint.new(Time1, Color3.fromRGB(255, 0, 0)), 
    ColorSequenceKeypoint.new(Time2, Color3.fromRGB(0, 255, 0))
}
local MyColorSequence = ColorSequence.new(ColorKeyPoints)

new

Creates a ColorSequence with two Color3 values, representing the beginning and ending colors of the sequence.

Parameters

Color3 c0

The starting color of the sequence.

Color3 c1

The ending color of the sequence.

Return

ColorSequence

A `ColorSequence` gradient between the two provided colors.

Code Samples

local StartColor = Color3.fromRGB(255, 0, 0)
local EndColor = Color3.fromRGB(0, 0, 255)
local ColorSequence = ColorSequence.new(StartColor, EndColor)

Methods

Last updated