Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 20 additions & 0 deletions lib/style/interface/kleurplaat_interface.dart
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,26 @@ abstract interface class KleurplaatInterface<T> {
/// {@endtemplate}
ColorGroupInterface<T> get primaryFill;

/// {@template secondary}
/// The secondary color group.
/// {@endtemplate}
ColorGroupInterface<T>? get secondary;

/// {@template secondaryFill}
/// The secondary fill color group.
/// {@endtemplate}
ColorGroupInterface<T>? get secondaryFill;

/// {@template tertiary}
/// The tertiary color group.
/// {@endtemplate}
ColorGroupInterface<T>? get tertiary;

/// {@template tertiaryFill}
/// The tertiary fill color group.
/// {@endtemplate}
ColorGroupInterface<T>? get tertiaryFill;

/// {@template content}
/// The content color group.
/// {@endtemplate}
Expand Down
32 changes: 32 additions & 0 deletions lib/style/kleurplaat/katjas_kleurplaat.dart
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,10 @@ class KatjasKleurplaat extends ThemeExtension<KatjasKleurplaat>
required this.successFill,
required this.surface,
required this.surfaceInverse,
this.secondary,
this.secondaryFill,
this.tertiary,
this.tertiaryFill,
});

@override
Expand All @@ -26,6 +30,18 @@ class KatjasKleurplaat extends ThemeExtension<KatjasKleurplaat>
@override
final ColorGroup primaryFill;

@override
final ColorGroup? secondary;

@override
final ColorGroup? secondaryFill;

@override
final ColorGroup? tertiary;

@override
final ColorGroup? tertiaryFill;

@override
final ColorGroup content;

Expand Down Expand Up @@ -54,6 +70,10 @@ class KatjasKleurplaat extends ThemeExtension<KatjasKleurplaat>
ThemeExtension<KatjasKleurplaat> copyWith({
ColorGroup? primary,
ColorGroup? primaryFill,
ColorGroup? secondary,
ColorGroup? secondaryFill,
ColorGroup? tertiary,
ColorGroup? tertiaryFill,
ColorGroup? content,
ColorGroup? contentFill,
ColorGroup? error,
Expand All @@ -66,6 +86,10 @@ class KatjasKleurplaat extends ThemeExtension<KatjasKleurplaat>
KatjasKleurplaat(
primary: primary ?? this.primary,
primaryFill: primaryFill ?? this.primaryFill,
secondary: secondary ?? this.secondary,
secondaryFill: secondaryFill ?? this.secondaryFill,
tertiary: tertiary ?? this.tertiary,
tertiaryFill: tertiaryFill ?? this.tertiaryFill,
content: content ?? this.content,
contentFill: contentFill ?? this.contentFill,
error: error ?? this.error,
Expand All @@ -83,6 +107,10 @@ class KatjasKleurplaat extends ThemeExtension<KatjasKleurplaat>
return KatjasKleurplaat(
primary: primary.lerp(other.primary, t),
primaryFill: primaryFill.lerp(other.primaryFill, t),
secondary: secondary?.lerp(other.secondary, t),
secondaryFill: secondaryFill?.lerp(other.secondaryFill, t),
tertiary: tertiary?.lerp(other.tertiary, t),
tertiaryFill: tertiaryFill?.lerp(other.tertiaryFill, t),
content: content.lerp(other.content, t),
contentFill: contentFill.lerp(other.contentFill, t),
error: error.lerp(other.error, t),
Expand All @@ -104,6 +132,10 @@ class KatjasKleurplaat extends ThemeExtension<KatjasKleurplaat>
onPrimaryContainer: primary.onColorContrast,
secondary: content.color,
secondaryContainer: content.color,
secondaryFixed: secondary?.color,
secondaryFixedDim: secondaryFill?.color,
tertiaryFixed: tertiary?.color,
tertiaryFixedDim: tertiaryFill?.color,
onSecondary: content.onColorContrast,
onSecondaryContainer: content.onColorContrast,
tertiary: error.color,
Expand Down
52 changes: 52 additions & 0 deletions lib/style/text_style/text_style_decorator.dart
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,58 @@ class TextStyleDecorator implements KleurplaatInterface<TextStyle> {
),
);

@override
ColorGroupInterface<TextStyle> get secondary => TextStyleColorGroup(
color: _textStyle.copyWith(
color: _kleurplaat.secondary?.color,
),
onColorContrast: _textStyle.copyWith(
color: _kleurplaat.secondary?.onColorContrast,
),
onColorSubtle: _textStyle.copyWith(
color: _kleurplaat.secondary?.onColorSubtle,
),
);

@override
ColorGroupInterface<TextStyle> get secondaryFill => TextStyleColorGroup(
color: _textStyle.copyWith(
color: _kleurplaat.secondaryFill?.color,
),
onColorContrast: _textStyle.copyWith(
color: _kleurplaat.secondaryFill?.onColorContrast,
),
onColorSubtle: _textStyle.copyWith(
color: _kleurplaat.secondaryFill?.onColorSubtle,
),
);

@override
ColorGroupInterface<TextStyle> get tertiary => TextStyleColorGroup(
color: _textStyle.copyWith(
color: _kleurplaat.tertiary?.color,
),
onColorContrast: _textStyle.copyWith(
color: _kleurplaat.tertiary?.onColorContrast,
),
onColorSubtle: _textStyle.copyWith(
color: _kleurplaat.tertiary?.onColorSubtle,
),
);

@override
ColorGroupInterface<TextStyle> get tertiaryFill => TextStyleColorGroup(
color: _textStyle.copyWith(
color: _kleurplaat.tertiaryFill?.color,
),
onColorContrast: _textStyle.copyWith(
color: _kleurplaat.tertiaryFill?.onColorContrast,
),
onColorSubtle: _textStyle.copyWith(
color: _kleurplaat.tertiaryFill?.onColorSubtle,
),
);

@override
ColorGroupInterface<TextStyle> get success => TextStyleColorGroup(
color: _textStyle.copyWith(
Expand Down
12 changes: 6 additions & 6 deletions pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -74,10 +74,10 @@ packages:
dependency: "direct main"
description:
name: chopper
sha256: "40899b729fb6d8969d967264b189efaf2452bc3ccf6ed0782d00f1d8a6161c31"
sha256: "8b25abf4dc034b4a81c23a519691eca6bd16b70782969f95344547d1c4faf3e3"
url: "https://pub.dev"
source: hosted
version: "8.0.3"
version: "8.0.4"
clock:
dependency: transitive
description:
Expand Down Expand Up @@ -388,10 +388,10 @@ packages:
dependency: transitive
description:
name: qs_dart
sha256: be73d060d29c0716ded88380ba32e87ce8105f0ba234edb3edefa0d74d47d64b
sha256: eec9f5e9695a949efb1487b387256260362308da4e002a9a7637bfa5acc7e049
url: "https://pub.dev"
source: hosted
version: "1.2.4"
version: "1.3.1"
recursive_regex:
dependency: transitive
description:
Expand Down Expand Up @@ -561,10 +561,10 @@ packages:
dependency: transitive
description:
name: weak_map
sha256: "95ca338f0cdf5f0022cc283dfa4d97f6f6b03752f67eca85ebe6d7a679ffe3ed"
sha256: "5f8e5d5ce57dc624db5fae814dd689ccae1f17f92b426e52f0a7cbe7f6f4ab97"
url: "https://pub.dev"
source: hosted
version: "3.0.1"
version: "4.0.1"
web:
dependency: transitive
description:
Expand Down