fix(ui_components): fix MultiColor lerp method
This commit is contained in:
parent
6537945946
commit
25224469b5
@ -64,12 +64,15 @@ class MultiColor {
|
||||
);
|
||||
} else if (a.isGradient && b.isGradient) {
|
||||
final colors = List<Color>.empty(growable: true);
|
||||
for (int i = 0; i < a.colors.length; i++) {
|
||||
final shortestList =
|
||||
(a.colors.length > b.colors.length) ? b.colors : a.colors;
|
||||
for (int i = 0; i < shortestList.length; i++) {
|
||||
final lerpColor = Color.lerp(a.colors[i], b.colors[i], t);
|
||||
if (lerpColor != null) {
|
||||
colors.add(lerpColor);
|
||||
}
|
||||
}
|
||||
return MultiColor(colors);
|
||||
}
|
||||
return b;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user