From 704ee5ef9c22015f89da0a3f018299b7b3d82198 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gabriel=20Rodr=C3=ADguez?= Date: Sun, 29 Jan 2023 09:57:59 -0500 Subject: [PATCH] fix: display name contrast in dark mode --- lib/pages/chat/events/message.dart | 5 ++++- lib/utils/string_color.dart | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/lib/pages/chat/events/message.dart b/lib/pages/chat/events/message.dart index 0374e955a..1bc18675c 100644 --- a/lib/pages/chat/events/message.dart +++ b/lib/pages/chat/events/message.dart @@ -165,7 +165,10 @@ class Message extends StatelessWidget { style: TextStyle( fontSize: 12, fontWeight: FontWeight.bold, - color: displayname.color, + color: (Theme.of(context).brightness == + Brightness.light + ? displayname.color + : displayname.lightColor), ), ); }), diff --git a/lib/utils/string_color.dart b/lib/utils/string_color.dart index 1a628fbd7..9cad2313a 100644 --- a/lib/utils/string_color.dart +++ b/lib/utils/string_color.dart @@ -24,6 +24,6 @@ extension StringColor on String { Color get lightColor { _colorCache[this] ??= {}; - return _colorCache[this]![0.4] ??= _getColorLight(0.4); + return _colorCache[this]![0.7] ??= _getColorLight(0.7); } }