refactor: Simplify AppPalette color definitions and gradients for improved readability
This commit is contained in:
+78
-96
@@ -25,70 +25,6 @@ class AppPalette extends ThemeExtension<AppPalette> {
|
|||||||
Colors.orange,
|
Colors.orange,
|
||||||
];
|
];
|
||||||
|
|
||||||
static const Gradient _darkBackdropGradient = LinearGradient(
|
|
||||||
colors: <Color>[Color(0xFF191A1D), Color(0xFF222326), Color(0xFF101114)],
|
|
||||||
begin: Alignment.topLeft,
|
|
||||||
end: Alignment.bottomRight,
|
|
||||||
);
|
|
||||||
|
|
||||||
static const Gradient _lightBackdropGradient = LinearGradient(
|
|
||||||
colors: <Color>[Color(0xFFFFFFFF), Color(0xFFF2F4F6), Color(0xFFECEFF1)],
|
|
||||||
begin: Alignment.topLeft,
|
|
||||||
end: Alignment.bottomRight,
|
|
||||||
);
|
|
||||||
|
|
||||||
static const Color _darkDrawerBackground = Color.fromARGB(255, 30, 31, 35);
|
|
||||||
static const Color _lightDrawerBackground = Color(0xFFF7F9FA);
|
|
||||||
static const Color _darkCardBackground = Color.fromRGBO(24, 25, 26, 1);
|
|
||||||
static const Color _lightCardBackground = Color(0xFFFFFFFF);
|
|
||||||
static const Color _darkSurfaceElevated = Color(0xFF303134);
|
|
||||||
static const Color _lightSurfaceElevated = Color(0xFFF0F2F4);
|
|
||||||
static const Color _darkBorder = Color.fromRGBO(255, 255, 255, 0.12);
|
|
||||||
static const Color _lightBorder = Color.fromRGBO(15, 23, 32, 0.06);
|
|
||||||
static const Color _darkBorderMuted = Color.fromRGBO(255, 255, 255, 0.08);
|
|
||||||
static const Color _lightBorderMuted = Color.fromRGBO(15, 23, 32, 0.03);
|
|
||||||
static const Color _darkTextPrimary = Colors.white;
|
|
||||||
static const Color _lightTextPrimary = Color(0xFF0F1720);
|
|
||||||
static const Color _darkTextSecondary = Colors.white70;
|
|
||||||
static const Color _lightTextSecondary = Color(0xFF374151);
|
|
||||||
static const Color _darkTextOnSurfaceDark = Colors.black87;
|
|
||||||
static const Color _lightTextOnSurfaceDark = Colors.black87;
|
|
||||||
static const Color _darkTextMuted = Colors.white54;
|
|
||||||
static const Color _lightTextMuted = Color(0xFF6B7280);
|
|
||||||
static const Color _darkTextDisabled = Colors.white24;
|
|
||||||
static const Color _lightTextDisabled = Color(0xFFBDBDBD);
|
|
||||||
static const Color _darkTextHint = Color.fromRGBO(255, 255, 255, 0.30);
|
|
||||||
static const Color _lightTextHint = Color.fromRGBO(15, 23, 32, 0.30);
|
|
||||||
static const Color _darkFill = Color.fromRGBO(255, 255, 255, 0.05);
|
|
||||||
static const Color _lightFill = Color.fromRGBO(15, 23, 32, 0.02);
|
|
||||||
static const Color _darkHover = Color.fromRGBO(255, 255, 255, 0.10);
|
|
||||||
static const Color _lightHover = Color.fromRGBO(15, 23, 32, 0.04);
|
|
||||||
static const Color _darkShadowSoft = Color.fromRGBO(0, 0, 0, 0.25);
|
|
||||||
static const Color _lightShadowSoft = Color.fromRGBO(0, 0, 0, 0.08);
|
|
||||||
static const Color _darkShadowDim = Color.fromARGB(54, 0, 0, 0);
|
|
||||||
static const Color _lightShadowDim = Color.fromARGB(40, 0, 0, 0);
|
|
||||||
static const Color _darkAccent = Colors.amber;
|
|
||||||
static const Color _lightAccent = Colors.blue;
|
|
||||||
static const Color _darkTextOnAccent = Colors.black;
|
|
||||||
static const Color _lightTextOnAccent = Colors.white;
|
|
||||||
static const Color _darkOverlay = Color.fromARGB(140, 0, 0, 0);
|
|
||||||
static const Color _lightOverlay = Color.fromARGB(120, 0, 0, 0);
|
|
||||||
static const Color _transparent = Colors.transparent;
|
|
||||||
static const Color _darkDragTargetBorder = Color(0xFF42A5F5);
|
|
||||||
static const Color _lightDragTargetBorder = Color(0xFF1565C0);
|
|
||||||
static const Color _darkSyncPreparing = Color.fromARGB(255, 165, 165, 165);
|
|
||||||
static const Color _lightSyncPreparing = Color.fromARGB(255, 120, 120, 120);
|
|
||||||
static const Color _darkSyncEncrypting = Color.fromARGB(255, 109, 191, 255);
|
|
||||||
static const Color _lightSyncEncrypting = Color.fromARGB(255, 2, 136, 209);
|
|
||||||
static const Color _darkSyncUploading = Color.fromARGB(255, 98, 190, 255);
|
|
||||||
static const Color _lightSyncUploading = Color.fromARGB(255, 2, 119, 189);
|
|
||||||
static const Color _darkSyncWaiting = Color.fromARGB(255, 150, 150, 150);
|
|
||||||
static const Color _lightSyncWaiting = Color.fromARGB(255, 150, 150, 150);
|
|
||||||
static const Color _darkSyncDecrypting = Color.fromARGB(255, 154, 194, 112);
|
|
||||||
static const Color _lightSyncDecrypting = Color.fromARGB(255, 76, 175, 80);
|
|
||||||
static const Color _darkSuccess = Colors.green;
|
|
||||||
static const Color _lightSuccess = Colors.green;
|
|
||||||
|
|
||||||
const AppPalette({
|
const AppPalette({
|
||||||
required this.backdropGradient,
|
required this.backdropGradient,
|
||||||
required this.drawerBackground,
|
required this.drawerBackground,
|
||||||
@@ -280,42 +216,88 @@ class AppPalette extends ThemeExtension<AppPalette> {
|
|||||||
final bool isLight = brightness == Brightness.light;
|
final bool isLight = brightness == Brightness.light;
|
||||||
return AppPalette(
|
return AppPalette(
|
||||||
backdropGradient: isLight
|
backdropGradient: isLight
|
||||||
? _lightBackdropGradient
|
? const LinearGradient(
|
||||||
: _darkBackdropGradient,
|
colors: <Color>[
|
||||||
|
Color(0xFFFFFFFF),
|
||||||
|
Color(0xFFF2F4F6),
|
||||||
|
Color(0xFFECEFF1),
|
||||||
|
],
|
||||||
|
begin: Alignment.topLeft,
|
||||||
|
end: Alignment.bottomRight,
|
||||||
|
)
|
||||||
|
: const LinearGradient(
|
||||||
|
colors: <Color>[
|
||||||
|
Color(0xFF191A1D),
|
||||||
|
Color(0xFF222326),
|
||||||
|
Color(0xFF101114),
|
||||||
|
],
|
||||||
|
begin: Alignment.topLeft,
|
||||||
|
end: Alignment.bottomRight,
|
||||||
|
),
|
||||||
drawerBackground: isLight
|
drawerBackground: isLight
|
||||||
? _lightDrawerBackground
|
? const Color(0xFFF7F9FA)
|
||||||
: _darkDrawerBackground,
|
: const Color.fromARGB(255, 30, 31, 35),
|
||||||
cardBackground: isLight ? _lightCardBackground : _darkCardBackground,
|
cardBackground: isLight
|
||||||
|
? const Color(0xFFFFFFFF)
|
||||||
|
: const Color.fromRGBO(24, 25, 26, 1),
|
||||||
categoryColors: defaultCategoryColors,
|
categoryColors: defaultCategoryColors,
|
||||||
surfaceElevated: isLight ? _lightSurfaceElevated : _darkSurfaceElevated,
|
surfaceElevated: isLight
|
||||||
border: isLight ? _lightBorder : _darkBorder,
|
? const Color(0xFFF0F2F4)
|
||||||
borderMuted: isLight ? _lightBorderMuted : _darkBorderMuted,
|
: const Color(0xFF303134),
|
||||||
accent: seedColor ?? (isLight ? _lightAccent : _darkAccent),
|
border: isLight
|
||||||
textPrimary: isLight ? _lightTextPrimary : _darkTextPrimary,
|
? const Color.fromRGBO(15, 23, 32, 0.06)
|
||||||
textSecondary: isLight ? _lightTextSecondary : _darkTextSecondary,
|
: const Color.fromRGBO(255, 255, 255, 0.12),
|
||||||
textOnSurfaceDark: isLight
|
borderMuted: isLight
|
||||||
? _lightTextOnSurfaceDark
|
? const Color.fromRGBO(15, 23, 32, 0.03)
|
||||||
: _darkTextOnSurfaceDark,
|
: const Color.fromRGBO(255, 255, 255, 0.08),
|
||||||
textMuted: isLight ? _lightTextMuted : _darkTextMuted,
|
accent:
|
||||||
textDisabled: isLight ? _lightTextDisabled : _darkTextDisabled,
|
seedColor ??
|
||||||
textHint: isLight ? _lightTextHint : _darkTextHint,
|
(isLight
|
||||||
fill: isLight ? _lightFill : _darkFill,
|
? AppPalette.lightDefaultThemeSeedColor
|
||||||
hover: isLight ? _lightHover : _darkHover,
|
: AppPalette.darkDefaultThemeSeedColor),
|
||||||
shadowSoft: isLight ? _lightShadowSoft : _darkShadowSoft,
|
textPrimary: isLight ? const Color(0xFF0F1720) : Colors.white,
|
||||||
shadowDim: isLight ? _lightShadowDim : _darkShadowDim,
|
textSecondary: isLight ? const Color(0xFF374151) : Colors.white70,
|
||||||
|
textOnSurfaceDark: isLight ? Colors.black87 : Colors.black87,
|
||||||
|
textMuted: isLight ? const Color(0xFF6B7280) : Colors.white54,
|
||||||
|
textDisabled: isLight ? const Color(0xFFBDBDBD) : Colors.white24,
|
||||||
|
textHint: isLight
|
||||||
|
? const Color.fromRGBO(15, 23, 32, 0.30)
|
||||||
|
: const Color.fromRGBO(255, 255, 255, 0.30),
|
||||||
|
fill: isLight
|
||||||
|
? const Color.fromRGBO(15, 23, 32, 0.02)
|
||||||
|
: const Color.fromRGBO(255, 255, 255, 0.05),
|
||||||
|
hover: isLight
|
||||||
|
? const Color.fromRGBO(15, 23, 32, 0.04)
|
||||||
|
: const Color.fromRGBO(255, 255, 255, 0.10),
|
||||||
|
shadowSoft: isLight
|
||||||
|
? const Color.fromRGBO(0, 0, 0, 0.08)
|
||||||
|
: const Color.fromRGBO(0, 0, 0, 0.25),
|
||||||
|
shadowDim: isLight
|
||||||
|
? const Color.fromARGB(40, 0, 0, 0)
|
||||||
|
: const Color.fromARGB(54, 0, 0, 0),
|
||||||
destructiveAccent: Colors.redAccent,
|
destructiveAccent: Colors.redAccent,
|
||||||
textOnAccent: isLight ? _lightTextOnAccent : _darkTextOnAccent,
|
textOnAccent: isLight ? Colors.white : Colors.black,
|
||||||
overlay: isLight ? _lightOverlay : _darkOverlay,
|
overlay: isLight
|
||||||
transparent: _transparent,
|
? const Color.fromARGB(120, 0, 0, 0)
|
||||||
|
: const Color.fromARGB(140, 0, 0, 0),
|
||||||
|
transparent: Colors.transparent,
|
||||||
dragTargetBorder: isLight
|
dragTargetBorder: isLight
|
||||||
? _lightDragTargetBorder
|
? const Color(0xFF1565C0)
|
||||||
: _darkDragTargetBorder,
|
: const Color(0xFF42A5F5),
|
||||||
syncPreparing: isLight ? _lightSyncPreparing : _darkSyncPreparing,
|
syncPreparing: isLight
|
||||||
syncEncrypting: isLight ? _lightSyncEncrypting : _darkSyncEncrypting,
|
? const Color.fromARGB(255, 120, 120, 120)
|
||||||
syncUploading: isLight ? _lightSyncUploading : _darkSyncUploading,
|
: const Color.fromARGB(255, 165, 165, 165),
|
||||||
syncWaiting: isLight ? _lightSyncWaiting : _darkSyncWaiting,
|
syncEncrypting: isLight
|
||||||
syncDecrypting: isLight ? _lightSyncDecrypting : _darkSyncDecrypting,
|
? const Color.fromARGB(255, 2, 136, 209)
|
||||||
success: isLight ? _lightSuccess : _darkSuccess,
|
: const Color.fromARGB(255, 109, 191, 255),
|
||||||
|
syncUploading: isLight
|
||||||
|
? const Color.fromARGB(255, 2, 119, 189)
|
||||||
|
: const Color.fromARGB(255, 98, 190, 255),
|
||||||
|
syncWaiting: const Color.fromARGB(255, 150, 150, 150),
|
||||||
|
syncDecrypting: isLight
|
||||||
|
? const Color.fromARGB(255, 76, 175, 80)
|
||||||
|
: const Color.fromARGB(255, 154, 194, 112),
|
||||||
|
success: Colors.green,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user