From 411a757cdf3686f130c807624d9b6b607b87bfb8 Mon Sep 17 00:00:00 2001 From: Mitchell Hashimoto Date: Mon, 29 Jan 2024 22:23:06 -0800 Subject: [PATCH] macos: fix uikit build, NSColor is not available --- macos/Sources/Ghostty/Ghostty.Config.swift | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/macos/Sources/Ghostty/Ghostty.Config.swift b/macos/Sources/Ghostty/Ghostty.Config.swift index df9df686c..fa4b1f4e0 100644 --- a/macos/Sources/Ghostty/Ghostty.Config.swift +++ b/macos/Sources/Ghostty/Ghostty.Config.swift @@ -262,10 +262,15 @@ extension Ghostty { // This isn't actually a configurable value currently but it could be done day. // We put it here because it is a color that changes depending on the configuration. var splitDividerColor: Color { + #if canImport(AppKit) let backgroundColor = NSColor(backgroundColor) let isLightBackground = backgroundColor.isLightColor let newColor = isLightBackground ? backgroundColor.shadow(withLevel: 0.1) : backgroundColor.shadow(withLevel: 0.4) return Color(nsColor: newColor ?? .gray.withAlphaComponent(0.5)) + #else + // I don't know how to do the above with UIKit + return .gray + #endif } } }