Skip to content

Commit

Permalink
content [nfc]: Add ContentTheme.colorGlobalTimeBorder
Browse files Browse the repository at this point in the history
The dark and light values come from the web app.

This completes the sweep through message-content colors for #95 dark
theme. They are all either in ContentTheme with light/dark variants,
or still inline but with a comment explaining that they don't need
light/dark variants.
  • Loading branch information
chrisbobbe committed Jun 28, 2024
1 parent d5afb4a commit fb01562
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions lib/widgets/content.dart
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ class ContentTheme extends ThemeExtension<ContentTheme> {
colorCodeBlockBackground: const HSLColor.fromAHSL(0.04, 0, 0, 0).toColor(),
colorDirectMentionBackground: const HSLColor.fromAHSL(0.2, 240, 0.7, 0.7).toColor(),
colorGlobalTimeBackground: const HSLColor.fromAHSL(1, 0, 0, 0.93).toColor(),
colorGlobalTimeBorder: const HSLColor.fromAHSL(1, 0, 0, 0.8).toColor(),
colorMathBlockBorder: const HSLColor.fromAHSL(0.15, 240, 0.8, 0.5).toColor(),
colorMessageMediaContainerBackground: const Color.fromRGBO(0, 0, 0, 0.03),
colorThematicBreak: const HSLColor.fromAHSL(1, 0, 0, .87).toColor(),
Expand All @@ -61,6 +62,7 @@ class ContentTheme extends ThemeExtension<ContentTheme> {
colorCodeBlockBackground: const HSLColor.fromAHSL(0.04, 0, 0, 1).toColor(),
colorDirectMentionBackground: const HSLColor.fromAHSL(0.25, 240, 0.52, 0.6).toColor(),
colorGlobalTimeBackground: const HSLColor.fromAHSL(0.2, 0, 0, 0).toColor(),
colorGlobalTimeBorder: const HSLColor.fromAHSL(0.4, 0, 0, 0).toColor(),
colorMathBlockBorder: const HSLColor.fromAHSL(1, 240, 0.4, 0.4).toColor(),
colorMessageMediaContainerBackground: const HSLColor.fromAHSL(0.03, 0, 0, 1).toColor(),
colorThematicBreak: const HSLColor.fromAHSL(1, 0, 0, .87).toColor().withOpacity(0.2),
Expand All @@ -84,6 +86,7 @@ class ContentTheme extends ThemeExtension<ContentTheme> {
required this.colorCodeBlockBackground,
required this.colorDirectMentionBackground,
required this.colorGlobalTimeBackground,
required this.colorGlobalTimeBorder,
required this.colorMathBlockBorder,
required this.colorMessageMediaContainerBackground,
required this.colorThematicBreak,
Expand All @@ -108,6 +111,7 @@ class ContentTheme extends ThemeExtension<ContentTheme> {
final Color colorCodeBlockBackground;
final Color colorDirectMentionBackground;
final Color colorGlobalTimeBackground;
final Color colorGlobalTimeBorder;
final Color colorMathBlockBorder; // TODO(#46) this won't be needed
final Color colorMessageMediaContainerBackground;
final Color colorThematicBreak;
Expand Down Expand Up @@ -158,6 +162,7 @@ class ContentTheme extends ThemeExtension<ContentTheme> {
Color? colorCodeBlockBackground,
Color? colorDirectMentionBackground,
Color? colorGlobalTimeBackground,
Color? colorGlobalTimeBorder,
Color? colorMathBlockBorder,
Color? colorMessageMediaContainerBackground,
Color? colorThematicBreak,
Expand All @@ -172,6 +177,7 @@ class ContentTheme extends ThemeExtension<ContentTheme> {
colorCodeBlockBackground: colorCodeBlockBackground ?? this.colorCodeBlockBackground,
colorDirectMentionBackground: colorDirectMentionBackground ?? this.colorDirectMentionBackground,
colorGlobalTimeBackground: colorGlobalTimeBackground ?? this.colorGlobalTimeBackground,
colorGlobalTimeBorder: colorGlobalTimeBorder ?? this.colorGlobalTimeBorder,
colorMathBlockBorder: colorMathBlockBorder ?? this.colorMathBlockBorder,
colorMessageMediaContainerBackground: colorMessageMediaContainerBackground ?? this.colorMessageMediaContainerBackground,
colorThematicBreak: colorThematicBreak ?? this.colorThematicBreak,
Expand All @@ -193,6 +199,7 @@ class ContentTheme extends ThemeExtension<ContentTheme> {
colorCodeBlockBackground: Color.lerp(colorCodeBlockBackground, other.colorCodeBlockBackground, t)!,
colorDirectMentionBackground: Color.lerp(colorDirectMentionBackground, other.colorDirectMentionBackground, t)!,
colorGlobalTimeBackground: Color.lerp(colorGlobalTimeBackground, other.colorGlobalTimeBackground, t)!,
colorGlobalTimeBorder: Color.lerp(colorGlobalTimeBorder, other.colorGlobalTimeBorder, t)!,
colorMathBlockBorder: Color.lerp(colorMathBlockBorder, other.colorMathBlockBorder, t)!,
colorMessageMediaContainerBackground: Color.lerp(colorMessageMediaContainerBackground, other.colorMessageMediaContainerBackground, t)!,
colorThematicBreak: Color.lerp(colorThematicBreak, other.colorThematicBreak, t)!,
Expand Down Expand Up @@ -1124,7 +1131,6 @@ class GlobalTime extends StatelessWidget {
final GlobalTimeNode node;
final TextStyle ambientTextStyle;

static final _borderColor = const HSLColor.fromAHSL(1, 0, 0, 0.8).toColor();
static final _dateFormat = DateFormat('EEE, MMM d, y, h:mm a'); // TODO(intl): localize date

@override
Expand All @@ -1138,7 +1144,7 @@ class GlobalTime extends StatelessWidget {
child: DecoratedBox(
decoration: BoxDecoration(
color: contentTheme.colorGlobalTimeBackground,
border: Border.all(width: 1, color: _borderColor),
border: Border.all(width: 1, color: contentTheme.colorGlobalTimeBorder),
borderRadius: BorderRadius.circular(3)),
child: Padding(
padding: const EdgeInsets.symmetric(horizontal: 0.2 * kBaseFontSize),
Expand Down

0 comments on commit fb01562

Please sign in to comment.