mirror of
https://github.com/FBukovina/Atoll.git
synced 2026-10-27 15:14:33 +00:00
Update colors buttons in non minimalistic and lock screen
This commit is contained in:
parent
c846ad530b
commit
12d4a0b726
3 changed files with 58 additions and 9 deletions
|
|
@ -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 {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue