Skip to content

Commit 108bfc3

Browse files
committed
theme [nfc]: Add more variables to DesignVariables, from the new Figma
1 parent 71b23f5 commit 108bfc3

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

Diff for: lib/widgets/theme.dart

+14
Original file line numberDiff line numberDiff line change
@@ -129,11 +129,13 @@ const kZulipBrandColor = Color.fromRGBO(0x64, 0x92, 0xfe, 1);
129129
class DesignVariables extends ThemeExtension<DesignVariables> {
130130
DesignVariables.light() :
131131
this._(
132+
background: const Color(0xffffffff),
132133
bgCounterUnread: const Color(0xff666699).withOpacity(0.15),
133134
bgTopBar: const Color(0xfff5f5f5),
134135
borderBar: const Color(0x33000000),
135136
icon: const Color(0xff666699),
136137
labelCounterUnread: const Color(0xff222222),
138+
labelMenuButton: const Color(0xff222222),
137139
mainBackground: const Color(0xfff0f0f0),
138140
title: const Color(0xff1a1a1a),
139141
channelColorSwatches: ChannelColorSwatches.light,
@@ -145,11 +147,13 @@ class DesignVariables extends ThemeExtension<DesignVariables> {
145147

146148
DesignVariables.dark() :
147149
this._(
150+
background: const Color(0xff000000),
148151
bgCounterUnread: const Color(0xff666699).withOpacity(0.37),
149152
bgTopBar: const Color(0xff242424),
150153
borderBar: Colors.black.withOpacity(0.41),
151154
icon: const Color(0xff7070c2),
152155
labelCounterUnread: const Color(0xffffffff).withOpacity(0.7),
156+
labelMenuButton: const Color(0xffffffff).withOpacity(0.85),
153157
mainBackground: const Color(0xff1d1d1d),
154158
title: const Color(0xffffffff),
155159
channelColorSwatches: ChannelColorSwatches.dark,
@@ -161,11 +165,13 @@ class DesignVariables extends ThemeExtension<DesignVariables> {
161165
);
162166

163167
DesignVariables._({
168+
required this.background,
164169
required this.bgCounterUnread,
165170
required this.bgTopBar,
166171
required this.borderBar,
167172
required this.icon,
168173
required this.labelCounterUnread,
174+
required this.labelMenuButton,
169175
required this.mainBackground,
170176
required this.title,
171177
required this.channelColorSwatches,
@@ -185,11 +191,13 @@ class DesignVariables extends ThemeExtension<DesignVariables> {
185191
return extension!;
186192
}
187193

194+
final Color background;
188195
final Color bgCounterUnread;
189196
final Color bgTopBar;
190197
final Color borderBar;
191198
final Color icon;
192199
final Color labelCounterUnread;
200+
final Color labelMenuButton;
193201
final Color mainBackground;
194202
final Color title;
195203

@@ -204,11 +212,13 @@ class DesignVariables extends ThemeExtension<DesignVariables> {
204212

205213
@override
206214
DesignVariables copyWith({
215+
Color? background,
207216
Color? bgCounterUnread,
208217
Color? bgTopBar,
209218
Color? borderBar,
210219
Color? icon,
211220
Color? labelCounterUnread,
221+
Color? labelMenuButton,
212222
Color? mainBackground,
213223
Color? title,
214224
ChannelColorSwatches? channelColorSwatches,
@@ -218,11 +228,13 @@ class DesignVariables extends ThemeExtension<DesignVariables> {
218228
Color? unreadCountBadgeTextForChannel,
219229
}) {
220230
return DesignVariables._(
231+
background: background ?? this.background,
221232
bgCounterUnread: bgCounterUnread ?? this.bgCounterUnread,
222233
bgTopBar: bgTopBar ?? this.bgTopBar,
223234
borderBar: borderBar ?? this.borderBar,
224235
icon: icon ?? this.icon,
225236
labelCounterUnread: labelCounterUnread ?? this.labelCounterUnread,
237+
labelMenuButton: labelMenuButton ?? this.labelMenuButton,
226238
mainBackground: mainBackground ?? this.mainBackground,
227239
title: title ?? this.title,
228240
channelColorSwatches: channelColorSwatches ?? this.channelColorSwatches,
@@ -239,11 +251,13 @@ class DesignVariables extends ThemeExtension<DesignVariables> {
239251
return this;
240252
}
241253
return DesignVariables._(
254+
background: Color.lerp(background, other.background, t)!,
242255
bgCounterUnread: Color.lerp(bgCounterUnread, other.bgCounterUnread, t)!,
243256
bgTopBar: Color.lerp(bgTopBar, other.bgTopBar, t)!,
244257
borderBar: Color.lerp(borderBar, other.borderBar, t)!,
245258
icon: Color.lerp(icon, other.icon, t)!,
246259
labelCounterUnread: Color.lerp(labelCounterUnread, other.labelCounterUnread, t)!,
260+
labelMenuButton: Color.lerp(labelMenuButton, other.labelMenuButton, t)!,
247261
mainBackground: Color.lerp(mainBackground, other.mainBackground, t)!,
248262
title: Color.lerp(title, other.title, t)!,
249263
channelColorSwatches: ChannelColorSwatches.lerp(channelColorSwatches, other.channelColorSwatches, t),

0 commit comments

Comments
 (0)