Merge pull request #317 from pangeachat/handles-stand-out
Make selection handles stand out
This commit is contained in:
commit
bdf43eb2d7
1 changed files with 18 additions and 0 deletions
|
|
@ -47,6 +47,10 @@ class OverlayMessage extends StatelessWidget {
|
|||
}
|
||||
|
||||
var color = Theme.of(context).colorScheme.surfaceVariant;
|
||||
// #Pangea
|
||||
final isLight = Theme.of(context).brightness == Brightness.light;
|
||||
var lightness = isLight ? .05 : .85;
|
||||
// Pangea#
|
||||
final textColor = ownMessage
|
||||
? Theme.of(context).colorScheme.onPrimary
|
||||
: Theme.of(context).colorScheme.onBackground;
|
||||
|
|
@ -98,7 +102,21 @@ class OverlayMessage extends StatelessWidget {
|
|||
|
||||
if (ownMessage) {
|
||||
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