@@ -48,6 +48,7 @@ class ContentTheme extends ThemeExtension<ContentTheme> {
48
48
colorDirectMentionBackground: const HSLColor .fromAHSL (0.2 , 240 , 0.7 , 0.7 ).toColor (),
49
49
colorGlobalTimeBackground: const HSLColor .fromAHSL (1 , 0 , 0 , 0.93 ).toColor (),
50
50
colorGlobalTimeBorder: const HSLColor .fromAHSL (1 , 0 , 0 , 0.8 ).toColor (),
51
+ colorHighlightBackground: const Color (0xfffcef9f ),
51
52
colorLink: const HSLColor .fromAHSL (1 , 200 , 1 , 0.4 ).toColor (),
52
53
colorMathBlockBorder: const HSLColor .fromAHSL (0.15 , 240 , 0.8 , 0.5 ).toColor (),
53
54
colorMessageMediaContainerBackground: const Color .fromRGBO (0 , 0 , 0 , 0.03 ),
@@ -82,6 +83,7 @@ class ContentTheme extends ThemeExtension<ContentTheme> {
82
83
colorDirectMentionBackground: const HSLColor .fromAHSL (0.25 , 240 , 0.52 , 0.6 ).toColor (),
83
84
colorGlobalTimeBackground: const HSLColor .fromAHSL (0.2 , 0 , 0 , 0 ).toColor (),
84
85
colorGlobalTimeBorder: const HSLColor .fromAHSL (0.4 , 0 , 0 , 0 ).toColor (),
86
+ colorHighlightBackground: const Color (0xffffe757 ).withValues (alpha: 0.35 ),
85
87
colorLink: const HSLColor .fromAHSL (1 , 200 , 1 , 0.4 ).toColor (), // the same as light in Web
86
88
colorMathBlockBorder: const HSLColor .fromAHSL (1 , 240 , 0.4 , 0.4 ).toColor (),
87
89
colorMessageMediaContainerBackground: const HSLColor .fromAHSL (0.03 , 0 , 0 , 1 ).toColor (),
@@ -115,6 +117,7 @@ class ContentTheme extends ThemeExtension<ContentTheme> {
115
117
required this .colorDirectMentionBackground,
116
118
required this .colorGlobalTimeBackground,
117
119
required this .colorGlobalTimeBorder,
120
+ required this .colorHighlightBackground,
118
121
required this .colorLink,
119
122
required this .colorMathBlockBorder,
120
123
required this .colorMessageMediaContainerBackground,
@@ -148,6 +151,10 @@ class ContentTheme extends ThemeExtension<ContentTheme> {
148
151
final Color colorDirectMentionBackground;
149
152
final Color colorGlobalTimeBackground;
150
153
final Color colorGlobalTimeBorder;
154
+
155
+ // From Figma: https://www.figma.com/design/1JTNtYo9memgW7vV6d0ygq/Zulip-Mobile?node-id=10904-102278&m=dev
156
+ final Color colorHighlightBackground;
157
+
151
158
final Color colorLink;
152
159
final Color colorMathBlockBorder; // TODO(#46) this won't be needed
153
160
final Color colorMessageMediaContainerBackground;
@@ -209,6 +216,7 @@ class ContentTheme extends ThemeExtension<ContentTheme> {
209
216
Color ? colorDirectMentionBackground,
210
217
Color ? colorGlobalTimeBackground,
211
218
Color ? colorGlobalTimeBorder,
219
+ Color ? colorHighlightBackground,
212
220
Color ? colorLink,
213
221
Color ? colorMathBlockBorder,
214
222
Color ? colorMessageMediaContainerBackground,
@@ -232,6 +240,7 @@ class ContentTheme extends ThemeExtension<ContentTheme> {
232
240
colorDirectMentionBackground: colorDirectMentionBackground ?? this .colorDirectMentionBackground,
233
241
colorGlobalTimeBackground: colorGlobalTimeBackground ?? this .colorGlobalTimeBackground,
234
242
colorGlobalTimeBorder: colorGlobalTimeBorder ?? this .colorGlobalTimeBorder,
243
+ colorHighlightBackground: colorHighlightBackground ?? this .colorHighlightBackground,
235
244
colorLink: colorLink ?? this .colorLink,
236
245
colorMathBlockBorder: colorMathBlockBorder ?? this .colorMathBlockBorder,
237
246
colorMessageMediaContainerBackground: colorMessageMediaContainerBackground ?? this .colorMessageMediaContainerBackground,
@@ -262,6 +271,7 @@ class ContentTheme extends ThemeExtension<ContentTheme> {
262
271
colorDirectMentionBackground: Color .lerp (colorDirectMentionBackground, other.colorDirectMentionBackground, t)! ,
263
272
colorGlobalTimeBackground: Color .lerp (colorGlobalTimeBackground, other.colorGlobalTimeBackground, t)! ,
264
273
colorGlobalTimeBorder: Color .lerp (colorGlobalTimeBorder, other.colorGlobalTimeBorder, t)! ,
274
+ colorHighlightBackground: Color .lerp (colorHighlightBackground, other.colorHighlightBackground, t)! ,
265
275
colorLink: Color .lerp (colorLink, other.colorLink, t)! ,
266
276
colorMathBlockBorder: Color .lerp (colorMathBlockBorder, other.colorMathBlockBorder, t)! ,
267
277
colorMessageMediaContainerBackground: Color .lerp (colorMessageMediaContainerBackground, other.colorMessageMediaContainerBackground, t)! ,
@@ -1278,6 +1288,10 @@ class _InlineContentBuilder {
1278
1288
return WidgetSpan (alignment: PlaceholderAlignment .middle,
1279
1289
child: GlobalTime (node: node, ambientTextStyle: widget.style));
1280
1290
1291
+ case HighlightNode ():
1292
+ return _buildNodes (node.nodes,
1293
+ style: TextStyle (backgroundColor: ContentTheme .of (_context! ).colorHighlightBackground));
1294
+
1281
1295
case UnimplementedInlineContentNode ():
1282
1296
return _errorUnimplemented (node, context: _context! );
1283
1297
}
0 commit comments