@@ -35,6 +35,7 @@ class ContentTheme extends ThemeExtension<ContentTheme> {
35
35
factory ContentTheme .light (BuildContext context) {
36
36
return ContentTheme ._(
37
37
colorCodeBlockBackground: const HSLColor .fromAHSL (0.04 , 0 , 0 , 0 ).toColor (),
38
+ colorMathBlockBorder: const HSLColor .fromAHSL (0.15 , 240 , 0.8 , 0.5 ).toColor (),
38
39
colorMessageMediaContainerBackground: const Color .fromRGBO (0 , 0 , 0 , 0.03 ),
39
40
colorThematicBreak: const HSLColor .fromAHSL (1 , 0 , 0 , .87 ).toColor (),
40
41
textStylePlainParagraph: _plainParagraphCommon (context).copyWith (
@@ -51,6 +52,7 @@ class ContentTheme extends ThemeExtension<ContentTheme> {
51
52
factory ContentTheme .dark (BuildContext context) {
52
53
return ContentTheme ._(
53
54
colorCodeBlockBackground: const HSLColor .fromAHSL (0.04 , 0 , 0 , 1 ).toColor (),
55
+ colorMathBlockBorder: const HSLColor .fromAHSL (1 , 240 , 0.4 , 0.4 ).toColor (),
54
56
colorMessageMediaContainerBackground: const HSLColor .fromAHSL (0.03 , 0 , 0 , 1 ).toColor (),
55
57
colorThematicBreak: const HSLColor .fromAHSL (1 , 0 , 0 , .87 ).toColor ().withOpacity (0.2 ),
56
58
textStylePlainParagraph: _plainParagraphCommon (context).copyWith (
@@ -66,6 +68,7 @@ class ContentTheme extends ThemeExtension<ContentTheme> {
66
68
67
69
ContentTheme ._({
68
70
required this .colorCodeBlockBackground,
71
+ required this .colorMathBlockBorder,
69
72
required this .colorMessageMediaContainerBackground,
70
73
required this .colorThematicBreak,
71
74
required this .textStylePlainParagraph,
@@ -85,6 +88,7 @@ class ContentTheme extends ThemeExtension<ContentTheme> {
85
88
}
86
89
87
90
final Color colorCodeBlockBackground;
91
+ final Color colorMathBlockBorder; // TODO(#46) this won't be needed
88
92
final Color colorMessageMediaContainerBackground;
89
93
final Color colorThematicBreak;
90
94
@@ -118,6 +122,7 @@ class ContentTheme extends ThemeExtension<ContentTheme> {
118
122
@override
119
123
ContentTheme copyWith ({
120
124
Color ? colorCodeBlockBackground,
125
+ Color ? colorMathBlockBorder,
121
126
Color ? colorMessageMediaContainerBackground,
122
127
Color ? colorThematicBreak,
123
128
TextStyle ? textStylePlainParagraph,
@@ -127,6 +132,7 @@ class ContentTheme extends ThemeExtension<ContentTheme> {
127
132
}) {
128
133
return ContentTheme ._(
129
134
colorCodeBlockBackground: colorCodeBlockBackground ?? this .colorCodeBlockBackground,
135
+ colorMathBlockBorder: colorMathBlockBorder ?? this .colorMathBlockBorder,
130
136
colorMessageMediaContainerBackground: colorMessageMediaContainerBackground ?? this .colorMessageMediaContainerBackground,
131
137
colorThematicBreak: colorThematicBreak ?? this .colorThematicBreak,
132
138
textStylePlainParagraph: textStylePlainParagraph ?? this .textStylePlainParagraph,
@@ -143,6 +149,7 @@ class ContentTheme extends ThemeExtension<ContentTheme> {
143
149
}
144
150
return ContentTheme ._(
145
151
colorCodeBlockBackground: Color .lerp (colorCodeBlockBackground, other.colorCodeBlockBackground, t)! ,
152
+ colorMathBlockBorder: Color .lerp (colorMathBlockBorder, other.colorMathBlockBorder, t)! ,
146
153
colorMessageMediaContainerBackground: Color .lerp (colorMessageMediaContainerBackground, other.colorMessageMediaContainerBackground, t)! ,
147
154
colorThematicBreak: Color .lerp (colorThematicBreak, other.colorThematicBreak, t)! ,
148
155
textStylePlainParagraph: TextStyle .lerp (textStylePlainParagraph, other.textStylePlainParagraph, t)! ,
@@ -698,12 +705,10 @@ class MathBlock extends StatelessWidget {
698
705
699
706
final MathBlockNode node;
700
707
701
- static final _borderColor = const HSLColor .fromAHSL (0.15 , 240 , 0.8 , 0.5 ).toColor ();
702
-
703
708
@override
704
709
Widget build (BuildContext context) {
705
710
return _CodeBlockContainer (
706
- borderColor: _borderColor ,
711
+ borderColor: ContentTheme . of (context).colorMathBlockBorder ,
707
712
child: Text .rich (TextSpan (
708
713
style: ContentTheme .of (context).codeBlockTextStyles.plain,
709
714
children: [TextSpan (text: node.texSource)])));
0 commit comments