chore: Message bubble color follow up

This commit is contained in:
krille-chan 2025-02-05 19:57:53 +01:00
commit b6ea44da2e
No known key found for this signature in database
7 changed files with 37 additions and 39 deletions

View file

@ -147,3 +147,18 @@ extension on Brightness {
Brightness get reversed =>
this == Brightness.dark ? Brightness.light : Brightness.dark;
}
extension BubbleColorTheme on ThemeData {
Color get bubbleColor => brightness == Brightness.light
? colorScheme.primary
: colorScheme.primaryContainer;
Color get onBubbleColor => brightness == Brightness.light
? colorScheme.onPrimary
: colorScheme.onPrimaryContainer;
Color get secondaryBubbleColor => HSLColor.fromColor(
brightness == Brightness.light
? colorScheme.tertiary
: colorScheme.tertiaryContainer,
).withSaturation(0.75).toColor();
}