mirror of
https://github.com/ghostty-org/ghostty.git
synced 2025-08-02 14:57:31 +03:00
macos: fix uikit build, NSColor is not available
This commit is contained in:
@ -262,10 +262,15 @@ extension Ghostty {
|
|||||||
// This isn't actually a configurable value currently but it could be done day.
|
// 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.
|
// We put it here because it is a color that changes depending on the configuration.
|
||||||
var splitDividerColor: Color {
|
var splitDividerColor: Color {
|
||||||
|
#if canImport(AppKit)
|
||||||
let backgroundColor = NSColor(backgroundColor)
|
let backgroundColor = NSColor(backgroundColor)
|
||||||
let isLightBackground = backgroundColor.isLightColor
|
let isLightBackground = backgroundColor.isLightColor
|
||||||
let newColor = isLightBackground ? backgroundColor.shadow(withLevel: 0.1) : backgroundColor.shadow(withLevel: 0.4)
|
let newColor = isLightBackground ? backgroundColor.shadow(withLevel: 0.1) : backgroundColor.shadow(withLevel: 0.4)
|
||||||
return Color(nsColor: newColor ?? .gray.withAlphaComponent(0.5))
|
return Color(nsColor: newColor ?? .gray.withAlphaComponent(0.5))
|
||||||
|
#else
|
||||||
|
// I don't know how to do the above with UIKit
|
||||||
|
return .gray
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user