lerp static method
Linearly interpolates between two WxLinearBorders.
If both a
and b
are null then null is returned. If a
is null
then we interpolate to b
varying size from 0.0 to b.size
. If b
is null then we interpolate from a
varying size from a.size
to zero.
Otherwise both values are interpolated.
Implementation
static WxLinearBorderSide? lerp(
WxLinearBorderSide? a,
WxLinearBorderSide? b,
double t,
) {
if (identical(a, b)) {
return a;
}
if (t == 0.0) {
return a;
}
if (t == 1.0) {
return b;
}
return WxLinearBorderSide(
color: Color.lerp(a?.color, b?.color, t),
gradient: Gradient.lerp(a?.gradient, b?.gradient, t),
width: lerpDouble(a?.width, b?.width, t),
offset: lerpDouble(a?.offset, b?.offset, t),
size: lerpDouble(a?.size, b?.size, t),
alignment: lerpDouble(a?.alignment, b?.alignment, t),
);
}