Chat View Refinement
Nucleic-Session: 4E56990A-96AE-4597-9140-753CB82E769D Co-authored-by: Nucleic <[email protected]>
This commit is contained in:
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user