lerp static method
Creates a lerped (linearly interpolated) border style between two existing styles.
a
: The firstWxBorderStyle
(can be null).b
: The secondWxBorderStyle
(can be null).t
: The interpolation factor (0.0 fora
, 1.0 forb
).
Implementation
static WxBorderStyle? lerp(
WxBorderStyle? a,
WxBorderStyle? b,
double t,
) {
if (a == null) return b;
if (b == null) return a;
final lowestMultiple = a.pattern.length * b.pattern.length;
return WxBorderStyle(
[
for (int i = 0; i < lowestMultiple; i++)
lerpDouble(
a.pattern[i % a.pattern.length],
b.pattern[i % b.pattern.length],
t,
) ??
0,
],
absolute: t < 0.5 ? a.absolute : b.absolute,
);
}