feat(ui_component): add lerp on multicolor

This commit is contained in:
Hugo Pointcheval 2023-02-15 15:55:27 +01:00
parent 5c34528b3d
commit 7880293723
Signed by: hugo
GPG Key ID: 3AAC487E131E00BC

View File

@ -42,4 +42,14 @@ class MultiColor {
bool get isGradient =>
(_colors?.isNotEmpty ?? false) && (_colors?.length ?? 0) > 1;
static MultiColor? lerp(MultiColor? a, MultiColor? b, double t) {
if (a == null && b == null) {
return null;
}
if (b == null) {
return a;
}
return b;
}
}