master #81
@ -64,12 +64,15 @@ class MultiColor {
|
|||||||
);
|
);
|
||||||
} else if (a.isGradient && b.isGradient) {
|
} else if (a.isGradient && b.isGradient) {
|
||||||
final colors = List<Color>.empty(growable: true);
|
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);
|
final lerpColor = Color.lerp(a.colors[i], b.colors[i], t);
|
||||||
if (lerpColor != null) {
|
if (lerpColor != null) {
|
||||||
colors.add(lerpColor);
|
colors.add(lerpColor);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
return MultiColor(colors);
|
||||||
}
|
}
|
||||||
return b;
|
return b;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user