Skip to content

Commit

Permalink
fix: not using dark color when auto coloring is off
Browse files Browse the repository at this point in the history
  • Loading branch information
MSOB7YY committed Sep 17, 2024
1 parent e757eaf commit b148aa6
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 9 deletions.
18 changes: 10 additions & 8 deletions lib/controller/current_color.dart
Original file line number Diff line number Diff line change
Expand Up @@ -37,18 +37,20 @@ class CurrentColor {
bool get _shouldUpdateFromDeviceWallpaper => settings.pickColorsFromDeviceWallpaper.value;

Color get miniplayerColor => settings.forceMiniplayerTrackColor.valueR ? _namidaColorMiniplayer.valueR ?? color : color;
Color get color => _namidaColor.valueR.color;
List<Color> get palette => _namidaColor.valueR.palette;
Color get color => _namidaColor.valueR?.color ?? _defaultNamidaColor.color;
List<Color> get palette => _namidaColor.valueR?.palette ?? _defaultNamidaColor.palette;
Color get currentColorScheme => _colorSchemeOfSubPages.valueR ?? color;
int get colorAlpha => namida.isDarkMode ? 200 : 120;

final _namidaColorMiniplayer = Rxn<Color>();

late final Rx<NamidaColor> _namidaColor = NamidaColor(
used: playerStaticColor,
mix: playerStaticColor,
palette: [playerStaticColor],
).obs;
final _namidaColor = Rxn<NamidaColor>();

NamidaColor get _defaultNamidaColor => NamidaColor(
used: playerStaticColor,
mix: playerStaticColor,
palette: [playerStaticColor],
);

final _colorSchemeOfSubPages = Rxn<Color>();

Expand Down Expand Up @@ -102,7 +104,7 @@ class CurrentColor {

void updateColorAfterThemeModeChange() {
if (settings.autoColor.value) {
final nc = _namidaColor.value;
final nc = _namidaColor.value ?? _defaultNamidaColor;
_namidaColor.value = NamidaColor(
used: nc.color.withAlpha(colorAlpha),
mix: nc.mix,
Expand Down
2 changes: 1 addition & 1 deletion pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name: namida
description: A Beautiful and Feature-rich Music Player, With YouTube & Video Support Built in Flutter
publish_to: "none"
version: 4.4.17-beta+240917222
version: 4.4.2-beta+240917225

environment:
sdk: ">=3.4.0 <4.0.0"
Expand Down

0 comments on commit b148aa6

Please sign in to comment.