Skip to content

Commit ace3e99

Browse files
committed
subscription_list: Place ad hoc dark-theme color for MutedUnreadBadge
Thanks to Greg for the reminder that this needed attention: https://chat.zulip.org/#narrow/stream/48-mobile/topic/dark.20theme/near/1936853 Web, in `main`, uses hsl(0, 0%, 30%) with 50% opacity. We tried using that, but it ended up with pretty low contrast, given the different background it's on here in mobile. So, this ad hoc value, until we have a design from Vlad. Web's light and dark colors might both actually change soon, with the in-flight PR zulip/zulip#31847 that's test-deployed on CZO. But not by much, and not enough to fix the low-contrast issue for us in dark theme. I think the intended change is just to bump the opacity from 50% to 55%. So we might refresh the light variant after that PR is merged, and in any case will refresh both once we have Vlad's design.
1 parent 0331520 commit ace3e99

File tree

2 files changed

+10
-1
lines changed

2 files changed

+10
-1
lines changed

lib/widgets/theme.dart

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -126,6 +126,7 @@ class DesignVariables extends ThemeExtension<DesignVariables> {
126126
groupDmConversationIconBg: const Color(0x33808080),
127127
loginOrDivider: const Color(0xffdedede),
128128
loginOrDividerText: const Color(0xff575757),
129+
mutedUnreadBadge: const HSLColor.fromAHSL(0.5, 0, 0, 0.8).toColor(),
129130
sectionCollapseIcon: const Color(0x7f1e2e48),
130131
star: const HSLColor.fromAHSL(0.5, 47, 1, 0.41).toColor(),
131132
subscriptionListHeaderLine: const HSLColor.fromAHSL(0.2, 240, 0.1, 0.5).toColor(),
@@ -159,6 +160,8 @@ class DesignVariables extends ThemeExtension<DesignVariables> {
159160
loginOrDivider: const Color(0xff424242),
160161
loginOrDividerText: const Color(0xffa8a8a8),
161162
// TODO(design-dark) need proper dark-theme color (this is ad hoc)
163+
mutedUnreadBadge: const HSLColor.fromAHSL(0.5, 0, 0, 0.6).toColor(),
164+
// TODO(design-dark) need proper dark-theme color (this is ad hoc)
162165
sectionCollapseIcon: const Color(0x7fb6c8e2),
163166
// TODO(design-dark) unchanged in dark theme?
164167
star: const HSLColor.fromAHSL(0.5, 47, 1, 0.41).toColor(),
@@ -190,6 +193,7 @@ class DesignVariables extends ThemeExtension<DesignVariables> {
190193
required this.groupDmConversationIconBg,
191194
required this.loginOrDivider,
192195
required this.loginOrDividerText,
196+
required this.mutedUnreadBadge,
193197
required this.sectionCollapseIcon,
194198
required this.star,
195199
required this.subscriptionListHeaderLine,
@@ -231,6 +235,7 @@ class DesignVariables extends ThemeExtension<DesignVariables> {
231235
final Color groupDmConversationIconBg;
232236
final Color loginOrDivider; // TODO(design-dark) need proper dark-theme color (this is ad hoc)
233237
final Color loginOrDividerText; // TODO(design-dark) need proper dark-theme color (this is ad hoc)
238+
final Color mutedUnreadBadge;
234239
final Color sectionCollapseIcon;
235240
final Color star;
236241
final Color subscriptionListHeaderLine;
@@ -259,6 +264,7 @@ class DesignVariables extends ThemeExtension<DesignVariables> {
259264
Color? groupDmConversationIconBg,
260265
Color? loginOrDivider,
261266
Color? loginOrDividerText,
267+
Color? mutedUnreadBadge,
262268
Color? sectionCollapseIcon,
263269
Color? star,
264270
Color? subscriptionListHeaderLine,
@@ -286,6 +292,7 @@ class DesignVariables extends ThemeExtension<DesignVariables> {
286292
groupDmConversationIconBg: groupDmConversationIconBg ?? this.groupDmConversationIconBg,
287293
loginOrDivider: loginOrDivider ?? this.loginOrDivider,
288294
loginOrDividerText: loginOrDividerText ?? this.loginOrDividerText,
295+
mutedUnreadBadge: mutedUnreadBadge ?? this.mutedUnreadBadge,
289296
sectionCollapseIcon: sectionCollapseIcon ?? this.sectionCollapseIcon,
290297
star: star ?? this.star,
291298
subscriptionListHeaderLine: subscriptionListHeaderLine ?? this.subscriptionListHeaderLine,
@@ -320,6 +327,7 @@ class DesignVariables extends ThemeExtension<DesignVariables> {
320327
groupDmConversationIconBg: Color.lerp(groupDmConversationIconBg, other.groupDmConversationIconBg, t)!,
321328
loginOrDivider: Color.lerp(loginOrDivider, other.loginOrDivider, t)!,
322329
loginOrDividerText: Color.lerp(loginOrDividerText, other.loginOrDividerText, t)!,
330+
mutedUnreadBadge: Color.lerp(mutedUnreadBadge, other.mutedUnreadBadge, t)!,
323331
sectionCollapseIcon: Color.lerp(sectionCollapseIcon, other.sectionCollapseIcon, t)!,
324332
star: Color.lerp(star, other.star, t)!,
325333
subscriptionListHeaderLine: Color.lerp(subscriptionListHeaderLine, other.subscriptionListHeaderLine, t)!,

lib/widgets/unread_count_badge.dart

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,12 +63,13 @@ class MutedUnreadBadge extends StatelessWidget {
6363

6464
@override
6565
Widget build(BuildContext context) {
66+
final designVariables = DesignVariables.of(context);
6667
return Container(
6768
width: 8,
6869
height: 8,
6970
margin: const EdgeInsetsDirectional.only(end: 3),
7071
decoration: BoxDecoration(
71-
color: const HSLColor.fromAHSL(0.5, 0, 0, 0.8).toColor(),
72+
color: designVariables.mutedUnreadBadge,
7273
shape: BoxShape.circle));
7374
}
7475
}

0 commit comments

Comments
 (0)