Nucleic: scope lavender accent to Nucleic Control projects only
Make the lavender/purple accent a signal that you are operating inside a Nucleic Control project; every other project keeps the standard teal tint. - AppPalette.make gains a 'controlled' flag. When true (and in standard color-vision mode) it swaps the teal accent for a cached, nightSoftened lavender (controlAccent); otherwise it returns the unchanged palette. - RootView derives 'controlled' from store.contextProjectID -> Project.isNucleicControlled, so the tint follows the active project and reverts to teal on the home dashboard / non-control projects. Tracked through Observation, so it flips live as you navigate. - Color-vision (deut/prot/trit) palettes keep their tuned accents; the swap only applies in standard mode. - iOS NucleicRemote reverts to the standard teal: the remote has no Nucleic Control concept (the wire protocol doesn't carry it), so it can't distinguish controlled projects and stays teal everywhere. Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
This commit is contained in:
@@ -1,14 +1,4 @@
|
|||||||
{
|
{
|
||||||
"colors" : [
|
"colors" : [ { "color" : { "color-space" : "srgb", "components" : { "red" : "0.118", "green" : "0.565", "blue" : "0.553", "alpha" : "1.000" } }, "idiom" : "universal" } ],
|
||||||
{
|
|
||||||
"color" : { "color-space" : "srgb", "components" : { "red" : "0.450", "green" : "0.320", "blue" : "0.820", "alpha" : "1.000" } },
|
|
||||||
"idiom" : "universal"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"appearances" : [ { "appearance" : "luminosity", "value" : "dark" } ],
|
|
||||||
"color" : { "color-space" : "srgb", "components" : { "red" : "0.660", "green" : "0.550", "blue" : "0.950", "alpha" : "1.000" } },
|
|
||||||
"idiom" : "universal"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"info" : { "author" : "xcode", "version" : 1 }
|
"info" : { "author" : "xcode", "version" : 1 }
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,21 +1,12 @@
|
|||||||
import SwiftUI
|
import SwiftUI
|
||||||
import UIKit
|
|
||||||
import NucleicProtocol
|
import NucleicProtocol
|
||||||
|
|
||||||
/// The mobile mirror of the Mac's design language (AppTheme/AppPalette on desktop): a
|
/// The mobile mirror of the Mac's design language (AppTheme/AppPalette on desktop): a deep
|
||||||
/// lavender/purple accent, the same categorical status palette, and the same status→color
|
/// teal accent, the same categorical status palette, and the same status→color mapping
|
||||||
/// mapping refined by turn disposition — so the two devices read identically. Pure SwiftUI
|
/// refined by turn disposition — so the two devices read identically. Pure SwiftUI Color
|
||||||
/// Color, adapting to light/dark via the system.
|
/// (no AppKit), adapting to light/dark via the system.
|
||||||
enum Palette {
|
enum Palette {
|
||||||
/// Lavender/purple accent with a separate shade per appearance: a deep violet in light
|
static let accent = Color(red: 0.04, green: 0.52, blue: 0.50) // deep teal
|
||||||
/// (white labels read at ~5.4:1) and a brighter lavender in dark, so it lifts off the
|
|
||||||
/// near-black background instead of muddying into it. Mirrors the Mac's appearance-aware
|
|
||||||
/// accent (AppPalette, nightSoftened for dark).
|
|
||||||
static let accent = Color(uiColor: UIColor { trait in
|
|
||||||
trait.userInterfaceStyle == .dark
|
|
||||||
? UIColor(red: 0.66, green: 0.55, blue: 0.95, alpha: 1) // brighter lavender — dark mode
|
|
||||||
: UIColor(red: 0.45, green: 0.32, blue: 0.82, alpha: 1) // deep violet — light mode
|
|
||||||
})
|
|
||||||
static let active = Color(red: 0.20, green: 0.55, blue: 0.95) // blue
|
static let active = Color(red: 0.20, green: 0.55, blue: 0.95) // blue
|
||||||
static let attention = Color(red: 1.00, green: 0.65, blue: 0.15) // amber
|
static let attention = Color(red: 1.00, green: 0.65, blue: 0.15) // amber
|
||||||
static let success = Color(red: 0.30, green: 0.80, blue: 0.45) // green
|
static let success = Color(red: 0.30, green: 0.80, blue: 0.45) // green
|
||||||
@@ -120,6 +111,6 @@ struct CardBackground: ViewModifier {
|
|||||||
|
|
||||||
extension View {
|
extension View {
|
||||||
func card(padding: CGFloat = 14) -> some View { modifier(CardBackground(padding: padding)) }
|
func card(padding: CGFloat = 14) -> some View { modifier(CardBackground(padding: padding)) }
|
||||||
/// Apply the lavender accent app-wide.
|
/// Apply the teal accent app-wide.
|
||||||
func nucleicTint() -> some View { tint(Palette.accent) }
|
func nucleicTint() -> some View { tint(Palette.accent) }
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user