mirror of
https://github.com/flutter/flutter.git
synced 2026-02-20 02:29:02 +08:00
Fix the lerp the RIGHT way.
This commit is contained in:
parent
baaa892864
commit
96ac817ee0
@ -22,9 +22,9 @@ Color lerpColor(Color a, Color b, double t) {
|
||||
if (a == null && b == null)
|
||||
return null;
|
||||
if (a == null)
|
||||
return _scaleAlpha(a, t);
|
||||
return _scaleAlpha(b, t);
|
||||
if (b == null)
|
||||
return _scaleAlpha(b, 1.0 - t);
|
||||
return _scaleAlpha(a, 1.0 - t);
|
||||
return new Color.fromARGB(
|
||||
lerpNum(a.alpha, b.alpha, t).toInt(),
|
||||
lerpNum(a.red, b.red, t).toInt(),
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user