macos: plumb through the split divider color

This commit is contained in:
Mitchell Hashimoto
2024-01-29 21:32:10 -08:00
parent 375df57155
commit 18dfb642f5
5 changed files with 31 additions and 13 deletions

View File

@@ -258,5 +258,14 @@ extension Ghostty {
blue: blue / 255
)
}
// 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 {
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))
}
}
}