I know how to construct a color sequence with a script, but I would like to do it the other way around. It seems very tedious to make dozens of color sequences with scripts. Instead, I’d love to get the values in the table.
Hope you get what I mean.
(@Nappinz it seemed like you knew a lot about color sequences?)
All you really need to do to get the table that constructs the color sequence is “ColorSequence.Keypoints”. However when you print this value it will not show because Roblox has not made “ColorSequenceKeypoint” a printable object.
If you’re looking to print the table that constructs a color sequence you can convert the values the “ColorSequenceKeypoint” holds - something like this:
local function ColorSequenceToTable(colorSequence)
local t = {}
local keypoints = colorSequence.Keypoints
for i, keypoint in ipairs(keypoints) do
t[i] = {
Time = keypoint.Time;
Value = keypoint.Value;
}
end
return t
end
And if you want to convert the printable table back into a table that constructs a ColorSequence, you can do something like this:
local function TableToColorSequence(t)
local construct = {}
for i, info in ipairs(t) do
construct[i] = ColorSequenceKeypoint.new(info.Time, info.Value)
end
return ColorSequence.new(construct)
end
Hey, thanks for the answer! I tested it out, but it get some strange output, I get 1 time value and then 3 color values separated by commas. But the comma values don’t correspond with the RGB value set AT ALL.
The one color:
0.901961, 0.803922, 0.941176 is supposed to be: 255, 58, 78
But, the interesting part is:
White which is (255, 255, 255) is (from the table value) 1,1,1.
That had me thinking, Oh, it’s just divided by 255. But no. It was not.
Is there something I am not seeing here? Is it divided by something, or is it a different color scheme. (Like decimals, where 1 is a full value?)