通过 t 在颜色 a 和 b 之间进行线性插值。
t 被限制在 0 到 1 之间。当 t 为 0 时,返回 a。当 t 为 1 时,返回 b。
using UnityEngine;
public class Example : MonoBehaviour { Color32 lerpedColor = Color.white; Color32 white32 = Color.white; Color32 black32 = Color.black;
void Update() { lerpedColor = Color32.Lerp(white32, black32, Time.time); } }
其他资源:LerpUnclamped。