diff --git a/packages/wyatt_ui_components/lib/src/core/utils/multi_color.dart b/packages/wyatt_ui_components/lib/src/core/utils/multi_color.dart index 8f36e970..aa37be5b 100644 --- a/packages/wyatt_ui_components/lib/src/core/utils/multi_color.dart +++ b/packages/wyatt_ui_components/lib/src/core/utils/multi_color.dart @@ -23,24 +23,20 @@ class MultiColor { final List? _colors; final Color? _color; - Color get color { - if (_color != null) { - return _color!; - } - if (_colors?.isNotEmpty ?? false) { - return _colors!.first; - } - throw IndexError.withLength( - 0, - _colors?.length ?? 0, - message: '_color is not defined or _colors is empty.', - ); - } + Color get color => _color != null + ? _color! + : _colors?.isNotEmpty ?? false + ? _colors!.first + : throw IndexError.withLength( + 0, + _colors?.length ?? 0, + message: '_color is not defined or _colors is empty.', + ); List get colors => _colors ?? []; - bool get isGradient => - (_colors?.isNotEmpty ?? false) && (_colors?.length ?? 0) > 1; + bool get isGradient => (_colors?.length ?? 0) > 1; + bool get isColor => _color != null || isGradient; static MultiColor? lerp(MultiColor? a, MultiColor? b, double t) { if (a == null && b == null) {