Match bonsplit chrome to Ghostty theme
This commit is contained in:
parent
42f1933c80
commit
e90b45f75e
2 changed files with 26 additions and 20 deletions
|
|
@ -332,28 +332,10 @@ final class Workspace: Identifiable, ObservableObject {
|
|||
bonsplitAppearance(from: config.backgroundColor)
|
||||
}
|
||||
|
||||
private static func usesDarkChrome(
|
||||
appAppearance: NSAppearance? = NSApp?.effectiveAppearance
|
||||
) -> Bool {
|
||||
guard let appAppearance else { return false }
|
||||
return appAppearance.bestMatch(from: [.darkAqua, .aqua]) == .darkAqua
|
||||
}
|
||||
|
||||
private static func resolvedChromeBackgroundHex(
|
||||
from backgroundColor: NSColor,
|
||||
appAppearance: NSAppearance? = NSApp?.effectiveAppearance
|
||||
) -> String? {
|
||||
guard usesDarkChrome(appAppearance: appAppearance) else { return nil }
|
||||
return backgroundColor.hexString()
|
||||
}
|
||||
|
||||
private static func resolvedChromeColors(
|
||||
nonisolated static func resolvedChromeColors(
|
||||
from backgroundColor: NSColor
|
||||
) -> BonsplitConfiguration.Appearance.ChromeColors {
|
||||
guard let backgroundHex = resolvedChromeBackgroundHex(from: backgroundColor) else {
|
||||
return .init()
|
||||
}
|
||||
return .init(backgroundHex: backgroundHex)
|
||||
.init(backgroundHex: backgroundColor.hexString())
|
||||
}
|
||||
|
||||
private static func bonsplitAppearance(from backgroundColor: NSColor) -> BonsplitConfiguration.Appearance {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue