Changed opacity edit to color edit
This commit is contained in:
parent
9a5dd0b15e
commit
36dc6ea252
1 changed files with 18 additions and 6 deletions
|
|
@ -46,9 +46,9 @@ class OverlayMessage extends StatelessWidget {
|
|||
return const SizedBox.shrink();
|
||||
}
|
||||
|
||||
var color = Theme.of(context).colorScheme.surfaceVariant.withAlpha(
|
||||
Theme.of(context).brightness == Brightness.light ? 90 : 160,
|
||||
);
|
||||
var color = Theme.of(context).colorScheme.surfaceVariant;
|
||||
final isLight = Theme.of(context).brightness == Brightness.light;
|
||||
var lightness = isLight ? .05 : .85;
|
||||
final textColor = ownMessage
|
||||
? Theme.of(context).colorScheme.onPrimary
|
||||
: Theme.of(context).colorScheme.onBackground;
|
||||
|
|
@ -99,10 +99,22 @@ class OverlayMessage extends StatelessWidget {
|
|||
}.contains(event.messageType);
|
||||
|
||||
if (ownMessage) {
|
||||
color = Theme.of(context).colorScheme.primary.withAlpha(
|
||||
Theme.of(context).brightness == Brightness.light ? 30 : 160,
|
||||
);
|
||||
color = Theme.of(context).colorScheme.primary;
|
||||
lightness = isLight ? .15 : .85;
|
||||
}
|
||||
// Make overlay a little darker/lighter than the message
|
||||
color = Color.fromARGB(
|
||||
color.alpha,
|
||||
isLight
|
||||
? (color.red + lightness * (255 - color.red)).round()
|
||||
: (color.red * lightness).round(),
|
||||
isLight
|
||||
? (color.green + lightness * (255 - color.green)).round()
|
||||
: (color.green * lightness).round(),
|
||||
isLight
|
||||
? (color.blue + lightness * (255 - color.blue)).round()
|
||||
: (color.blue * lightness).round(),
|
||||
);
|
||||
|
||||
// #Pangea
|
||||
final pangeaMessageEvent = PangeaMessageEvent(
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue