mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-28 02:11:43 +00:00
[wpimath] Refactor MathUtil.interpolate() and MathUtil.inverseInterpolate() to handle extrapolation (#8232)
This commit is contained in:
@@ -328,9 +328,9 @@ public class Color {
|
||||
*/
|
||||
public static int lerpRGB(int r1, int g1, int b1, int r2, int g2, int b2, double t) {
|
||||
return packRGB(
|
||||
(int) MathUtil.interpolate(r1, r2, t),
|
||||
(int) MathUtil.interpolate(g1, g2, t),
|
||||
(int) MathUtil.interpolate(b1, b2, t));
|
||||
(int) MathUtil.lerp(r1, r2, t),
|
||||
(int) MathUtil.lerp(g1, g2, t),
|
||||
(int) MathUtil.lerp(b1, b2, t));
|
||||
}
|
||||
|
||||
/*
|
||||
|
||||
Reference in New Issue
Block a user