Update colors buttons in non minimalistic and lock screen

This commit is contained in:
Hariharan Mudaliar 2026-01-22 17:21:53 +05:30
commit 12d4a0b726
No known key found for this signature in database
GPG key ID: 025583EB0BE5640E
3 changed files with 58 additions and 9 deletions

View file

@ -845,6 +845,45 @@ class MusicManager: ObservableObject {
}
}
// MARK: - Media Branding
extension MusicManager {
var brandAccentColor: Color {
Self.brandAccentColor(for: Defaults[.mediaController], bundleIdentifier: bundleIdentifier)
}
private static func brandAccentColor(for controller: MediaControllerType, bundleIdentifier: String?) -> Color {
switch controller {
case .appleMusic:
return appleMusicPink
case .spotify:
return spotifyGreen
case .nowPlaying:
if let bundleIdentifier,
let bundleColor = brandAccentColor(forBundleIdentifier: bundleIdentifier) {
return bundleColor
}
fallthrough
case .youtubeMusic:
return .accentColor
}
}
private static func brandAccentColor(forBundleIdentifier bundleIdentifier: String) -> Color? {
switch bundleIdentifier {
case "com.apple.Music":
return appleMusicPink
case "com.spotify.client":
return spotifyGreen
default:
return nil
}
}
private static let appleMusicPink = Color(red: 0.999, green: 0.171, blue: 0.331)
private static let spotifyGreen = Color(red: 0.0, green: 0.857, blue: 0.302)
}
// MARK: - Album Art Flip Helper
private struct AlbumArtFlipModifier: ViewModifier {