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 <[email protected]>
This commit is contained in:
@@ -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 }
|
"info" : { "author" : "xcode", "version" : 1 }
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -142,7 +142,10 @@ struct ResolvedPalette {
|
|||||||
|
|
||||||
static func make(_ mode: ColorVisionMode) -> ResolvedPalette {
|
static func make(_ mode: ColorVisionMode) -> ResolvedPalette {
|
||||||
var p = base(mode)
|
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.active = Palette.nightSoft(p.active)
|
||||||
p.attention = Palette.nightSoft(p.attention)
|
p.attention = Palette.nightSoft(p.attention)
|
||||||
p.success = Palette.nightSoft(p.success)
|
p.success = Palette.nightSoft(p.success)
|
||||||
@@ -194,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 {
|
||||||
|
|||||||
Reference in New Issue
Block a user