From f56816d056d79776d499cd535debfa5abe7c0e38 Mon Sep 17 00:00:00 2001 From: Job Guldemeester Date: Fri, 31 Jan 2025 14:32:25 +0100 Subject: [PATCH 1/3] :lipstick: Aligned with Katja for the kleurplaat --- lib/common/extensions/text_theme.dart | 18 ++++ .../interface/color_group_interface.dart | 2 +- lib/style/interface/kleurplaat_interface.dart | 5 + .../interface/surface_group_interface.dart | 13 ++- lib/style/kleurplaat/color_group.dart | 6 +- lib/style/kleurplaat/katjas_kleurplaat.dart | 27 +++--- lib/style/kleurplaat/surface_group.dart | 36 ++++---- .../text_style/text_style_color_group.dart | 4 +- .../text_style/text_style_decorator.dart | 91 ++++++++++++++----- .../text_style/text_style_surface_group.dart | 19 ++-- 10 files changed, 150 insertions(+), 71 deletions(-) create mode 100644 lib/common/extensions/text_theme.dart diff --git a/lib/common/extensions/text_theme.dart b/lib/common/extensions/text_theme.dart new file mode 100644 index 0000000..f0e64a7 --- /dev/null +++ b/lib/common/extensions/text_theme.dart @@ -0,0 +1,18 @@ +import 'package:flutter/material.dart'; + +extension LinkStyle on TextTheme { + TextStyle get linkSmall => bodySmall!.copyWith( + fontWeight: FontWeight.bold, + decoration: TextDecoration.underline, + ); + + TextStyle get linkMedium => bodyMedium!.copyWith( + fontWeight: FontWeight.bold, + decoration: TextDecoration.underline, + ); + + TextStyle get linkLarge => bodyLarge!.copyWith( + fontWeight: FontWeight.bold, + decoration: TextDecoration.underline, + ); +} diff --git a/lib/style/interface/color_group_interface.dart b/lib/style/interface/color_group_interface.dart index 8658792..6dc45c4 100644 --- a/lib/style/interface/color_group_interface.dart +++ b/lib/style/interface/color_group_interface.dart @@ -12,7 +12,7 @@ abstract interface class ColorGroupInterface { /// {@template on_color} /// The color on the foreground. Usually on top of the [color]. /// {@endtemplate} - T get onColor; + T get onColorContrast; /// {@template on_color_subtle} /// The color on the foreground, but more subtle. Usually on top of the [color]. diff --git a/lib/style/interface/kleurplaat_interface.dart b/lib/style/interface/kleurplaat_interface.dart index 7a2900f..744f9ba 100644 --- a/lib/style/interface/kleurplaat_interface.dart +++ b/lib/style/interface/kleurplaat_interface.dart @@ -50,4 +50,9 @@ abstract interface class KleurplaatInterface { /// The surface group. /// {@endtemplate} SurfaceGroupInterface get surface; + + /// {@template surface} + /// The surface inverse group. + /// {@endtemplate} + SurfaceGroupInterface? get surfaceInverse; } diff --git a/lib/style/interface/surface_group_interface.dart b/lib/style/interface/surface_group_interface.dart index 7736a3d..c8864db 100644 --- a/lib/style/interface/surface_group_interface.dart +++ b/lib/style/interface/surface_group_interface.dart @@ -12,22 +12,22 @@ abstract interface class SurfaceGroupInterface { /// {@template onColorContrastPlus} /// The color on the surface with a higher contrast. /// {@endtemplate} - T get onColorContrastPlus; + T get onColorContrast; /// {@template onColorContrastMinus} /// The color on the surface with a lower contrast. /// {@endtemplate} - T get onColorContrastMinus; + T get onColorContrastDim; /// {@template onColorSubtlePlus} /// The color on the surface with a higher contrast, but more subtle. /// {@endtemplate} - T get onColorSubtlePlus; + T get onColorSubtle; /// {@template onColorSubtleMinus} /// The color on the surface with a lower contrast, but more subtle. /// {@endtemplate} - T get onColorSubtleMinus; + T get onColorSubtleDim; /// {@template containerLowest} /// The color of the lowest container. @@ -54,6 +54,11 @@ abstract interface class SurfaceGroupInterface { /// {@endtemplate} T get containerHighest; + /// {@template link} + /// The color of the link. + /// {@endtemplate} + T get link; + /// Linearly interpolate with another object. SurfaceGroupInterface lerp( covariant SurfaceGroupInterface? other, diff --git a/lib/style/kleurplaat/color_group.dart b/lib/style/kleurplaat/color_group.dart index de3e568..4c98bb4 100644 --- a/lib/style/kleurplaat/color_group.dart +++ b/lib/style/kleurplaat/color_group.dart @@ -7,7 +7,7 @@ class ColorGroup implements ColorGroupInterface { /// {@macro color_group} const ColorGroup({ required this.color, - required this.onColor, + required this.onColorContrast, this.onColorSubtle, }); @@ -15,7 +15,7 @@ class ColorGroup implements ColorGroupInterface { final Color color; @override - final Color onColor; + final Color onColorContrast; @override final Color? onColorSubtle; @@ -28,7 +28,7 @@ class ColorGroup implements ColorGroupInterface { return ColorGroup( color: Color.lerp(color, other.color, t) ?? color, - onColor: Color.lerp(onColor, other.onColor, t) ?? onColor, + onColorContrast: Color.lerp(onColorContrast, other.onColorContrast, t) ?? onColorContrast, onColorSubtle: onColorSubtle == null || other.onColorSubtle == null ? null : Color.lerp(onColorSubtle, other.onColorSubtle, t), diff --git a/lib/style/kleurplaat/katjas_kleurplaat.dart b/lib/style/kleurplaat/katjas_kleurplaat.dart index 3a410ba..5cd1bb5 100644 --- a/lib/style/kleurplaat/katjas_kleurplaat.dart +++ b/lib/style/kleurplaat/katjas_kleurplaat.dart @@ -4,8 +4,7 @@ import 'package:dcc_toolkit/style/kleurplaat/surface_group.dart'; import 'package:flutter/material.dart'; /// {@macro kleurplaat} -class KatjasKleurplaat extends ThemeExtension - implements KleurplaatInterface { +class KatjasKleurplaat extends ThemeExtension implements KleurplaatInterface { /// {@macro kleurplaat} const KatjasKleurplaat({ required this.primary, @@ -17,6 +16,7 @@ class KatjasKleurplaat extends ThemeExtension required this.success, required this.successFill, required this.surface, + required this.surfaceInverse, }); @override @@ -46,6 +46,9 @@ class KatjasKleurplaat extends ThemeExtension @override final SurfaceGroup surface; + @override + final SurfaceGroup? surfaceInverse; + @override ThemeExtension copyWith({ ColorGroup? primary, @@ -57,6 +60,7 @@ class KatjasKleurplaat extends ThemeExtension ColorGroup? success, ColorGroup? successFill, SurfaceGroup? surface, + SurfaceGroup? surfaceInverse, }) => KatjasKleurplaat( primary: primary ?? this.primary, @@ -68,6 +72,7 @@ class KatjasKleurplaat extends ThemeExtension success: success ?? this.success, successFill: successFill ?? this.successFill, surface: surface ?? this.surface, + surfaceInverse: surfaceInverse ?? this.surfaceInverse, ); @override @@ -84,26 +89,26 @@ class KatjasKleurplaat extends ThemeExtension success: success.lerp(other.success, t), successFill: successFill.lerp(other.successFill, t), surface: surface.lerp(other.surface, t), + surfaceInverse: surfaceInverse?.lerp(other.surfaceInverse, t), ); } /// Converts the [KatjasKleurplaat] to a [ColorScheme]. - ColorScheme toColorScheme({Brightness brightness = Brightness.light}) => - ColorScheme( + ColorScheme toColorScheme({Brightness brightness = Brightness.light}) => ColorScheme( brightness: brightness, primary: primary.color, primaryContainer: primary.color, - onPrimary: primary.onColor, - onPrimaryContainer: primary.onColor, + onPrimary: primary.onColorContrast, + onPrimaryContainer: primary.onColorContrast, secondary: content.color, secondaryContainer: content.color, - onSecondary: content.onColor, - onSecondaryContainer: content.onColor, + onSecondary: content.onColorContrast, + onSecondaryContainer: content.onColorContrast, tertiary: error.color, - onTertiary: error.onColor, + onTertiary: error.onColorContrast, error: error.color, - onError: error.onColor, + onError: error.onColorContrast, surface: surface.color, - onSurface: surface.onColorContrastPlus, + onSurface: surface.onColorContrast, ); } diff --git a/lib/style/kleurplaat/surface_group.dart b/lib/style/kleurplaat/surface_group.dart index eb53292..9249b5d 100644 --- a/lib/style/kleurplaat/surface_group.dart +++ b/lib/style/kleurplaat/surface_group.dart @@ -7,31 +7,32 @@ class SurfaceGroup implements SurfaceGroupInterface { /// {@macro surface_group} const SurfaceGroup({ required this.color, - required this.onColorContrastPlus, - required this.onColorContrastMinus, - required this.onColorSubtlePlus, - required this.onColorSubtleMinus, + required this.onColorContrast, + required this.onColorContrastDim, + required this.onColorSubtle, + required this.onColorSubtleDim, required this.containerLowest, required this.containerLow, required this.container, required this.containerHigh, required this.containerHighest, + required this.link, }); @override final Color color; @override - final Color onColorContrastPlus; + final Color onColorContrast; @override - final Color onColorContrastMinus; + final Color onColorContrastDim; @override - final Color onColorSubtlePlus; + final Color onColorSubtle; @override - final Color onColorSubtleMinus; + final Color onColorSubtleDim; @override final Color containerLowest; @@ -48,26 +49,25 @@ class SurfaceGroup implements SurfaceGroupInterface { @override final Color containerHighest; + @override + final Color link; + @override SurfaceGroup lerp(SurfaceGroup? other, double t) { if (other == null) return this; return SurfaceGroup( color: Color.lerp(color, other.color, t)!, - onColorContrastPlus: - Color.lerp(onColorContrastPlus, other.onColorContrastPlus, t)!, - onColorContrastMinus: - Color.lerp(onColorContrastMinus, other.onColorContrastMinus, t)!, - onColorSubtlePlus: - Color.lerp(onColorSubtlePlus, other.onColorSubtlePlus, t)!, - onColorSubtleMinus: - Color.lerp(onColorSubtleMinus, other.onColorSubtleMinus, t)!, + onColorContrast: Color.lerp(onColorContrast, other.onColorContrast, t)!, + onColorContrastDim: Color.lerp(onColorContrastDim, other.onColorContrastDim, t)!, + onColorSubtle: Color.lerp(onColorSubtle, other.onColorSubtle, t)!, + onColorSubtleDim: Color.lerp(onColorSubtleDim, other.onColorSubtleDim, t)!, containerLowest: Color.lerp(containerLowest, other.containerLowest, t)!, containerLow: Color.lerp(containerLow, other.containerLow, t)!, container: Color.lerp(container, other.container, t)!, containerHigh: Color.lerp(containerHigh, other.containerHigh, t)!, - containerHighest: - Color.lerp(containerHighest, other.containerHighest, t)!, + containerHighest: Color.lerp(containerHighest, other.containerHighest, t)!, + link: Color.lerp(link, other.link, t)!, ); } } diff --git a/lib/style/text_style/text_style_color_group.dart b/lib/style/text_style/text_style_color_group.dart index 0a1e3e7..4079ccb 100644 --- a/lib/style/text_style/text_style_color_group.dart +++ b/lib/style/text_style/text_style_color_group.dart @@ -6,7 +6,7 @@ class TextStyleColorGroup implements ColorGroupInterface { /// {@macro color_group} const TextStyleColorGroup({ required this.color, - required this.onColor, + required this.onColorContrast, this.onColorSubtle, }); @@ -14,7 +14,7 @@ class TextStyleColorGroup implements ColorGroupInterface { final TextStyle color; @override - final TextStyle onColor; + final TextStyle onColorContrast; @override final TextStyle? onColorSubtle; diff --git a/lib/style/text_style/text_style_decorator.dart b/lib/style/text_style/text_style_decorator.dart index 3657a55..3159827 100644 --- a/lib/style/text_style/text_style_decorator.dart +++ b/lib/style/text_style/text_style_decorator.dart @@ -24,8 +24,8 @@ class TextStyleDecorator implements KleurplaatInterface { color: _textStyle.copyWith( color: _kleurplaat.content.color, ), - onColor: _textStyle.copyWith( - color: _kleurplaat.content.onColor, + onColorContrast: _textStyle.copyWith( + color: _kleurplaat.content.onColorContrast, ), onColorSubtle: _textStyle.copyWith( color: _kleurplaat.content.onColorSubtle, @@ -37,8 +37,8 @@ class TextStyleDecorator implements KleurplaatInterface { color: _textStyle.copyWith( color: _kleurplaat.contentFill.color, ), - onColor: _textStyle.copyWith( - color: _kleurplaat.contentFill.onColor, + onColorContrast: _textStyle.copyWith( + color: _kleurplaat.contentFill.onColorContrast, ), onColorSubtle: _textStyle.copyWith( color: _kleurplaat.contentFill.onColorSubtle, @@ -50,8 +50,8 @@ class TextStyleDecorator implements KleurplaatInterface { color: _textStyle.copyWith( color: _kleurplaat.error.color, ), - onColor: _textStyle.copyWith( - color: _kleurplaat.error.onColor, + onColorContrast: _textStyle.copyWith( + color: _kleurplaat.error.onColorContrast, ), onColorSubtle: _textStyle.copyWith( color: _kleurplaat.error.onColorSubtle, @@ -63,8 +63,8 @@ class TextStyleDecorator implements KleurplaatInterface { color: _textStyle.copyWith( color: _kleurplaat.errorFill.color, ), - onColor: _textStyle.copyWith( - color: _kleurplaat.errorFill.onColor, + onColorContrast: _textStyle.copyWith( + color: _kleurplaat.errorFill.onColorContrast, ), onColorSubtle: _textStyle.copyWith( color: _kleurplaat.errorFill.onColorSubtle, @@ -76,8 +76,8 @@ class TextStyleDecorator implements KleurplaatInterface { color: _textStyle.copyWith( color: _kleurplaat.primary.color, ), - onColor: _textStyle.copyWith( - color: _kleurplaat.primary.onColor, + onColorContrast: _textStyle.copyWith( + color: _kleurplaat.primary.onColorContrast, ), onColorSubtle: _textStyle.copyWith( color: _kleurplaat.primary.onColorSubtle, @@ -89,8 +89,8 @@ class TextStyleDecorator implements KleurplaatInterface { color: _textStyle.copyWith( color: _kleurplaat.primaryFill.color, ), - onColor: _textStyle.copyWith( - color: _kleurplaat.primaryFill.onColor, + onColorContrast: _textStyle.copyWith( + color: _kleurplaat.primaryFill.onColorContrast, ), onColorSubtle: _textStyle.copyWith( color: _kleurplaat.primaryFill.onColorSubtle, @@ -102,8 +102,8 @@ class TextStyleDecorator implements KleurplaatInterface { color: _textStyle.copyWith( color: _kleurplaat.success.color, ), - onColor: _textStyle.copyWith( - color: _kleurplaat.success.onColor, + onColorContrast: _textStyle.copyWith( + color: _kleurplaat.success.onColorContrast, ), onColorSubtle: _textStyle.copyWith( color: _kleurplaat.success.onColorSubtle, @@ -115,8 +115,8 @@ class TextStyleDecorator implements KleurplaatInterface { color: _textStyle.copyWith( color: _kleurplaat.successFill.color, ), - onColor: _textStyle.copyWith( - color: _kleurplaat.successFill.onColor, + onColorContrast: _textStyle.copyWith( + color: _kleurplaat.successFill.onColorContrast, ), onColorSubtle: _textStyle.copyWith( color: _kleurplaat.successFill.onColorSubtle, @@ -128,17 +128,17 @@ class TextStyleDecorator implements KleurplaatInterface { color: _textStyle.copyWith( color: _kleurplaat.surface.color, ), - onColorContrastPlus: _textStyle.copyWith( - color: _kleurplaat.surface.onColorContrastPlus, + onColorContrast: _textStyle.copyWith( + color: _kleurplaat.surface.onColorContrast, ), - onColorContrastMinus: _textStyle.copyWith( - color: _kleurplaat.surface.onColorContrastMinus, + onColorContrastDim: _textStyle.copyWith( + color: _kleurplaat.surface.onColorContrastDim, ), - onColorSubtlePlus: _textStyle.copyWith( - color: _kleurplaat.surface.onColorSubtlePlus, + onColorSubtle: _textStyle.copyWith( + color: _kleurplaat.surface.onColorSubtle, ), - onColorSubtleMinus: _textStyle.copyWith( - color: _kleurplaat.surface.onColorSubtleMinus, + onColorSubtleDim: _textStyle.copyWith( + color: _kleurplaat.surface.onColorSubtleDim, ), containerLowest: _textStyle.copyWith( color: _kleurplaat.surface.containerLowest, @@ -155,5 +155,48 @@ class TextStyleDecorator implements KleurplaatInterface { containerHighest: _textStyle.copyWith( color: _kleurplaat.surface.containerHighest, ), + link: _textStyle.copyWith( + color: _kleurplaat.surface.link, + ), ); + + @override + SurfaceGroupInterface? get surfaceInverse { + if (_kleurplaat.surfaceInverse == null) return null; + return TextStyleSurfaceGroup( + color: _textStyle.copyWith( + color: _kleurplaat.surfaceInverse!.color, + ), + onColorContrast: _textStyle.copyWith( + color: _kleurplaat.surfaceInverse!.onColorContrast, + ), + onColorContrastDim: _textStyle.copyWith( + color: _kleurplaat.surfaceInverse!.onColorContrastDim, + ), + onColorSubtle: _textStyle.copyWith( + color: _kleurplaat.surfaceInverse!.onColorSubtle, + ), + onColorSubtleDim: _textStyle.copyWith( + color: _kleurplaat.surfaceInverse!.onColorSubtleDim, + ), + containerLowest: _textStyle.copyWith( + color: _kleurplaat.surfaceInverse!.containerLowest, + ), + containerLow: _textStyle.copyWith( + color: _kleurplaat.surfaceInverse!.containerLow, + ), + container: _textStyle.copyWith( + color: _kleurplaat.surfaceInverse!.container, + ), + containerHigh: _textStyle.copyWith( + color: _kleurplaat.surfaceInverse!.containerHigh, + ), + containerHighest: _textStyle.copyWith( + color: _kleurplaat.surfaceInverse!.containerHighest, + ), + link: _textStyle.copyWith( + color: _kleurplaat.surfaceInverse!.link, + ), + ); + } } diff --git a/lib/style/text_style/text_style_surface_group.dart b/lib/style/text_style/text_style_surface_group.dart index f6a6273..c6673dd 100644 --- a/lib/style/text_style/text_style_surface_group.dart +++ b/lib/style/text_style/text_style_surface_group.dart @@ -6,27 +6,28 @@ class TextStyleSurfaceGroup implements SurfaceGroupInterface { /// {@macro surface_group} const TextStyleSurfaceGroup({ required this.color, - required this.onColorContrastPlus, - required this.onColorContrastMinus, - required this.onColorSubtlePlus, - required this.onColorSubtleMinus, + required this.onColorContrast, + required this.onColorContrastDim, + required this.onColorSubtle, + required this.onColorSubtleDim, required this.containerLowest, required this.containerLow, required this.container, required this.containerHigh, required this.containerHighest, + required this.link, }); @override final TextStyle color; @override - final TextStyle onColorContrastPlus; + final TextStyle onColorContrast; @override - final TextStyle onColorContrastMinus; + final TextStyle onColorContrastDim; @override - final TextStyle onColorSubtlePlus; + final TextStyle onColorSubtle; @override - final TextStyle onColorSubtleMinus; + final TextStyle onColorSubtleDim; @override final TextStyle containerLowest; @@ -38,6 +39,8 @@ class TextStyleSurfaceGroup implements SurfaceGroupInterface { final TextStyle containerHigh; @override final TextStyle containerHighest; + @override + final TextStyle link; @override TextStyleSurfaceGroup lerp(TextStyleSurfaceGroup? other, double t) => this; From 002767c1def06e2047e1b22d51ed677c6136b193 Mon Sep 17 00:00:00 2001 From: Job Guldemeester Date: Fri, 31 Jan 2025 14:34:26 +0100 Subject: [PATCH 2/3] :bookmark: Bump to 0.0.10 --- CHANGELOG.md | 6 ++++++ example/pubspec.lock | 2 +- pubspec.yaml | 2 +- 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index c906b6b..7f854d3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,9 @@ +## 0.0.10 +Improved kleurplaat + +## 0.0.9 +Added kleurplaat + ## 0.0.6 * :sparkles: Added new version of Result for mapping API responses diff --git a/example/pubspec.lock b/example/pubspec.lock index aa5ed5b..f520e5e 100644 --- a/example/pubspec.lock +++ b/example/pubspec.lock @@ -212,7 +212,7 @@ packages: path: ".." relative: true source: path - version: "0.0.7" + version: "0.0.10" equatable: dependency: transitive description: diff --git a/pubspec.yaml b/pubspec.yaml index fbd4b38..5bd8918 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -1,6 +1,6 @@ name: dcc_toolkit description: "Internal toolkit package used by the DCC team." -version: 0.0.9 +version: 0.0.10 homepage: https://dutchcodingcompany.com repository: https://github.com/DutchCodingCompany/dcc_toolkit From 4e318a76aba2462edea8ba2e576d40e2c2b16491 Mon Sep 17 00:00:00 2001 From: Job Guldemeester Date: Fri, 31 Jan 2025 14:41:06 +0100 Subject: [PATCH 3/3] :bug: Export files --- lib/common/extensions/text_theme.dart | 4 ++++ lib/dcc_toolkit.dart | 1 + lib/style/kleurplaat/color_group.dart | 3 ++- lib/style/kleurplaat/katjas_kleurplaat.dart | 6 ++++-- lib/style/kleurplaat/surface_group.dart | 9 ++++++--- 5 files changed, 17 insertions(+), 6 deletions(-) diff --git a/lib/common/extensions/text_theme.dart b/lib/common/extensions/text_theme.dart index f0e64a7..67df88b 100644 --- a/lib/common/extensions/text_theme.dart +++ b/lib/common/extensions/text_theme.dart @@ -1,16 +1,20 @@ import 'package:flutter/material.dart'; +/// LinkStyle extension for [TextTheme]. extension LinkStyle on TextTheme { + /// Link style for small text. TextStyle get linkSmall => bodySmall!.copyWith( fontWeight: FontWeight.bold, decoration: TextDecoration.underline, ); + /// Link style for medium text. TextStyle get linkMedium => bodyMedium!.copyWith( fontWeight: FontWeight.bold, decoration: TextDecoration.underline, ); + /// Link style for large text. TextStyle get linkLarge => bodyLarge!.copyWith( fontWeight: FontWeight.bold, decoration: TextDecoration.underline, diff --git a/lib/dcc_toolkit.dart b/lib/dcc_toolkit.dart index 6651a98..d9c05e0 100644 --- a/lib/dcc_toolkit.dart +++ b/lib/dcc_toolkit.dart @@ -3,6 +3,7 @@ export 'common/dimensions.dart'; export 'common/extensions/build_context.dart'; export 'common/extensions/color.dart'; export 'common/extensions/iterable.dart'; +export 'common/extensions/text_theme.dart'; export 'common/result/result.dart'; export 'logger/bolt_logger.dart'; export 'style/style.dart'; diff --git a/lib/style/kleurplaat/color_group.dart b/lib/style/kleurplaat/color_group.dart index 4c98bb4..d79d668 100644 --- a/lib/style/kleurplaat/color_group.dart +++ b/lib/style/kleurplaat/color_group.dart @@ -28,7 +28,8 @@ class ColorGroup implements ColorGroupInterface { return ColorGroup( color: Color.lerp(color, other.color, t) ?? color, - onColorContrast: Color.lerp(onColorContrast, other.onColorContrast, t) ?? onColorContrast, + onColorContrast: Color.lerp(onColorContrast, other.onColorContrast, t) ?? + onColorContrast, onColorSubtle: onColorSubtle == null || other.onColorSubtle == null ? null : Color.lerp(onColorSubtle, other.onColorSubtle, t), diff --git a/lib/style/kleurplaat/katjas_kleurplaat.dart b/lib/style/kleurplaat/katjas_kleurplaat.dart index 5cd1bb5..c4261d7 100644 --- a/lib/style/kleurplaat/katjas_kleurplaat.dart +++ b/lib/style/kleurplaat/katjas_kleurplaat.dart @@ -4,7 +4,8 @@ import 'package:dcc_toolkit/style/kleurplaat/surface_group.dart'; import 'package:flutter/material.dart'; /// {@macro kleurplaat} -class KatjasKleurplaat extends ThemeExtension implements KleurplaatInterface { +class KatjasKleurplaat extends ThemeExtension + implements KleurplaatInterface { /// {@macro kleurplaat} const KatjasKleurplaat({ required this.primary, @@ -94,7 +95,8 @@ class KatjasKleurplaat extends ThemeExtension implements Kleur } /// Converts the [KatjasKleurplaat] to a [ColorScheme]. - ColorScheme toColorScheme({Brightness brightness = Brightness.light}) => ColorScheme( + ColorScheme toColorScheme({Brightness brightness = Brightness.light}) => + ColorScheme( brightness: brightness, primary: primary.color, primaryContainer: primary.color, diff --git a/lib/style/kleurplaat/surface_group.dart b/lib/style/kleurplaat/surface_group.dart index 9249b5d..b1a40ea 100644 --- a/lib/style/kleurplaat/surface_group.dart +++ b/lib/style/kleurplaat/surface_group.dart @@ -59,14 +59,17 @@ class SurfaceGroup implements SurfaceGroupInterface { return SurfaceGroup( color: Color.lerp(color, other.color, t)!, onColorContrast: Color.lerp(onColorContrast, other.onColorContrast, t)!, - onColorContrastDim: Color.lerp(onColorContrastDim, other.onColorContrastDim, t)!, + onColorContrastDim: + Color.lerp(onColorContrastDim, other.onColorContrastDim, t)!, onColorSubtle: Color.lerp(onColorSubtle, other.onColorSubtle, t)!, - onColorSubtleDim: Color.lerp(onColorSubtleDim, other.onColorSubtleDim, t)!, + onColorSubtleDim: + Color.lerp(onColorSubtleDim, other.onColorSubtleDim, t)!, containerLowest: Color.lerp(containerLowest, other.containerLowest, t)!, containerLow: Color.lerp(containerLow, other.containerLow, t)!, container: Color.lerp(container, other.container, t)!, containerHigh: Color.lerp(containerHigh, other.containerHigh, t)!, - containerHighest: Color.lerp(containerHighest, other.containerHighest, t)!, + containerHighest: + Color.lerp(containerHighest, other.containerHighest, t)!, link: Color.lerp(link, other.link, t)!, ); }