Repository Public
1// SP Notes iOS2// File: Editor/EditorPalette.swift3// Description: The Note Visual System 2.0 colour tokens as dynamic UIColors, for what the editor draws with UIKit (block cards,4// chips, badges, syntax colours). Values come from `NVColor.Token` (SPEC §7): nothing is redefined here.5//6// Author: Simon-Pierre Boucher7// Contact: contact@spboucher.ai8import SPNotesDesign9import SPNotesDocument10import UIKit1112/// The priority of a task item (`low`, `medium`, `high`) — the Core's `TaskPriority`, renamed here because Swift's concurrency13/// library has a type of the same name.14typealias ItemPriority = TaskItemPriority // Core's own non-clashing name (2.0 final)1516enum NVUIColor {17 static func make(_ token: NVColor.Token) -> UIColor {18 let light = token.light, dark = token.dark19 return UIColor { traits in20 let c = traits.userInterfaceStyle == .dark ? dark : light21 return UIColor(red: c.red, green: c.green, blue: c.blue, alpha: c.alpha)22 }23 }2425 static let bg = make(.bg)26 static let bgElevated = make(.bgElevated)27 static let bgSunken = make(.bgSunken)28 static let bgHover = make(.bgHover)29 static let fg = make(.fg)30 static let fgMuted = make(.fgMuted)31 static let fgFaint = make(.fgFaint)32 static let line = make(.line)33 static let lineStrong = make(.lineStrong)34 static let accent = make(.accent)35 static let accentFg = make(.accentFg)36 static let accentSoft = make(.accentSoft)37 static let ai = make(.ai)38 static let aiSoft = make(.aiSoft)39 static let success = make(.success)40 static let warning = make(.warning)41 static let danger = make(.danger)42 static let successText = make(.successText)43 static let warningText = make(.warningText)44 static let dangerText = make(.dangerText)45}46