From c624e558a0b2e8d8a57db93c2bb62019fe41c4e9 Mon Sep 17 00:00:00 2001 From: Rene Hansen Date: Wed, 20 Dec 2023 14:47:25 +0100 Subject: [PATCH] Add a few more gradients --- .../foundation/colors/internal_gradient.dart | 13 +++++++++++-- .../foundation/colors/view_gradients.dart | 2 ++ 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/lib/design_system/foundation/colors/internal_gradient.dart b/lib/design_system/foundation/colors/internal_gradient.dart index e0b98d2..d23ae03 100644 --- a/lib/design_system/foundation/colors/internal_gradient.dart +++ b/lib/design_system/foundation/colors/internal_gradient.dart @@ -1,7 +1,16 @@ +import 'package:concordium_wallet/design_system/foundation/colors/internal_color.dart'; import 'package:flutter/material.dart'; /// These are 'primitive' gradients that should never be referenced directly from code. /// They are only meant to be used internally by the semantic gradient tokens class InternalGradient { - static const disable = LinearGradient(begin: Alignment.centerLeft, end: Alignment.centerRight, colors: [Color(0xFFCCCCCC), Color(0xFFE5E5E5)]); -} \ No newline at end of file + static Gradient disable = _buildGradient(colors: const [InternalColor.black20, InternalColor.black10]); + + // TODO(RHA): Is it intentional that the end color is missing? + static Gradient darkMineral = _buildGradient(colors: const [InternalColor.oceanBlue, Color(0xFF2E8894)]); + static Gradient lightMode = _buildGradient(colors: const [InternalColor.black05, InternalColor.white]); + static Gradient lightBlue = _buildGradient(colors: const []); + + static Gradient _buildGradient({required List colors}) => + LinearGradient(begin: Alignment.centerLeft, end: Alignment.centerRight, colors: [colors.first, colors.last]); +} diff --git a/lib/widgetbook/foundation/colors/view_gradients.dart b/lib/widgetbook/foundation/colors/view_gradients.dart index daec0c9..63ea622 100644 --- a/lib/widgetbook/foundation/colors/view_gradients.dart +++ b/lib/widgetbook/foundation/colors/view_gradients.dart @@ -5,6 +5,8 @@ import 'package:widgetbook/widgetbook.dart'; class ViewGradients { WidgetbookComponent get component => WidgetbookComponent(name: 'Gradients', useCases: [ useCase('Disable', InternalGradient.disable), + useCase('Dark Mineral', InternalGradient.darkMineral), + useCase('Light Mode', InternalGradient.lightMode), ]); WidgetbookUseCase useCase(String name, Gradient gradient) => WidgetbookUseCase(