Add theme picker with 7 color schemes

- Teal: Cool cyan and teal tones (default)
- Orbit: Bold navy and orange
- Retro: Classic columbia blue
- Clutch: Championship red and gold
- Monochrome: Clean grayscale aesthetic
- Sunset: Warm oranges and purples
- Midnight: Deep blues and gold

Features:
- Theme selection persisted via UserDefaults
- ThemeManager singleton for app-wide theme state
- All Theme colors now dynamically switch based on selection
- Settings UI shows color preview circles for each theme

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
Trey t
2026-01-08 09:49:04 -06:00
parent 5bbfd30a70
commit 4eca0c920c
3 changed files with 324 additions and 28 deletions

View File

@@ -12,6 +12,12 @@ final class SettingsViewModel {
// MARK: - User Preferences (persisted via UserDefaults)
var selectedTheme: AppTheme {
didSet {
ThemeManager.shared.currentTheme = selectedTheme
}
}
var selectedSports: Set<Sport> {
didSet { savePreferences() }
}
@@ -41,6 +47,9 @@ final class SettingsViewModel {
// Load from UserDefaults using local variables first
let defaults = UserDefaults.standard
// Theme
self.selectedTheme = ThemeManager.shared.currentTheme
// Selected sports
if let sportStrings = defaults.stringArray(forKey: "selectedSports") {
self.selectedSports = Set(sportStrings.compactMap { Sport(rawValue: $0) })
@@ -93,6 +102,7 @@ final class SettingsViewModel {
}
func resetToDefaults() {
selectedTheme = .teal
selectedSports = Set(Sport.supported)
maxDrivingHoursPerDay = 8
maxTripOptions = 10