diff --git a/lib/config/themes.dart b/lib/config/themes.dart index 5d2b378c..8e1aca83 100644 --- a/lib/config/themes.dart +++ b/lib/config/themes.dart @@ -34,7 +34,7 @@ abstract class FluffyThemes { primaryColor: AppConfig.primaryColor, accentColor: AppConfig.primaryColor, backgroundColor: Colors.white, - secondaryHeaderColor: AppConfig.primaryColor.withAlpha(16), + secondaryHeaderColor: lighten(AppConfig.primaryColor, .51), scaffoldBackgroundColor: Colors.white, textTheme: Typography.material2018().black.merge(fallback_text_theme), snackBarTheme: SnackBarThemeData( @@ -60,11 +60,11 @@ abstract class FluffyThemes { enabledBorder: OutlineInputBorder( borderRadius: BorderRadius.circular(AppConfig.borderRadius), borderSide: BorderSide( - color: AppConfig.primaryColor.withAlpha(16), + color: lighten(AppConfig.primaryColor, .51), ), ), filled: true, - fillColor: AppConfig.primaryColor.withAlpha(16), + fillColor: lighten(AppConfig.primaryColor, .51), ), appBarTheme: AppBarTheme( brightness: Brightness.light, @@ -87,7 +87,7 @@ abstract class FluffyThemes { backgroundColor: Colors.black, scaffoldBackgroundColor: Colors.black, accentColor: AppConfig.primaryColorLight, - secondaryHeaderColor: AppConfig.primaryColorLight.withAlpha(32), + secondaryHeaderColor: FluffyThemes.darken(AppConfig.primaryColorLight, .71), textTheme: Typography.material2018().white.merge(fallback_text_theme), dialogTheme: DialogTheme( shape: RoundedRectangleBorder( @@ -107,11 +107,11 @@ abstract class FluffyThemes { border: OutlineInputBorder( borderRadius: BorderRadius.circular(AppConfig.borderRadius)), filled: true, - fillColor: AppConfig.primaryColorLight.withAlpha(32), + fillColor: FluffyThemes.darken(AppConfig.primaryColorLight, .71), enabledBorder: OutlineInputBorder( borderRadius: BorderRadius.circular(AppConfig.borderRadius), borderSide: BorderSide( - color: AppConfig.primaryColor.withAlpha(16), + color: FluffyThemes.darken(AppConfig.primaryColor, .31), ), ), ), @@ -144,4 +144,23 @@ abstract class FluffyThemes { Theme.of(context).brightness == Brightness.light ? Colors.white : Colors.black; + + static Color darken(Color color, [double amount = .1]) { + assert(amount >= 0 && amount <= 1); + + final hsl = HSLColor.fromColor(color); + final hslDark = hsl.withLightness((hsl.lightness - amount).clamp(0.0, 1.0)); + + return hslDark.toColor(); + } + + static Color lighten(Color color, [double amount = .1]) { + assert(amount >= 0 && amount <= 1); + + final hsl = HSLColor.fromColor(color); + final hslLight = + hsl.withLightness((hsl.lightness + amount).clamp(0.0, 1.0)); + + return hslLight.toColor(); + } } diff --git a/lib/views/home_view_parts/settings.dart b/lib/views/home_view_parts/settings.dart index 56d49cc9..09e2490c 100644 --- a/lib/views/home_view_parts/settings.dart +++ b/lib/views/home_view_parts/settings.dart @@ -354,7 +354,7 @@ class _SettingsState extends State { title: Text( L10n.of(context).notifications, style: TextStyle( - color: Theme.of(context).primaryColor, + color: Theme.of(context).accentColor, fontWeight: FontWeight.bold, ), ), @@ -370,7 +370,7 @@ class _SettingsState extends State { title: Text( L10n.of(context).chat, style: TextStyle( - color: Theme.of(context).primaryColor, + color: Theme.of(context).accentColor, fontWeight: FontWeight.bold, ), ), @@ -415,7 +415,7 @@ class _SettingsState extends State { title: Text( L10n.of(context).account, style: TextStyle( - color: Theme.of(context).primaryColor, + color: Theme.of(context).accentColor, fontWeight: FontWeight.bold, ), ), @@ -478,7 +478,7 @@ class _SettingsState extends State { title: Text( L10n.of(context).security, style: TextStyle( - color: Theme.of(context).primaryColor, + color: Theme.of(context).accentColor, fontWeight: FontWeight.bold, ), ), @@ -514,7 +514,7 @@ class _SettingsState extends State { title: Text( L10n.of(context).about, style: TextStyle( - color: Theme.of(context).primaryColor, + color: Theme.of(context).accentColor, fontWeight: FontWeight.bold, ), ), diff --git a/lib/views/settings_emotes.dart b/lib/views/settings_emotes.dart index 310f1bb7..a1e3033e 100644 --- a/lib/views/settings_emotes.dart +++ b/lib/views/settings_emotes.dart @@ -209,11 +209,11 @@ class _EmotesSettingsState extends State { prefixText: ': ', suffixText: ':', prefixStyle: TextStyle( - color: Theme.of(context).primaryColor, + color: Theme.of(context).accentColor, fontWeight: FontWeight.bold, ), suffixStyle: TextStyle( - color: Theme.of(context).primaryColor, + color: Theme.of(context).accentColor, fontWeight: FontWeight.bold, ), border: InputBorder.none, @@ -272,7 +272,6 @@ class _EmotesSettingsState extends State { title: Text(L10n.of(context).enableEmotesGlobally), trailing: Switch( value: isGloballyActive(client), - activeColor: Theme.of(context).primaryColor, onChanged: (bool newValue) async { await _setIsGloballyActive(context, newValue); setState(() => null); @@ -328,11 +327,11 @@ class _EmotesSettingsState extends State { prefixText: ': ', suffixText: ':', prefixStyle: TextStyle( - color: Theme.of(context).primaryColor, + color: Theme.of(context).accentColor, fontWeight: FontWeight.bold, ), suffixStyle: TextStyle( - color: Theme.of(context).primaryColor, + color: Theme.of(context).accentColor, fontWeight: FontWeight.bold, ), border: InputBorder.none, diff --git a/lib/views/settings_notifications.dart b/lib/views/settings_notifications.dart index 4b540451..abc2f99c 100644 --- a/lib/views/settings_notifications.dart +++ b/lib/views/settings_notifications.dart @@ -151,7 +151,7 @@ class SettingsNotifications extends StatelessWidget { title: Text( L10n.of(context).pushRules, style: TextStyle( - color: Theme.of(context).primaryColor, + color: Theme.of(context).accentColor, fontWeight: FontWeight.bold, ), ),