From 4b7db0c1472acfdc92b020b60617250f8510f8d3 Mon Sep 17 00:00:00 2001 From: Frederik Feichtmeier Date: Thu, 17 Mar 2022 09:28:13 +0100 Subject: [PATCH] YaruColors: do not change old red name (#139) * YaruColors: do not change old red name - this breaking change would affect packages using yaru.dart and thus would need a major release. * Example: shorten color strings --- example/lib/view/colors_view.dart | 26 ++++-------- example/lib/view/home_page.dart | 4 +- lib/src/colors/yaru_colors.dart | 4 +- lib/src/themes/yaru_accents.dart | 43 ++++++++++---------- lib/src/themes/yaru_dark.dart | 2 +- lib/src/themes/yaru_kubuntu_dark.dart | 2 +- lib/src/themes/yaru_kubuntu_light.dart | 2 +- lib/src/themes/yaru_light.dart | 2 +- lib/src/themes/yaru_lubuntu_dark.dart | 2 +- lib/src/themes/yaru_lubuntu_light.dart | 2 +- lib/src/themes/yaru_mate_dark.dart | 2 +- lib/src/themes/yaru_mate_light.dart | 2 +- lib/src/themes/yaru_ubuntu_budgie_dark.dart | 2 +- lib/src/themes/yaru_ubuntu_budgie_light.dart | 2 +- lib/src/themes/yaru_ubuntu_studio_dark.dart | 2 +- lib/src/themes/yaru_ubuntu_studio_light.dart | 2 +- lib/src/themes/yaru_xubuntu_dark.dart | 2 +- lib/src/themes/yaru_xubuntu_light.dart | 2 +- 18 files changed, 47 insertions(+), 58 deletions(-) diff --git a/example/lib/view/colors_view.dart b/example/lib/view/colors_view.dart index 779313de9..d036f532f 100644 --- a/example/lib/view/colors_view.dart +++ b/example/lib/view/colors_view.dart @@ -14,41 +14,29 @@ class ColorsView extends StatelessWidget { Expanded( child: colorPaletteExample('orange', YaruColors.ubuntuOrange)), SizedBox(width: 25.0), - Expanded( - child: colorPaletteExample( - 'oliveMaterialColor', oliveMaterialColor)), + Expanded(child: colorPaletteExample('olive', oliveMaterialColor)), SizedBox(width: 25.0), - Expanded( - child: colorPaletteExample( - 'barkMaterialColor', barkMaterialColor)), + Expanded(child: colorPaletteExample('bark', barkMaterialColor)), ], ), Divider(height: 50.0, color: Colors.black), Row( children: [ Expanded( - child: colorPaletteExample( - 'viridianMaterialColor', viridianMaterialColor)), + child: colorPaletteExample('viridian', viridianMaterialColor)), SizedBox(width: 25.0), - Expanded( - child: colorPaletteExample( - 'purpleMaterialColor', purpleMaterialColor)), + Expanded(child: colorPaletteExample('purple', purpleMaterialColor)), SizedBox(width: 25.0), - Expanded( - child: - colorPaletteExample('redMaterialColor', redMaterialColor)), + Expanded(child: colorPaletteExample('red', lightRedMaterialColor)), ], ), Divider(height: 50.0, color: Colors.black), Row( children: [ - Expanded( - child: colorPaletteExample( - 'blueMaterialColor', blueMaterialColor)), + Expanded(child: colorPaletteExample('blue', blueMaterialColor)), SizedBox(width: 25.0), Expanded( - child: colorPaletteExample( - 'magentaMaterialColor', magentaMaterialColor)), + child: colorPaletteExample('magenta', magentaMaterialColor)), SizedBox(width: 25.0), Expanded( child: colorPaletteExample('warmGrey', YaruColors.warmGrey)), diff --git a/example/lib/view/home_page.dart b/example/lib/view/home_page.dart index 96cb6fc44..e8b9b7111 100644 --- a/example/lib/view/home_page.dart +++ b/example/lib/view/home_page.dart @@ -101,8 +101,8 @@ class _HomePageState extends State { darkTheme.value = yaruPurpleDark; }), ColorDisk( - color: YaruColors.red, - selected: Theme.of(context).primaryColor == redMaterialColor, + color: YaruColors.lightRed, + selected: Theme.of(context).primaryColor == lightRedMaterialColor, onPressed: () { lightTheme.value = yaruRedLight; darkTheme.value = yaruRedDark; diff --git a/lib/src/colors/yaru_colors.dart b/lib/src/colors/yaru_colors.dart index 65cf9c0b2..842c397af 100644 --- a/lib/src/colors/yaru_colors.dart +++ b/lib/src/colors/yaru_colors.dart @@ -36,7 +36,7 @@ class YaruColors { static const Color coolGrey = Color(0xFF333333); static const Color textGrey = Color(0xFF111111); - static const Color errorRed = Color(0xFFff0000); + static const Color red = Color(0xFFff0000); static const Color yellow = Color(0xFFf99b11); static const Color green = Color(0xFF0e8420); static const Color disabledGreyDark = Color(0xFF535353); @@ -47,7 +47,7 @@ class YaruColors { static const bark = Color(0xFF787859); static const viridian = Color(0xFF03875B); static const purple = Color(0xFF8856EB); - static const red = Color(0xFFE61D34); + static const lightRed = Color(0xFFE61D34); static const blue = Color(0xFF0073E5); static const magenta = Color(0xFFBC33DB); diff --git a/lib/src/themes/yaru_accents.dart b/lib/src/themes/yaru_accents.dart index dbbf39e8e..4c2f2cc82 100644 --- a/lib/src/themes/yaru_accents.dart +++ b/lib/src/themes/yaru_accents.dart @@ -7,7 +7,8 @@ final barkMaterialColor = YaruColors.createMaterialColor(YaruColors.bark); final viridianMaterialColor = YaruColors.createMaterialColor(YaruColors.viridian); final purpleMaterialColor = YaruColors.createMaterialColor(YaruColors.purple); -final redMaterialColor = YaruColors.createMaterialColor(YaruColors.red); +final lightRedMaterialColor = + YaruColors.createMaterialColor(YaruColors.lightRed); final blueMaterialColor = YaruColors.createMaterialColor(YaruColors.blue); final magentaMaterialColor = YaruColors.createMaterialColor(YaruColors.magenta); @@ -18,7 +19,7 @@ final yaruOliveLight = createYaruLightTheme( accentColor: YaruColors.olive, cardColor: Colors.white, backgroundColor: YaruColors.porcelain, - errorColor: YaruColors.errorRed, + errorColor: YaruColors.red, brightness: Brightness.light, ), primaryColor: oliveMaterialColor, @@ -31,7 +32,7 @@ final yaruOliveDark = createYaruDarkTheme( accentColor: YaruColors.olive, cardColor: YaruColors.jet, backgroundColor: YaruColors.jet, - errorColor: YaruColors.errorRed, + errorColor: YaruColors.red, brightness: Brightness.dark, ), primaryColor: oliveMaterialColor, @@ -44,7 +45,7 @@ final yaruBarkLight = createYaruLightTheme( accentColor: YaruColors.bark, cardColor: Colors.white, backgroundColor: YaruColors.porcelain, - errorColor: YaruColors.errorRed, + errorColor: YaruColors.red, brightness: Brightness.light, ), primaryColor: barkMaterialColor, @@ -57,7 +58,7 @@ final yaruBarkDark = createYaruDarkTheme( accentColor: YaruColors.bark, cardColor: YaruColors.jet, backgroundColor: YaruColors.jet, - errorColor: YaruColors.errorRed, + errorColor: YaruColors.red, brightness: Brightness.dark, ), primaryColor: barkMaterialColor, @@ -70,7 +71,7 @@ final yaruViridianLight = createYaruLightTheme( accentColor: YaruColors.viridian, cardColor: Colors.white, backgroundColor: YaruColors.porcelain, - errorColor: YaruColors.errorRed, + errorColor: YaruColors.red, brightness: Brightness.light, ), primaryColor: viridianMaterialColor, @@ -83,7 +84,7 @@ final yaruViridianDark = createYaruDarkTheme( accentColor: YaruColors.viridian, cardColor: YaruColors.jet, backgroundColor: YaruColors.jet, - errorColor: YaruColors.errorRed, + errorColor: YaruColors.red, brightness: Brightness.dark, ), primaryColor: viridianMaterialColor, @@ -96,7 +97,7 @@ final yaruPurpleLight = createYaruLightTheme( accentColor: YaruColors.purple, cardColor: Colors.white, backgroundColor: YaruColors.porcelain, - errorColor: YaruColors.errorRed, + errorColor: YaruColors.red, brightness: Brightness.light, ), primaryColor: purpleMaterialColor, @@ -109,7 +110,7 @@ final yaruPurpleDark = createYaruDarkTheme( accentColor: YaruColors.purple, cardColor: YaruColors.jet, backgroundColor: YaruColors.jet, - errorColor: YaruColors.errorRed, + errorColor: YaruColors.red, brightness: Brightness.dark, ), primaryColor: purpleMaterialColor, @@ -117,28 +118,28 @@ final yaruPurpleDark = createYaruDarkTheme( final yaruRedLight = createYaruLightTheme( colorScheme: ColorScheme.fromSwatch( - primarySwatch: redMaterialColor, + primarySwatch: lightRedMaterialColor, primaryColorDark: YaruColors.coolGrey, - accentColor: YaruColors.red, + accentColor: YaruColors.lightRed, cardColor: Colors.white, backgroundColor: YaruColors.porcelain, - errorColor: YaruColors.errorRed, + errorColor: YaruColors.red, brightness: Brightness.light, ), - primaryColor: redMaterialColor, + primaryColor: lightRedMaterialColor, ); final yaruRedDark = createYaruDarkTheme( colorScheme: ColorScheme.fromSwatch( - primarySwatch: redMaterialColor, + primarySwatch: lightRedMaterialColor, primaryColorDark: YaruColors.coolGrey, - accentColor: YaruColors.red, + accentColor: YaruColors.lightRed, cardColor: YaruColors.jet, backgroundColor: YaruColors.jet, - errorColor: YaruColors.errorRed, + errorColor: YaruColors.red, brightness: Brightness.dark, ), - primaryColor: redMaterialColor, + primaryColor: lightRedMaterialColor, ); final yaruBlueLight = createYaruLightTheme( @@ -148,7 +149,7 @@ final yaruBlueLight = createYaruLightTheme( accentColor: YaruColors.blue, cardColor: Colors.white, backgroundColor: YaruColors.porcelain, - errorColor: YaruColors.errorRed, + errorColor: YaruColors.red, brightness: Brightness.light, ), primaryColor: blueMaterialColor, @@ -161,7 +162,7 @@ final yaruBlueDark = createYaruDarkTheme( accentColor: YaruColors.blue, cardColor: YaruColors.jet, backgroundColor: YaruColors.jet, - errorColor: YaruColors.errorRed, + errorColor: YaruColors.red, brightness: Brightness.dark, ), primaryColor: blueMaterialColor, @@ -174,7 +175,7 @@ final yarMagentaLight = createYaruLightTheme( accentColor: YaruColors.magenta, cardColor: Colors.white, backgroundColor: YaruColors.porcelain, - errorColor: YaruColors.errorRed, + errorColor: YaruColors.red, brightness: Brightness.light, ), primaryColor: magentaMaterialColor, @@ -187,7 +188,7 @@ final yaruMagentaDark = createYaruDarkTheme( accentColor: YaruColors.magenta, cardColor: YaruColors.jet, backgroundColor: YaruColors.jet, - errorColor: YaruColors.errorRed, + errorColor: YaruColors.red, brightness: Brightness.dark, ), primaryColor: magentaMaterialColor, diff --git a/lib/src/themes/yaru_dark.dart b/lib/src/themes/yaru_dark.dart index c3bf70fae..d0b400f0d 100644 --- a/lib/src/themes/yaru_dark.dart +++ b/lib/src/themes/yaru_dark.dart @@ -10,7 +10,7 @@ final _darkColorScheme = ColorScheme.fromSwatch( accentColor: _primaryColor, cardColor: YaruColors.jet, backgroundColor: YaruColors.jet, - errorColor: YaruColors.errorRed, + errorColor: YaruColors.red, brightness: Brightness.dark, ); diff --git a/lib/src/themes/yaru_kubuntu_dark.dart b/lib/src/themes/yaru_kubuntu_dark.dart index 7f6a77305..07d092e53 100644 --- a/lib/src/themes/yaru_kubuntu_dark.dart +++ b/lib/src/themes/yaru_kubuntu_dark.dart @@ -11,7 +11,7 @@ final _darkColorScheme = ColorScheme.fromSwatch( accentColor: _primaryColor, cardColor: YaruColors.jet, backgroundColor: YaruColors.jet, - errorColor: YaruColors.errorRed, + errorColor: YaruColors.red, brightness: Brightness.dark, ); diff --git a/lib/src/themes/yaru_kubuntu_light.dart b/lib/src/themes/yaru_kubuntu_light.dart index 2e1d324e8..a4984f7f2 100644 --- a/lib/src/themes/yaru_kubuntu_light.dart +++ b/lib/src/themes/yaru_kubuntu_light.dart @@ -11,7 +11,7 @@ final _lightColorScheme = ColorScheme.fromSwatch( accentColor: _primaryColor, cardColor: Colors.white, backgroundColor: YaruColors.porcelain, - errorColor: YaruColors.errorRed, + errorColor: YaruColors.red, brightness: Brightness.light, ); diff --git a/lib/src/themes/yaru_light.dart b/lib/src/themes/yaru_light.dart index bee996c98..08a291936 100644 --- a/lib/src/themes/yaru_light.dart +++ b/lib/src/themes/yaru_light.dart @@ -10,7 +10,7 @@ final _lightColorScheme = ColorScheme.fromSwatch( accentColor: _primaryColor, cardColor: Colors.white, backgroundColor: YaruColors.porcelain, - errorColor: YaruColors.errorRed, + errorColor: YaruColors.red, brightness: Brightness.light, ); diff --git a/lib/src/themes/yaru_lubuntu_dark.dart b/lib/src/themes/yaru_lubuntu_dark.dart index 4c2abb3f0..f6b989f5b 100644 --- a/lib/src/themes/yaru_lubuntu_dark.dart +++ b/lib/src/themes/yaru_lubuntu_dark.dart @@ -11,7 +11,7 @@ final _darkColorScheme = ColorScheme.fromSwatch( accentColor: _primaryColor, cardColor: YaruColors.jet, backgroundColor: YaruColors.jet, - errorColor: YaruColors.errorRed, + errorColor: YaruColors.red, brightness: Brightness.dark, ); diff --git a/lib/src/themes/yaru_lubuntu_light.dart b/lib/src/themes/yaru_lubuntu_light.dart index 1f5775dc1..6a26c406e 100644 --- a/lib/src/themes/yaru_lubuntu_light.dart +++ b/lib/src/themes/yaru_lubuntu_light.dart @@ -11,7 +11,7 @@ final _lightColorScheme = ColorScheme.fromSwatch( accentColor: _primaryColor, cardColor: Colors.white, backgroundColor: YaruColors.porcelain, - errorColor: YaruColors.errorRed, + errorColor: YaruColors.red, brightness: Brightness.light, ); diff --git a/lib/src/themes/yaru_mate_dark.dart b/lib/src/themes/yaru_mate_dark.dart index ef89efefa..4fc44c95d 100644 --- a/lib/src/themes/yaru_mate_dark.dart +++ b/lib/src/themes/yaru_mate_dark.dart @@ -11,7 +11,7 @@ final _darkColorScheme = ColorScheme.fromSwatch( accentColor: _primaryColor, cardColor: YaruColors.jet, backgroundColor: YaruColors.jet, - errorColor: YaruColors.errorRed, + errorColor: YaruColors.red, brightness: Brightness.dark, ); diff --git a/lib/src/themes/yaru_mate_light.dart b/lib/src/themes/yaru_mate_light.dart index 2ef2195cc..6e337918e 100644 --- a/lib/src/themes/yaru_mate_light.dart +++ b/lib/src/themes/yaru_mate_light.dart @@ -11,7 +11,7 @@ final _lightColorScheme = ColorScheme.fromSwatch( accentColor: _primaryColor, cardColor: Colors.white, backgroundColor: YaruColors.porcelain, - errorColor: YaruColors.errorRed, + errorColor: YaruColors.red, brightness: Brightness.light, ); diff --git a/lib/src/themes/yaru_ubuntu_budgie_dark.dart b/lib/src/themes/yaru_ubuntu_budgie_dark.dart index 50c981993..45a6dc631 100644 --- a/lib/src/themes/yaru_ubuntu_budgie_dark.dart +++ b/lib/src/themes/yaru_ubuntu_budgie_dark.dart @@ -11,7 +11,7 @@ final _darkColorScheme = ColorScheme.fromSwatch( accentColor: _primaryColor, cardColor: YaruColors.jet, backgroundColor: YaruColors.jet, - errorColor: YaruColors.errorRed, + errorColor: YaruColors.red, brightness: Brightness.dark, ); diff --git a/lib/src/themes/yaru_ubuntu_budgie_light.dart b/lib/src/themes/yaru_ubuntu_budgie_light.dart index 0086df7ce..390d0fb4f 100644 --- a/lib/src/themes/yaru_ubuntu_budgie_light.dart +++ b/lib/src/themes/yaru_ubuntu_budgie_light.dart @@ -11,7 +11,7 @@ final _lightColorScheme = ColorScheme.fromSwatch( accentColor: _primaryColor, cardColor: Colors.white, backgroundColor: YaruColors.porcelain, - errorColor: YaruColors.errorRed, + errorColor: YaruColors.red, brightness: Brightness.light, ); diff --git a/lib/src/themes/yaru_ubuntu_studio_dark.dart b/lib/src/themes/yaru_ubuntu_studio_dark.dart index 77753ad46..49b7727dd 100644 --- a/lib/src/themes/yaru_ubuntu_studio_dark.dart +++ b/lib/src/themes/yaru_ubuntu_studio_dark.dart @@ -11,7 +11,7 @@ final _darkColorScheme = ColorScheme.fromSwatch( accentColor: _primaryColor, cardColor: YaruColors.jet, backgroundColor: YaruColors.jet, - errorColor: YaruColors.errorRed, + errorColor: YaruColors.red, brightness: Brightness.dark, ); diff --git a/lib/src/themes/yaru_ubuntu_studio_light.dart b/lib/src/themes/yaru_ubuntu_studio_light.dart index 6fe75131d..3e90dd3f2 100644 --- a/lib/src/themes/yaru_ubuntu_studio_light.dart +++ b/lib/src/themes/yaru_ubuntu_studio_light.dart @@ -11,7 +11,7 @@ final _lightColorScheme = ColorScheme.fromSwatch( accentColor: _primaryColor, cardColor: Colors.white, backgroundColor: YaruColors.porcelain, - errorColor: YaruColors.errorRed, + errorColor: YaruColors.red, brightness: Brightness.light, ); diff --git a/lib/src/themes/yaru_xubuntu_dark.dart b/lib/src/themes/yaru_xubuntu_dark.dart index 57c1eb266..18b543acc 100644 --- a/lib/src/themes/yaru_xubuntu_dark.dart +++ b/lib/src/themes/yaru_xubuntu_dark.dart @@ -11,7 +11,7 @@ final _darkColorScheme = ColorScheme.fromSwatch( accentColor: _primaryColor, cardColor: YaruColors.jet, backgroundColor: YaruColors.jet, - errorColor: YaruColors.errorRed, + errorColor: YaruColors.red, brightness: Brightness.dark, ); diff --git a/lib/src/themes/yaru_xubuntu_light.dart b/lib/src/themes/yaru_xubuntu_light.dart index 0eb686822..60138ef1a 100644 --- a/lib/src/themes/yaru_xubuntu_light.dart +++ b/lib/src/themes/yaru_xubuntu_light.dart @@ -11,7 +11,7 @@ final _lightColorScheme = ColorScheme.fromSwatch( accentColor: _primaryColor, cardColor: Colors.white, backgroundColor: YaruColors.porcelain, - errorColor: YaruColors.errorRed, + errorColor: YaruColors.red, brightness: Brightness.light, );