From 1792c91be215487051b5313734bc84a9fa56bb46 Mon Sep 17 00:00:00 2001 From: Andrew Blakeslee Moore Date: Sun, 5 Jul 2026 02:15:26 -0700 Subject: [PATCH] nvrsion: Add: Remove teal accent color in dark mode to improve visibility in ios/NucleicRemote/NucleicRemote/Assets.xcassets/AccentColor.colorset/Contents.json and ios/NucleicRemote/NucleicRemote/Views/Theme.swift. Nucleic-Promote: 1 Co-authored-by: Nucleic --- .../AccentColor.colorset/Contents.json | 5 ++++- NucleicRemote/NucleicRemote/Views/Theme.swift | 16 +++++++++++++++- 2 files changed, 19 insertions(+), 2 deletions(-) diff --git a/NucleicRemote/NucleicRemote/Assets.xcassets/AccentColor.colorset/Contents.json b/NucleicRemote/NucleicRemote/Assets.xcassets/AccentColor.colorset/Contents.json index 8e37716..948deb1 100644 --- a/NucleicRemote/NucleicRemote/Assets.xcassets/AccentColor.colorset/Contents.json +++ b/NucleicRemote/NucleicRemote/Assets.xcassets/AccentColor.colorset/Contents.json @@ -1,4 +1,7 @@ { - "colors" : [ { "color" : { "color-space" : "srgb", "components" : { "red" : "0.118", "green" : "0.565", "blue" : "0.553", "alpha" : "1.000" } }, "idiom" : "universal" } ], + "colors" : [ + { "color" : { "color-space" : "srgb", "components" : { "red" : "0.118", "green" : "0.565", "blue" : "0.553", "alpha" : "1.000" } }, "idiom" : "universal" }, + { "appearances" : [ { "appearance" : "luminosity", "value" : "dark" } ], "color" : { "color-space" : "srgb", "components" : { "red" : "0.366", "green" : "0.850", "blue" : "0.834", "alpha" : "1.000" } }, "idiom" : "universal" } + ], "info" : { "author" : "xcode", "version" : 1 } } diff --git a/NucleicRemote/NucleicRemote/Views/Theme.swift b/NucleicRemote/NucleicRemote/Views/Theme.swift index 8406b5f..9da8d5b 100644 --- a/NucleicRemote/NucleicRemote/Views/Theme.swift +++ b/NucleicRemote/NucleicRemote/Views/Theme.swift @@ -142,7 +142,10 @@ struct ResolvedPalette { static func make(_ mode: ColorVisionMode) -> ResolvedPalette { var p = base(mode) - p.accent = Palette.nightSoft(p.accent) + // The accent is the interactive tint (buttons, menus, toggles, links), not a calm + // status hue — night-softening the already-deep teal made it vanish on dark + // backgrounds, so dark mode brightens it instead. + p.accent = Palette.nightBright(p.accent) p.active = Palette.nightSoft(p.active) p.attention = Palette.nightSoft(p.attention) p.success = Palette.nightSoft(p.success) @@ -194,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 {