mirror of
https://github.com/yattee/yattee.git
synced 2026-07-21 06:42:01 +00:00
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:
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user