18 public static object InterpolateColor(
object start,
object end,
double lambda)
20 return ((Color)start).To(((Color)end), (
float)lambda);
23 public static object InterpolateVector2(
object start,
object end,
double lambda)
25 Vector2 a = (Vector2)start;
26 Vector2 b = (Vector2)end;
27 return a + (b - a) * (
float)lambda;
30 public static object InterpolateFloat(
object start,
object end,
double lambda)
32 float a = (float)start;
34 return a + (b - a) * (
float)lambda;
37 public static Dictionary<Type, Func<object, object, double, object>> Interpolate =
new();
39 internal static void InitStatic()
43 Interpolate[typeof(Color)] = InterpolateColor;
44 Interpolate[typeof(Vector2)] = InterpolateVector2;
45 Interpolate[typeof(
float)] = InterpolateFloat;
48 CUI.OnDispose += () =>