How would I be able to lerp a ColorSequence?

Need to lerp ColorSequence for my custom tweening module, but roblox does not support it yet.

I was wondering how would I go about creating a function that returns a ColorSequence based on an Alpha and 2 ColorSequences

Any help is appreciated.

2 Likes

I’m not pretty good with ColorSequence, but I recently learned that you need to use Keypoints for that. There’s info about that in the official Creator Documentation.

1 Like

Roblox doesn’t support it yet because there are multiple ways it can be achieved. Each with their own pros and cons.

You have to lerp the amount of keypoints, the positions of those keypoints and the colours of those keypoints.

Here is an idea, but it might look weird for some combinations of ColorSequences

  1. Use the same amount of keypoints as whichever of the two sequences uses the most
  2. Place them at the positions of the keypoints of the source sequence (if needed multiple at the same point, or some of them inbetween 2 keypoints)
    • also do this for the destination sequence, so you know where to lerp them to
  3. Set their colours by getting the colour from the source sequence
  4. Lerp the positions and colours of the keypoints
2 Likes