The goal is just the color effect you want to achieve. It finds the shortest path to whichever color you want.
Using the smooth animation with moving objects by @pocolilman, I was able to change it so much that it can be used to make literally any generic animation smooth and cool.