|
@@ -306,16 +306,26 @@ namespace Godot
|
|
|
return res;
|
|
|
}
|
|
|
|
|
|
- public Color LinearInterpolate(Color c, float t)
|
|
|
- {
|
|
|
- var res = this;
|
|
|
-
|
|
|
- res.r += t * (c.r - r);
|
|
|
- res.g += t * (c.g - g);
|
|
|
- res.b += t * (c.b - b);
|
|
|
- res.a += t * (c.a - a);
|
|
|
+ public Color Lerp(Color to, float weight)
|
|
|
+ {
|
|
|
+ return new Color
|
|
|
+ (
|
|
|
+ Mathf.Lerp(r, to.r, weight),
|
|
|
+ Mathf.Lerp(g, to.g, weight),
|
|
|
+ Mathf.Lerp(b, to.b, weight),
|
|
|
+ Mathf.Lerp(a, to.a, weight)
|
|
|
+ );
|
|
|
+ }
|
|
|
|
|
|
- return res;
|
|
|
+ public Color Lerp(Color to, Color weight)
|
|
|
+ {
|
|
|
+ return new Color
|
|
|
+ (
|
|
|
+ Mathf.Lerp(r, to.r, weight.r),
|
|
|
+ Mathf.Lerp(g, to.g, weight.g),
|
|
|
+ Mathf.Lerp(b, to.b, weight.b),
|
|
|
+ Mathf.Lerp(a, to.a, weight.a)
|
|
|
+ );
|
|
|
}
|
|
|
|
|
|
public uint ToAbgr32()
|