@@ -554,11 +554,19 @@ class StreamMessageRecipientHeader extends StatelessWidget {
554
554
final topic = message.subject;
555
555
556
556
final subscription = store.subscriptions[message.streamId];
557
- final streamColor = Color (subscription? .color ?? 0x00c2c2c2 );
558
- final contrastingColor =
559
- ThemeData .estimateBrightnessForColor (streamColor) == Brightness .dark
560
- ? Colors .white
561
- : Colors .black;
557
+ final Color backgroundColor;
558
+ final Color contrastingColor;
559
+ if (subscription != null ) {
560
+ final swatch = subscription.colorSwatch ();
561
+ backgroundColor = swatch.barBackground;
562
+ contrastingColor =
563
+ (ThemeData .estimateBrightnessForColor (swatch.barBackground) == Brightness .dark)
564
+ ? Colors .white
565
+ : Colors .black;
566
+ } else {
567
+ backgroundColor = _kFallbackStreamColor;
568
+ contrastingColor = Colors .black;
569
+ }
562
570
final textStyle = TextStyle (
563
571
color: contrastingColor,
564
572
);
@@ -593,7 +601,7 @@ class StreamMessageRecipientHeader extends StatelessWidget {
593
601
MessageListPage .buildRoute (context: context,
594
602
narrow: TopicNarrow .ofMessage (message))),
595
603
child: ColoredBox (
596
- color: _kStreamMessageBorderColor ,
604
+ color: backgroundColor ,
597
605
child: Row (mainAxisAlignment: MainAxisAlignment .start, children: [
598
606
// TODO(#282): Long stream name will break layout; find a fix.
599
607
streamWidget,
@@ -609,13 +617,11 @@ class StreamMessageRecipientHeader extends StatelessWidget {
609
617
// TODO topic links?
610
618
// Then web also has edit/resolve/mute buttons. Skip those for mobile.
611
619
RecipientHeaderDate (message: message,
612
- color: _kRecipientHeaderDateColor ),
620
+ color: contrastingColor. withOpacity ( 0.4 ) ),
613
621
])));
614
622
}
615
623
}
616
624
617
- final _kStreamMessageBorderColor = const HSLColor .fromAHSL (1 , 0 , 0 , 0.88 ).toColor ();
618
-
619
625
class DmRecipientHeader extends StatelessWidget {
620
626
const DmRecipientHeader ({super .key, required this .message});
621
627
0 commit comments