mirror of
https://github.com/yattee/yattee.git
synced 2026-07-21 06:42:01 +00:00
Add custom accent color with system color picker
Add a Custom swatch to the appearance settings accent color grid, backed by a hex value stored in settings (synced via iCloud like the rest). iOS uses the native ColorPicker wheel; macOS uses a circular swatch that opens NSColorPanel, since the SwiftUI color well looks out of place among the circles. All accent consumers now read the resolved color through SettingsManager.resolvedAccentColor. The indigo preset is retired from the grid but kept in the enum, so users who selected it keep their color until they pick another one. Claude-Session: https://claude.ai/code/session_0154KH8RAVAvm6iVanhmoW8o
This commit is contained in:
@@ -17,7 +17,7 @@ struct HomeShortcutCardView<StatusIndicator: View>: View {
|
||||
#endif
|
||||
|
||||
private var accentColor: Color {
|
||||
appEnvironment?.settingsManager.accentColor.color ?? .accentColor
|
||||
appEnvironment?.settingsManager.resolvedAccentColor ?? .accentColor
|
||||
}
|
||||
|
||||
let icon: String
|
||||
|
||||
@@ -16,7 +16,7 @@ struct HomeShortcutRowView<StatusIndicator: View>: View {
|
||||
var statusIndicator: StatusIndicator?
|
||||
|
||||
private var accentColor: Color {
|
||||
appEnvironment?.settingsManager.accentColor.color ?? .accentColor
|
||||
appEnvironment?.settingsManager.resolvedAccentColor ?? .accentColor
|
||||
}
|
||||
|
||||
init(
|
||||
|
||||
@@ -19,7 +19,7 @@ struct HomeShortcutStyleView: View {
|
||||
|
||||
/// The user's accent color, used by the Accent palette (uniform fill).
|
||||
private var accentColor: Color {
|
||||
appEnvironment?.settingsManager.accentColor.color ?? .accentColor
|
||||
appEnvironment?.settingsManager.resolvedAccentColor ?? .accentColor
|
||||
}
|
||||
|
||||
/// Called after any value changes so the owner persists immediately. The
|
||||
|
||||
@@ -34,7 +34,7 @@ struct HomeView: View {
|
||||
private var settingsManager: SettingsManager? { appEnvironment?.settingsManager }
|
||||
|
||||
private var accentColor: Color {
|
||||
appEnvironment?.settingsManager.accentColor.color ?? .accentColor
|
||||
appEnvironment?.settingsManager.resolvedAccentColor ?? .accentColor
|
||||
}
|
||||
|
||||
#if !os(tvOS)
|
||||
@@ -408,7 +408,7 @@ struct HomeView: View {
|
||||
private func colorfulColor(atPosition position: Int) -> Color {
|
||||
let palette = settingsManager?.homeShortcutColorfulPalette ?? .accent
|
||||
let customHex = settingsManager?.homeShortcutCustomPaletteColors ?? []
|
||||
let accentColor = settingsManager?.accentColor.color ?? .accentColor
|
||||
let accentColor = settingsManager?.resolvedAccentColor ?? .accentColor
|
||||
return HomeShortcutColorfulPalette.color(forPosition: position, palette: palette, customHex: customHex, accentColor: accentColor)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user