@@ -462,62 +462,62 @@ class Subscription extends ZulipStream {
462
462
///
463
463
/// Use this in UI code for colors related to [Subscription.color] ,
464
464
/// such as the background of an unread count badge.
465
- class StreamColorSwatch extends ColorSwatch <_StreamColorVariant > {
465
+ class StreamColorSwatch extends ColorSwatch <StreamColorVariant > {
466
466
StreamColorSwatch (int base ) : super (base , _compute (base ));
467
467
468
468
/// The [Subscription.color] int that the swatch is based on.
469
- Color get base => this [_StreamColorVariant .base ]! ;
469
+ Color get base => this [StreamColorVariant .base ]! ;
470
470
471
- Color get unreadCountBadgeBackground => this [_StreamColorVariant .unreadCountBadgeBackground]! ;
471
+ Color get unreadCountBadgeBackground => this [StreamColorVariant .unreadCountBadgeBackground]! ;
472
472
473
473
/// The stream icon on a plain-colored surface, such as white.
474
474
///
475
475
/// For the icon on a [barBackground] -colored surface,
476
476
/// use [iconOnBarBackground] instead.
477
- Color get iconOnPlainBackground => this [_StreamColorVariant .iconOnPlainBackground]! ;
477
+ Color get iconOnPlainBackground => this [StreamColorVariant .iconOnPlainBackground]! ;
478
478
479
479
/// The stream icon on a [barBackground] -colored surface.
480
480
///
481
481
/// For the icon on a plain surface, use [iconOnPlainBackground] instead.
482
482
/// This color is chosen to enhance contrast with [barBackground] :
483
483
/// <https://github.com/zulip/zulip/pull/27485>
484
- Color get iconOnBarBackground => this [_StreamColorVariant .iconOnBarBackground]! ;
484
+ Color get iconOnBarBackground => this [StreamColorVariant .iconOnBarBackground]! ;
485
485
486
486
/// The background color of a bar representing a stream, like a recipient bar.
487
487
///
488
488
/// Use this in the message list, the "Inbox" view, and the "Streams" view.
489
- Color get barBackground => this [_StreamColorVariant .barBackground]! ;
489
+ Color get barBackground => this [StreamColorVariant .barBackground]! ;
490
490
491
- static Map <_StreamColorVariant , Color > _compute (int base ) {
491
+ static Map <StreamColorVariant , Color > _compute (int base ) {
492
492
final baseAsColor = Color (base );
493
493
494
494
final clamped20to75 = clampLchLightness (baseAsColor, 20 , 75 );
495
495
final clamped20to75AsHsl = HSLColor .fromColor (clamped20to75);
496
496
497
497
return {
498
- _StreamColorVariant .base : baseAsColor,
498
+ StreamColorVariant .base : baseAsColor,
499
499
500
500
// Follows `.unread-count` in Vlad's replit:
501
501
// <https://replit.com/@VladKorobov/zulip-sidebar#script.js>
502
502
// <https://chat.zulip.org/#narrow/stream/243-mobile-team/topic/design.3A.20.23F117.20.22Inbox.22.20screen/near/1624484>
503
503
//
504
504
// TODO fix bug where our results differ from the replit's (see unit tests)
505
- _StreamColorVariant .unreadCountBadgeBackground:
505
+ StreamColorVariant .unreadCountBadgeBackground:
506
506
clampLchLightness (baseAsColor, 30 , 70 )
507
507
.withOpacity (0.3 ),
508
508
509
509
// Follows `.sidebar-row__icon` in Vlad's replit:
510
510
// <https://replit.com/@VladKorobov/zulip-topic-feed-colors#script.js>
511
511
//
512
512
// TODO fix bug where our results differ from the replit's (see unit tests)
513
- _StreamColorVariant .iconOnPlainBackground: clamped20to75,
513
+ StreamColorVariant .iconOnPlainBackground: clamped20to75,
514
514
515
515
// Follows `.recepeient__icon` in Vlad's replit:
516
516
// <https://replit.com/@VladKorobov/zulip-topic-feed-colors#script.js>
517
517
// <https://chat.zulip.org/#narrow/stream/243-mobile-team/topic/design.3A.20.23F117.20.22Inbox.22.20screen/near/1624484>
518
518
//
519
519
// TODO fix bug where our results differ from the replit's (see unit tests)
520
- _StreamColorVariant .iconOnBarBackground:
520
+ StreamColorVariant .iconOnBarBackground:
521
521
clamped20to75AsHsl
522
522
.withLightness (clamped20to75AsHsl.lightness - 0.12 )
523
523
.toColor (),
@@ -530,15 +530,16 @@ class StreamColorSwatch extends ColorSwatch<_StreamColorVariant> {
530
530
// <https://pub.dev/documentation/flutter_color_models/latest/flutter_color_models/ColorModel/interpolate.html>
531
531
// which does ordinary RGB mixing. Investigate and send a PR?
532
532
// TODO fix bug where our results differ from the replit's (see unit tests)
533
- _StreamColorVariant .barBackground:
533
+ StreamColorVariant .barBackground:
534
534
LabColor .fromColor (const Color (0xfff9f9f9 ))
535
535
.interpolate (LabColor .fromColor (clamped20to75), 0.22 )
536
536
.toColor (),
537
537
};
538
538
}
539
539
}
540
540
541
- enum _StreamColorVariant {
541
+ @visibleForTesting
542
+ enum StreamColorVariant {
542
543
base ,
543
544
unreadCountBadgeBackground,
544
545
iconOnPlainBackground,
0 commit comments