redid logic on the shellview selection

fixed the colours being unreadable sometimes on title bar of the shellview
luminance ratio func
forcedismissdisconnectedalert is now in handler
This commit is contained in:
neon443
2025-09-03 20:33:19 +01:00
parent a71c994103
commit 7e0a02fad3
7 changed files with 66 additions and 51 deletions

View File

@@ -80,4 +80,12 @@ extension SwiftTerm.Color {
let b = Double(blue)/65535
return (0.2126*r + 0.7152*g + 0.0722*b)
}
func luminanceRatio(with other: SwiftTerm.Color) -> Double {
if self.luminance > other.luminance {
return (self.luminance + 0.05) / (other.luminance + 0.05)
} else {
return (other.luminance + 0.05) / (self.luminance + 0.05)
}
}
}