From a2cfc639d88608eed95aa9bd4575a50baf0291bf Mon Sep 17 00:00:00 2001 From: Niels Rijnberg Date: Mon, 9 Mar 2026 16:10:36 +0100 Subject: [PATCH 1/2] Add missing surface colors, add accent color groups --- lib/style/interface/kleurplaat_interface.dart | 10 +++++++++ .../interface/surface_group_interface.dart | 20 +++++++++++++++++ lib/style/kleurplaat/katjas_kleurplaat.dart | 16 ++++++++++++++ lib/style/kleurplaat/surface_group.dart | 20 +++++++++++++++++ .../text_style/handschrift_decorator.dart | 22 +++++++++++++++++++ .../text_style/handschrift_surface_group.dart | 13 +++++++++++ 6 files changed, 101 insertions(+) diff --git a/lib/style/interface/kleurplaat_interface.dart b/lib/style/interface/kleurplaat_interface.dart index e5a828d..e40fa8c 100644 --- a/lib/style/interface/kleurplaat_interface.dart +++ b/lib/style/interface/kleurplaat_interface.dart @@ -36,6 +36,16 @@ abstract interface class KleurplaatInterface { /// {@endtemplate} ColorGroupInterface? get tertiaryFill; + /// {@template accent} + /// The accent color group. + /// {@endtemplate} + ColorGroupInterface? get accent; + + /// {@template accentFill} + /// The accent fill color group. + /// {@endtemplate} + ColorGroupInterface? get accentFill; + /// {@template content} /// The content color group. /// {@endtemplate} diff --git a/lib/style/interface/surface_group_interface.dart b/lib/style/interface/surface_group_interface.dart index 5387157..42d10a2 100644 --- a/lib/style/interface/surface_group_interface.dart +++ b/lib/style/interface/surface_group_interface.dart @@ -59,6 +59,26 @@ abstract interface class SurfaceGroupInterface { /// {@endtemplate} T get link; + /// {@template onColorError} + /// The color on the surface for error. + /// {@endtemplate} + T? get onColorError; + + /// {@template onColorSuccess} + /// The color on the surface for success. + /// {@endtemplate} + T? get onColorSuccess; + + /// {@template onColorPrimary} + /// The color on the surface for primary. + /// {@endtemplate} + T? get onColorPrimary; + + /// {@template onColorPrimaryVariant} + /// The color on the surface for primary variant. + /// {@endtemplate} + T? get onColorPrimaryVariant; + /// Linearly interpolate with another object. SurfaceGroupInterface lerp(covariant SurfaceGroupInterface? other, double t); } diff --git a/lib/style/kleurplaat/katjas_kleurplaat.dart b/lib/style/kleurplaat/katjas_kleurplaat.dart index 197ea62..7c7c96f 100644 --- a/lib/style/kleurplaat/katjas_kleurplaat.dart +++ b/lib/style/kleurplaat/katjas_kleurplaat.dart @@ -21,6 +21,8 @@ class KatjasKleurplaat extends ThemeExtension implements Kleur this.secondaryFill, this.tertiary, this.tertiaryFill, + this.accent, + this.accentFill, }); @override @@ -41,6 +43,12 @@ class KatjasKleurplaat extends ThemeExtension implements Kleur @override final ColorGroup? tertiaryFill; + @override + final ColorGroup? accent; + + @override + final ColorGroup? accentFill; + @override final ColorGroup content; @@ -73,6 +81,8 @@ class KatjasKleurplaat extends ThemeExtension implements Kleur ColorGroup? secondaryFill, ColorGroup? tertiary, ColorGroup? tertiaryFill, + ColorGroup? accent, + ColorGroup? accentFill, ColorGroup? content, ColorGroup? contentFill, ColorGroup? error, @@ -88,6 +98,8 @@ class KatjasKleurplaat extends ThemeExtension implements Kleur secondaryFill: secondaryFill ?? this.secondaryFill, tertiary: tertiary ?? this.tertiary, tertiaryFill: tertiaryFill ?? this.tertiaryFill, + accent: accent ?? this.accent, + accentFill: accentFill ?? this.accentFill, content: content ?? this.content, contentFill: contentFill ?? this.contentFill, error: error ?? this.error, @@ -109,6 +121,8 @@ class KatjasKleurplaat extends ThemeExtension implements Kleur secondaryFill: secondaryFill?.lerp(other.secondaryFill, t), tertiary: tertiary?.lerp(other.tertiary, t), tertiaryFill: tertiaryFill?.lerp(other.tertiaryFill, t), + accent: accent?.lerp(other.accent, t), + accentFill: accentFill?.lerp(other.accentFill, t), content: content.lerp(other.content, t), contentFill: contentFill.lerp(other.contentFill, t), error: error.lerp(other.error, t), @@ -133,6 +147,8 @@ class KatjasKleurplaat extends ThemeExtension implements Kleur secondaryFixedDim: secondaryFill?.color, tertiaryFixed: tertiary?.color, tertiaryFixedDim: tertiaryFill?.color, + onTertiaryFixed: accent?.color, + onTertiaryFixedVariant: accentFill?.color, onSecondary: content.onColorContrast, onSecondaryContainer: content.onColorContrast, tertiary: error.color, diff --git a/lib/style/kleurplaat/surface_group.dart b/lib/style/kleurplaat/surface_group.dart index 9249b5d..5db8d45 100644 --- a/lib/style/kleurplaat/surface_group.dart +++ b/lib/style/kleurplaat/surface_group.dart @@ -17,6 +17,10 @@ class SurfaceGroup implements SurfaceGroupInterface { required this.containerHigh, required this.containerHighest, required this.link, + this.onColorError, + this.onColorSuccess, + this.onColorPrimary, + this.onColorPrimaryVariant, }); @override @@ -52,6 +56,18 @@ class SurfaceGroup implements SurfaceGroupInterface { @override final Color link; + @override + final Color? onColorError; + + @override + final Color? onColorSuccess; + + @override + final Color? onColorPrimary; + + @override + final Color? onColorPrimaryVariant; + @override SurfaceGroup lerp(SurfaceGroup? other, double t) { if (other == null) return this; @@ -68,6 +84,10 @@ class SurfaceGroup implements SurfaceGroupInterface { containerHigh: Color.lerp(containerHigh, other.containerHigh, t)!, containerHighest: Color.lerp(containerHighest, other.containerHighest, t)!, link: Color.lerp(link, other.link, t)!, + onColorError: Color.lerp(onColorError, other.onColorError, t), + onColorSuccess: Color.lerp(onColorSuccess, other.onColorSuccess, t), + onColorPrimary: Color.lerp(onColorPrimary, other.onColorPrimary, t), + onColorPrimaryVariant: Color.lerp(onColorPrimaryVariant, other.onColorPrimaryVariant, t), ); } } diff --git a/lib/style/text_style/handschrift_decorator.dart b/lib/style/text_style/handschrift_decorator.dart index 643b8db..cefd7fd 100644 --- a/lib/style/text_style/handschrift_decorator.dart +++ b/lib/style/text_style/handschrift_decorator.dart @@ -86,6 +86,20 @@ class HandschriftDecorator implements KleurplaatInterface { onColorSubtle: _textStyle.copyWith(color: _kleurplaat.tertiaryFill?.onColorSubtle), ); + @override + ColorGroupInterface get accent => HandschriftColorGroup( + color: _textStyle.copyWith(color: _kleurplaat.accent?.color), + onColorContrast: _textStyle.copyWith(color: _kleurplaat.accent?.onColorContrast), + onColorSubtle: _textStyle.copyWith(color: _kleurplaat.accent?.onColorSubtle), + ); + + @override + ColorGroupInterface get accentFill => HandschriftColorGroup( + color: _textStyle.copyWith(color: _kleurplaat.accentFill?.color), + onColorContrast: _textStyle.copyWith(color: _kleurplaat.accentFill?.onColorContrast), + onColorSubtle: _textStyle.copyWith(color: _kleurplaat.accentFill?.onColorSubtle), + ); + @override ColorGroupInterface get success => HandschriftColorGroup( color: _textStyle.copyWith(color: _kleurplaat.success.color), @@ -113,6 +127,10 @@ class HandschriftDecorator implements KleurplaatInterface { containerHigh: _textStyle.copyWith(color: _kleurplaat.surface.containerHigh), containerHighest: _textStyle.copyWith(color: _kleurplaat.surface.containerHighest), link: _textStyle.copyWith(color: _kleurplaat.surface.link), + onColorError: _textStyle.copyWith(color: _kleurplaat.surface.onColorError), + onColorSuccess: _textStyle.copyWith(color: _kleurplaat.surface.onColorSuccess), + onColorPrimary: _textStyle.copyWith(color: _kleurplaat.surface.onColorPrimary), + onColorPrimaryVariant: _textStyle.copyWith(color: _kleurplaat.surface.onColorPrimaryVariant), ); @override @@ -130,6 +148,10 @@ class HandschriftDecorator implements KleurplaatInterface { containerHigh: _textStyle.copyWith(color: _kleurplaat.surfaceInverse!.containerHigh), containerHighest: _textStyle.copyWith(color: _kleurplaat.surfaceInverse!.containerHighest), link: _textStyle.copyWith(color: _kleurplaat.surfaceInverse!.link), + onColorError: _textStyle.copyWith(color: _kleurplaat.surfaceInverse!.onColorError), + onColorSuccess: _textStyle.copyWith(color: _kleurplaat.surfaceInverse!.onColorSuccess), + onColorPrimary: _textStyle.copyWith(color: _kleurplaat.surfaceInverse!.onColorPrimary), + onColorPrimaryVariant: _textStyle.copyWith(color: _kleurplaat.surfaceInverse!.onColorPrimaryVariant), ); } } diff --git a/lib/style/text_style/handschrift_surface_group.dart b/lib/style/text_style/handschrift_surface_group.dart index e88c966..7f560fb 100644 --- a/lib/style/text_style/handschrift_surface_group.dart +++ b/lib/style/text_style/handschrift_surface_group.dart @@ -16,6 +16,10 @@ class HandschriftSurfaceGroup implements SurfaceGroupInterface { required this.containerHigh, required this.containerHighest, required this.link, + this.onColorError, + this.onColorSuccess, + this.onColorPrimary, + this.onColorPrimaryVariant, }); @override @@ -41,6 +45,15 @@ class HandschriftSurfaceGroup implements SurfaceGroupInterface { final Handschrift containerHighest; @override final Handschrift link; + + @override + final Handschrift? onColorError; + @override + final Handschrift? onColorSuccess; + @override + final Handschrift? onColorPrimary; + @override + final Handschrift? onColorPrimaryVariant; @override HandschriftSurfaceGroup lerp(HandschriftSurfaceGroup? other, double t) => this; From 70a2392c774611ce25fab40dcd20a021e234209f Mon Sep 17 00:00:00 2001 From: Niels Rijnberg Date: Mon, 9 Mar 2026 16:12:46 +0100 Subject: [PATCH 2/2] Format --- lib/style/text_style/handschrift_surface_group.dart | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/style/text_style/handschrift_surface_group.dart b/lib/style/text_style/handschrift_surface_group.dart index 7f560fb..d318a1d 100644 --- a/lib/style/text_style/handschrift_surface_group.dart +++ b/lib/style/text_style/handschrift_surface_group.dart @@ -45,7 +45,7 @@ class HandschriftSurfaceGroup implements SurfaceGroupInterface { final Handschrift containerHighest; @override final Handschrift link; - + @override final Handschrift? onColorError; @override