Skip to content
This repository has been archived by the owner on Feb 9, 2024. It is now read-only.

Commit

Permalink
Add a few more gradients
Browse files Browse the repository at this point in the history
  • Loading branch information
rh-concordium committed Dec 20, 2023
1 parent ad81c63 commit c624e55
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 2 deletions.
13 changes: 11 additions & 2 deletions lib/design_system/foundation/colors/internal_gradient.dart
Original file line number Diff line number Diff line change
@@ -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)]);
}
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<Color> colors}) =>
LinearGradient(begin: Alignment.centerLeft, end: Alignment.centerRight, colors: [colors.first, colors.last]);
}
2 changes: 2 additions & 0 deletions lib/widgetbook/foundation/colors/view_gradients.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down

0 comments on commit c624e55

Please sign in to comment.