Chat View Refinement

Nucleic-Session: 4E56990A-96AE-4597-9140-753CB82E769D
Co-authored-by: Nucleic <[email protected]>
This commit is contained in:
2026-07-05 02:11:09 -07:00
co-authored by Nucleic
parent 23208eeee0
commit 78ca912e39
@@ -197,6 +197,17 @@ enum Palette {
Color(UIColor { traits in traits.userInterfaceStyle == .dark ? dark : light }) 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 /// Light mode keeps `base`; dark mode gets a desaturated, dimmed variant — the same
/// night-softening curve as the Mac's `AppPalette.nightSoft`. /// night-softening curve as the Mac's `AppPalette.nightSoft`.
static func nightSoft(_ base: Color) -> Color { static func nightSoft(_ base: Color) -> Color {