This commit is contained in:
Forrest 2026-07-29 14:14:18 -04:00
commit d205277cdd
182 changed files with 22978 additions and 0 deletions

24
lib/theme/accent.dart Normal file
View file

@ -0,0 +1,24 @@
import 'package:flutter/widgets.dart';
import 'package:flutter_riverpod/flutter_riverpod.dart';
import 'tokens.dart';
/// Holds the current accent color — the "hero" of Ratune's aesthetic.
///
/// In the `dynamic` theme this is extracted from the playing track's album
/// art and boosted for readability in OKLab space (Ratune `color.rs:11-64`),
/// then interpolated toward over ~400ms. Phase 1 just exposes the default and
/// a setter; the extraction + animation land in Phase 2 with playback.
class AccentNotifier extends StateNotifier<Color> {
AccentNotifier() : super(RatuneColors.accentDefault);
/// Snap to a new accent (e.g. from album-art extraction).
void set(Color color) => state = color;
/// Return to the fixed default (e.g. no art / `static` theme).
void reset() => state = RatuneColors.accentDefault;
}
final accentProvider = StateNotifierProvider<AccentNotifier, Color>(
(ref) => AccentNotifier(),
);