How to read the colors in a ColorSequence?

So if I make a new ColorSequence in this manner

sequence = ColorSequence.new(Color3.new(math.random(),math.random(),math.random()),Color3.new(math.random(),math.random(),math.random()))

How would I read the colors in the sequence? Or set a variable to one of the colors in the sequence?

I tried using
sequenceColor1 = sequence[1].Value

But that returned the error
'1' is not a member of ColorSequence

So I’m unsure of how the table is set up. Anyone know how to do this?

If you want a table of the color values with ColorSequence.new()
You need to do sequence.Keypoints

Keypoints will create a table containing all of your properties in ColorSequence.new()

I printed mine into the output to see the values:

sequence = ColorSequence.new(Color3.new(math.random(),math.random(),math.random()),Color3.new(math.random(),math.random(),math.random()))

print("First Color:")
print(sequence.Keypoints[1]) --This would be your first color

print("Second Color:")
print(sequence.Keypoints[2]) --This would be your second color

Output:
examplecolor

I’m not sure if this is what you’re trying to get exactly or if you want the individual RGB values. Just let me know.

1 Like

Nope, that’s it! Thank you! Wasn’t aware of .Keypoints

1 Like