Please note that this is a general Unity scripting question, while this forum deals with questions specific to Spine and the spine-unity runtime. You should be able to find a lot of discussion on the Unity forums or on stackoverflow in regards to interpolating two values or colors over a given time.
To lerp two colors see https://docs.unity3d.com/ScriptReference/Color.Lerp.html. Then you just need to forward the respective t
value to the lerp function like float t = elapsedTime / lerpDuration;
and increase elapsedTime
accordingly each frame (and also limit it).
We recommend using MaterialPropertyBlock
for setting the color properties at materials, you can check out the example scene Spine Examples/Other Examples/Per Instance Material Properties
. There you can find the script MaterialPropertyBlockExample
attached to e.g. the second Spineboy GameObject.