Skip to content

Commit ee57be0

Browse files
committed
msglist [nfc]: Cut unnecessary condition on bar-background brightness
When the background of stream recipient bars was colored by `subscription.color` itself, instead of a much-lightened transformation of that, it was presumably possible that ThemeData.estimateBrightnessForColor would give Brightness.dark, making `contrastingColor` be white. But when we started using `subscription.colorSwatch().barBackground`, in e97e6fd, the darkest possible color became #c8c8c8 (a light gray) -- that's from a base color of true black -- and for that color, ThemeData.estimateBrightnessForColor gives Brightness.light, making `contrastingColor` be black. Lighter base colors than true black will make even lighter `barBackground`s.
1 parent 42c5a68 commit ee57be0

File tree

1 file changed

+1
-4
lines changed

1 file changed

+1
-4
lines changed

lib/widgets/message_list.dart

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -661,10 +661,7 @@ class StreamMessageRecipientHeader extends StatelessWidget {
661661
if (subscription != null) {
662662
final swatch = subscription.colorSwatch();
663663
backgroundColor = swatch.barBackground;
664-
contrastingColor =
665-
(ThemeData.estimateBrightnessForColor(swatch.barBackground) == Brightness.dark)
666-
? Colors.white
667-
: Colors.black;
664+
contrastingColor = Colors.black;
668665
iconColor = swatch.iconOnBarBackground;
669666
} else {
670667
backgroundColor = _kUnsubscribedStreamRecipientHeaderColor;

0 commit comments

Comments
 (0)