From 8b31c0fe78f275f01cf46eb9b1b177071539d6ae Mon Sep 17 00:00:00 2001 From: cdricms <36056008+cdricms@users.noreply.github.com> Date: Fri, 24 Jul 2026 00:37:49 +0200 Subject: [PATCH] feat(apple): use the brand purple as the app-wide accent color MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The macOS sidebar selection and item icons rendered in the system default blue because the app had no global accent color — SwiftUI's `.tint` doesn't reach the AppKit-backed sidebar. Add an AccentColor asset (the exact sRGB of VniDropColors.brandPurple) and wire ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME so the accent applies at the OS level everywhere, including the sidebar. --- .../AccentColor.colorset/Contents.json | 20 +++++++++++++++++++ apple/VniDrop/UI/Theme/VniDropColors.swift | 4 +++- apple/project.yml | 3 +++ 3 files changed, 26 insertions(+), 1 deletion(-) create mode 100644 apple/VniDrop/Resources/Assets.xcassets/AccentColor.colorset/Contents.json diff --git a/apple/VniDrop/Resources/Assets.xcassets/AccentColor.colorset/Contents.json b/apple/VniDrop/Resources/Assets.xcassets/AccentColor.colorset/Contents.json new file mode 100644 index 0000000..e4c3f7f --- /dev/null +++ b/apple/VniDrop/Resources/Assets.xcassets/AccentColor.colorset/Contents.json @@ -0,0 +1,20 @@ +{ + "colors" : [ + { + "color" : { + "color-space" : "srgb", + "components" : { + "alpha" : "1.000", + "blue" : "0.9685", + "green" : "0.3315", + "red" : "0.6606" + } + }, + "idiom" : "universal" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/apple/VniDrop/UI/Theme/VniDropColors.swift b/apple/VniDrop/UI/Theme/VniDropColors.swift index 3d7c8dd..f811b02 100644 --- a/apple/VniDrop/UI/Theme/VniDropColors.swift +++ b/apple/VniDrop/UI/Theme/VniDropColors.swift @@ -52,7 +52,9 @@ struct VniDropColors { } extension VniDropColors { - /// The single brand accent used app-wide as the SwiftUI tint. + /// The single brand accent used app-wide as the SwiftUI tint. Mirrored by the + /// `AccentColor` asset (the OS-level global accent for the macOS sidebar etc.); + /// keep the two in sync. static let brandPurple = Color.hsl(271, 91, 65) static let light = VniDropColors( diff --git a/apple/project.yml b/apple/project.yml index b819d39..843a363 100644 --- a/apple/project.yml +++ b/apple/project.yml @@ -55,6 +55,9 @@ targets: SWIFT_STRICT_CONCURRENCY: complete ENABLE_USER_SCRIPT_SANDBOXING: NO ASSETCATALOG_COMPILER_APPICON_NAME: AppIcon + # App-wide accent (macOS sidebar selection, default control tints). The + # AccentColor asset mirrors VniDropColors.brandPurple — keep them in sync. + ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME: AccentColor configs: debug: CODE_SIGN_ENTITLEMENTS: VniDrop/Resources/VniDrop.entitlements