CrabUI
Loading...
Searching...
No Matches
CrabUI.CUIInterpolate Class Reference

Class containing a few interpolate functions for CUIAnimation. More...

Static Public Member Functions

static object InterpolateColor (object start, object end, double lambda)
 
static object InterpolateVector2 (object start, object end, double lambda)
 
static object InterpolateFloat (object start, object end, double lambda)
 

Static Public Attributes

static Dictionary< Type, Func< object, object, double, object > > Interpolate = new()
 

Detailed Description

Class containing a few interpolate functions for CUIAnimation.

Definition at line 16 of file CUIInterpolate.cs.

Member Function Documentation

◆ InterpolateColor()

static object CrabUI.CUIInterpolate.InterpolateColor ( object start,
object end,
double lambda )
static

Definition at line 18 of file CUIInterpolate.cs.

19 {
20 return ((Color)start).To(((Color)end), (float)lambda);
21 }

◆ InterpolateFloat()

static object CrabUI.CUIInterpolate.InterpolateFloat ( object start,
object end,
double lambda )
static

Definition at line 30 of file CUIInterpolate.cs.

31 {
32 float a = (float)start;
33 float b = (float)end;
34 return a + (b - a) * (float)lambda;
35 }

◆ InterpolateVector2()

static object CrabUI.CUIInterpolate.InterpolateVector2 ( object start,
object end,
double lambda )
static

Definition at line 23 of file CUIInterpolate.cs.

24 {
25 Vector2 a = (Vector2)start;
26 Vector2 b = (Vector2)end;
27 return a + (b - a) * (float)lambda;
28 }

Member Data Documentation

◆ Interpolate

Dictionary<Type, Func<object, object, double, object> > CrabUI.CUIInterpolate.Interpolate = new()
static

Definition at line 37 of file CUIInterpolate.cs.


The documentation for this class was generated from the following file: