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:
Arkadiusz Fal
2026-07-04 23:57:59 +02:00
parent f5b86effd3
commit b47888fe04
25 changed files with 188 additions and 21 deletions

View File

@@ -18,7 +18,7 @@ struct BookmarkCardView: View {
var isCompact: Bool = false
private var accentColor: Color {
appEnvironment?.settingsManager.accentColor.color ?? .accentColor
appEnvironment?.settingsManager.resolvedAccentColor ?? .accentColor
}
private var video: Video {

View File

@@ -28,7 +28,7 @@ struct BookmarkRowView: View {
var loadMoreVideos: LoadMoreVideosCallback? = nil
private var accentColor: Color {
appEnvironment?.settingsManager.accentColor.color ?? .accentColor
appEnvironment?.settingsManager.resolvedAccentColor ?? .accentColor
}
private var isBookmarkValid: Bool {

View File

@@ -15,7 +15,7 @@ struct BookmarkTagsView: View {
var maxVisible: Int = 3
private var accentColor: Color {
appEnvironment?.settingsManager.accentColor.color ?? .accentColor
appEnvironment?.settingsManager.resolvedAccentColor ?? .accentColor
}
private var visibleTags: [String] {

View File

@@ -24,7 +24,7 @@ struct CommentView: View {
private var contentService: ContentService? { appEnvironment?.contentService }
private var instancesManager: InstancesManager? { appEnvironment?.instancesManager }
private var navigationCoordinator: NavigationCoordinator? { appEnvironment?.navigationCoordinator }
private var accentColor: Color { appEnvironment?.settingsManager.accentColor.color ?? .accentColor }
private var accentColor: Color { appEnvironment?.settingsManager.resolvedAccentColor ?? .accentColor }
init(comment: Comment, videoID: String? = nil, source: ContentSource? = nil, isReply: Bool = false) {
self.comment = comment

View File

@@ -19,7 +19,7 @@ struct TagInputView: View {
@FocusState private var textFieldFocused: Bool
private var accentColor: Color {
appEnvironment?.settingsManager.accentColor.color ?? .accentColor
appEnvironment?.settingsManager.resolvedAccentColor ?? .accentColor
}
private let maxTags = 10