From 78ca912e39895252a317ef33eaf22bd41e8f3b4b Mon Sep 17 00:00:00 2001 From: Andrew Blakeslee Moore Date: Sun, 5 Jul 2026 02:11:09 -0700 Subject: [PATCH] Chat View Refinement Nucleic-Session: 4E56990A-96AE-4597-9140-753CB82E769D Co-authored-by: Nucleic --- NucleicRemote/NucleicRemote/Views/Theme.swift | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/NucleicRemote/NucleicRemote/Views/Theme.swift b/NucleicRemote/NucleicRemote/Views/Theme.swift index fa9ff7a..9da8d5b 100644 --- a/NucleicRemote/NucleicRemote/Views/Theme.swift +++ b/NucleicRemote/NucleicRemote/Views/Theme.swift @@ -197,6 +197,17 @@ enum Palette { Color(UIColor { traits in traits.userInterfaceStyle == .dark ? dark : light }) } + /// The inverse of `nightSoft`, for the interactive accent: light mode keeps `base`; dark + /// mode gets a brighter, lightly desaturated variant so the tint stays legible against + /// deep backgrounds and glass instead of sinking into them. + static func nightBright(_ base: Color) -> Color { + let ui = UIColor(base) + var h: CGFloat = 0, s: CGFloat = 0, b: CGFloat = 0, a: CGFloat = 0 + guard ui.getHue(&h, saturation: &s, brightness: &b, alpha: &a) else { return base } + let dark = UIColor(hue: h, saturation: s * 0.72, brightness: max(b, 0.85), alpha: a) + return dynamic(light: ui, dark: dark) + } + /// Light mode keeps `base`; dark mode gets a desaturated, dimmed variant — the same /// night-softening curve as the Mac's `AppPalette.nightSoft`. static func nightSoft(_ base: Color) -> Color {