Add position-based colorful Home shortcut palettes

Colorful shortcut cards now color by grid position instead of shortcut
identity, so colors stay in the same slot when shortcuts are reordered.

Adds a Palette option (Classic default, plus Sunset, Meadow, Berry,
Grape) and a Custom palette with a swatch-list editor (ColorPicker + hex
fields) and a switchable comma-separated text field. Color is resolved
per position and wraps by palette length, wired via a new
homeShortcutColorfulColor environment value and a Color(hex:) extension.
This commit is contained in:
Arkadiusz Fal
2026-05-28 23:26:05 +02:00
parent bcd4206c55
commit 486024834d
10 changed files with 596 additions and 51 deletions

View File

@@ -10,6 +10,8 @@ import SwiftUI
struct HomeShortcutCardView<StatusIndicator: View>: View {
@Environment(\.appEnvironment) private var appEnvironment
@Environment(\.dynamicTypeSize) private var dynamicTypeSize
/// Position-resolved colorful color; when set it overrides `colorfulColor`.
@Environment(\.homeShortcutColorfulColor) private var positionColorfulColor
#if os(tvOS)
@Environment(\.isFocused) private var isFocused
#endif
@@ -67,7 +69,7 @@ struct HomeShortcutCardView<StatusIndicator: View>: View {
}
private var fillColor: Color {
cardStyle == .colorful ? colorfulColor : accentColor
cardStyle == .colorful ? (positionColorfulColor ?? colorfulColor) : accentColor
}
private var iconColor: Color {