Created
August 16, 2026 21:24
-
-
Save SoCuul/ad4fabce8e55c55adac17f25094781dc to your computer and use it in GitHub Desktop.
Get macOS 26+ icon tint color
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| struct AppearanceTintColor { | |
| @objc protocol IconAppearanceConfiguring { | |
| var iconAppearanceTheme: UInt32 { get } | |
| var iconTintColorName: UInt32 { get } | |
| var otherIconTintColor: CGColor? { get } | |
| var resolvedIconTintColor: NSColor? { get } | |
| } | |
| func config() -> IconAppearanceConfiguring? { | |
| let workspace = NSWorkspace.shared as NSObject | |
| let key = "currentIconAppearanceConfiguration" | |
| guard workspace.responds(to: NSSelectorFromString(key)) else { return nil } | |
| return unsafeBitCast(workspace.value(forKey: key) as AnyObject?, to: IconAppearanceConfiguring?.self) | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment