function lerpColor(t, from, to) local clampedT = math.clamp(t, 0, 1) local outColor = Color(0, 0, 0, 0) outColor.r = math.lerp(t, from.r, to.r) outColor.g = math.lerp(t, from.g, to.g) outColor.b = math.lerp(t, from.b, to.b) outColor.a = math.lerp(t, from.a, to.a) return outColor end