// Generated by brand/tokens/build.mjs from tokens.json v1.2.0. Do not edit by hand. import SwiftUI public enum CXColor { public static let navy50 = Color(.sRGB, red: 242 / 255.0, green: 247 / 255.0, blue: 252 / 255.0, opacity: 1) public static let navy100 = Color(.sRGB, red: 228 / 255.0, green: 238 / 255.0, blue: 247 / 255.0, opacity: 1) public static let navy200 = Color(.sRGB, red: 206 / 255.0, green: 223 / 255.0, blue: 238 / 255.0, opacity: 1) public static let navy300 = Color(.sRGB, red: 176 / 255.0, green: 203 / 255.0, blue: 226 / 255.0, opacity: 1) public static let navy400 = Color(.sRGB, red: 141 / 255.0, green: 181 / 255.0, blue: 214 / 255.0, opacity: 1) public static let navy500 = Color(.sRGB, red: 102 / 255.0, green: 157 / 255.0, blue: 201 / 255.0, opacity: 1) public static let navy600 = Color(.sRGB, red: 63 / 255.0, green: 134 / 255.0, blue: 189 / 255.0, opacity: 1) public static let navy700 = Color(.sRGB, red: 11 / 255.0, green: 110 / 255.0, blue: 171 / 255.0, opacity: 1) public static let navy800 = Color(.sRGB, red: 0 / 255.0, green: 86 / 255.0, blue: 136 / 255.0, opacity: 1) /// 字标色,不可更改的锚点。 public static let navy900 = Color(.sRGB, red: 0 / 255.0, green: 52 / 255.0, blue: 89 / 255.0, opacity: 1) public static let navy950 = Color(.sRGB, red: 0 / 255.0, green: 38 / 255.0, blue: 65 / 255.0, opacity: 1) public static let leaf50 = Color(.sRGB, red: 242 / 255.0, green: 250 / 255.0, blue: 236 / 255.0, opacity: 1) public static let leaf100 = Color(.sRGB, red: 227 / 255.0, green: 243 / 255.0, blue: 216 / 255.0, opacity: 1) public static let leaf200 = Color(.sRGB, red: 203 / 255.0, green: 231 / 255.0, blue: 183 / 255.0, opacity: 1) public static let leaf300 = Color(.sRGB, red: 173 / 255.0, green: 214 / 255.0, blue: 140 / 255.0, opacity: 1) public static let leaf400 = Color(.sRGB, red: 140 / 255.0, green: 195 / 255.0, blue: 90 / 255.0, opacity: 1) public static let leaf500 = Color(.sRGB, red: 107 / 255.0, green: 172 / 255.0, blue: 27 / 255.0, opacity: 1) /// 叶标色,不可更改的锚点。 public static let leaf600 = Color(.sRGB, red: 85 / 255.0, green: 164 / 255.0, blue: 0 / 255.0, opacity: 1) public static let leaf700 = Color(.sRGB, red: 72 / 255.0, green: 121 / 255.0, blue: 0 / 255.0, opacity: 1) public static let leaf800 = Color(.sRGB, red: 55 / 255.0, green: 94 / 255.0, blue: 1 / 255.0, opacity: 1) public static let leaf900 = Color(.sRGB, red: 38 / 255.0, green: 68 / 255.0, blue: 0 / 255.0, opacity: 1) public static let leaf950 = Color(.sRGB, red: 23 / 255.0, green: 43 / 255.0, blue: 1 / 255.0, opacity: 1) public static let sand50 = Color(.sRGB, red: 253 / 255.0, green: 245 / 255.0, blue: 237 / 255.0, opacity: 1) public static let sand100 = Color(.sRGB, red: 243 / 255.0, green: 235 / 255.0, blue: 227 / 255.0, opacity: 1) public static let sand200 = Color(.sRGB, red: 227 / 255.0, green: 219 / 255.0, blue: 211 / 255.0, opacity: 1) public static let sand300 = Color(.sRGB, red: 205 / 255.0, green: 198 / 255.0, blue: 190 / 255.0, opacity: 1) public static let sand400 = Color(.sRGB, red: 181 / 255.0, green: 174 / 255.0, blue: 166 / 255.0, opacity: 1) public static let sand500 = Color(.sRGB, red: 157 / 255.0, green: 149 / 255.0, blue: 142 / 255.0, opacity: 1) public static let sand600 = Color(.sRGB, red: 134 / 255.0, green: 127 / 255.0, blue: 119 / 255.0, opacity: 1) public static let sand700 = Color(.sRGB, red: 110 / 255.0, green: 104 / 255.0, blue: 96 / 255.0, opacity: 1) public static let sand800 = Color(.sRGB, red: 86 / 255.0, green: 80 / 255.0, blue: 73 / 255.0, opacity: 1) public static let sand900 = Color(.sRGB, red: 63 / 255.0, green: 57 / 255.0, blue: 51 / 255.0, opacity: 1) public static let sand950 = Color(.sRGB, red: 40 / 255.0, green: 35 / 255.0, blue: 29 / 255.0, opacity: 1) public static let harvest50 = Color(.sRGB, red: 254 / 255.0, green: 245 / 255.0, blue: 234 / 255.0, opacity: 1) public static let harvest100 = Color(.sRGB, red: 253 / 255.0, green: 234 / 255.0, blue: 207 / 255.0, opacity: 1) public static let harvest200 = Color(.sRGB, red: 248 / 255.0, green: 215 / 255.0, blue: 169 / 255.0, opacity: 1) public static let harvest300 = Color(.sRGB, red: 239 / 255.0, green: 190 / 255.0, blue: 121 / 255.0, opacity: 1) public static let harvest400 = Color(.sRGB, red: 223 / 255.0, green: 163 / 255.0, blue: 69 / 255.0, opacity: 1) public static let harvest500 = Color(.sRGB, red: 200 / 255.0, green: 136 / 255.0, blue: 12 / 255.0, opacity: 1) public static let harvest600 = Color(.sRGB, red: 171 / 255.0, green: 115 / 255.0, blue: 4 / 255.0, opacity: 1) public static let harvest700 = Color(.sRGB, red: 139 / 255.0, green: 95 / 255.0, blue: 19 / 255.0, opacity: 1) public static let harvest800 = Color(.sRGB, red: 104 / 255.0, green: 75 / 255.0, blue: 33 / 255.0, opacity: 1) public static let harvest900 = Color(.sRGB, red: 71 / 255.0, green: 56 / 255.0, blue: 34 / 255.0, opacity: 1) public static let harvest950 = Color(.sRGB, red: 42 / 255.0, green: 35 / 255.0, blue: 25 / 255.0, opacity: 1) public static let soil50 = Color(.sRGB, red: 252 / 255.0, green: 245 / 255.0, blue: 241 / 255.0, opacity: 1) public static let soil100 = Color(.sRGB, red: 246 / 255.0, green: 234 / 255.0, blue: 225 / 255.0, opacity: 1) public static let soil200 = Color(.sRGB, red: 237 / 255.0, green: 216 / 255.0, blue: 200 / 255.0, opacity: 1) public static let soil300 = Color(.sRGB, red: 224 / 255.0, green: 193 / 255.0, blue: 168 / 255.0, opacity: 1) public static let soil400 = Color(.sRGB, red: 207 / 255.0, green: 166 / 255.0, blue: 133 / 255.0, opacity: 1) public static let soil500 = Color(.sRGB, red: 187 / 255.0, green: 139 / 255.0, blue: 100 / 255.0, opacity: 1) public static let soil600 = Color(.sRGB, red: 166 / 255.0, green: 116 / 255.0, blue: 74 / 255.0, opacity: 1) public static let soil700 = Color(.sRGB, red: 139 / 255.0, green: 93 / 255.0, blue: 55 / 255.0, opacity: 1) public static let soil800 = Color(.sRGB, red: 108 / 255.0, green: 72 / 255.0, blue: 42 / 255.0, opacity: 1) public static let soil900 = Color(.sRGB, red: 77 / 255.0, green: 52 / 255.0, blue: 32 / 255.0, opacity: 1) public static let soil950 = Color(.sRGB, red: 47 / 255.0, green: 32 / 255.0, blue: 20 / 255.0, opacity: 1) public static let sky50 = Color(.sRGB, red: 240 / 255.0, green: 248 / 255.0, blue: 254 / 255.0, opacity: 1) public static let sky100 = Color(.sRGB, red: 222 / 255.0, green: 239 / 255.0, blue: 254 / 255.0, opacity: 1) public static let sky200 = Color(.sRGB, red: 191 / 255.0, green: 225 / 255.0, blue: 254 / 255.0, opacity: 1) public static let sky300 = Color(.sRGB, red: 161 / 255.0, green: 205 / 255.0, blue: 242 / 255.0, opacity: 1) public static let sky400 = Color(.sRGB, red: 135 / 255.0, green: 181 / 255.0, blue: 220 / 255.0, opacity: 1) public static let sky500 = Color(.sRGB, red: 113 / 255.0, green: 156 / 255.0, blue: 191 / 255.0, opacity: 1) public static let sky600 = Color(.sRGB, red: 98 / 255.0, green: 133 / 255.0, blue: 161 / 255.0, opacity: 1) public static let sky700 = Color(.sRGB, red: 84 / 255.0, green: 108 / 255.0, blue: 128 / 255.0, opacity: 1) public static let sky800 = Color(.sRGB, red: 68 / 255.0, green: 83 / 255.0, blue: 96 / 255.0, opacity: 1) public static let sky900 = Color(.sRGB, red: 52 / 255.0, green: 60 / 255.0, blue: 66 / 255.0, opacity: 1) public static let sky950 = Color(.sRGB, red: 33 / 255.0, green: 37 / 255.0, blue: 40 / 255.0, opacity: 1) public static let crimson50 = Color(.sRGB, red: 253 / 255.0, green: 244 / 255.0, blue: 243 / 255.0, opacity: 1) public static let crimson100 = Color(.sRGB, red: 252 / 255.0, green: 231 / 255.0, blue: 229 / 255.0, opacity: 1) public static let crimson200 = Color(.sRGB, red: 250 / 255.0, green: 209 / 255.0, blue: 205 / 255.0, opacity: 1) public static let crimson300 = Color(.sRGB, red: 247 / 255.0, green: 180 / 255.0, blue: 173 / 255.0, opacity: 1) public static let crimson400 = Color(.sRGB, red: 241 / 255.0, green: 145 / 255.0, blue: 138 / 255.0, opacity: 1) public static let crimson500 = Color(.sRGB, red: 227 / 255.0, green: 110 / 255.0, blue: 103 / 255.0, opacity: 1) public static let crimson600 = Color(.sRGB, red: 206 / 255.0, green: 81 / 255.0, blue: 77 / 255.0, opacity: 1) public static let crimson700 = Color(.sRGB, red: 174 / 255.0, green: 61 / 255.0, blue: 59 / 255.0, opacity: 1) public static let crimson800 = Color(.sRGB, red: 134 / 255.0, green: 49 / 255.0, blue: 46 / 255.0, opacity: 1) public static let crimson900 = Color(.sRGB, red: 93 / 255.0, green: 39 / 255.0, blue: 37 / 255.0, opacity: 1) public static let crimson950 = Color(.sRGB, red: 56 / 255.0, green: 26 / 255.0, blue: 24 / 255.0, opacity: 1) /// 仅用于单色标志、打印与 bg.raised。 public static let white = Color(.sRGB, red: 255 / 255.0, green: 255 / 255.0, blue: 255 / 255.0, opacity: 1) /// 仅用于单色标志与打印。 public static let black = Color(.sRGB, red: 0 / 255.0, green: 0 / 255.0, blue: 0 / 255.0, opacity: 1) // Semantic colours: light / dark. /// 页面底。 public static let bg = Color(light: sand50, dark: navy950) /// 卡片、面板。 public static let bgRaised = Color(light: white, dark: navy900) /// 输入框、代码块底。暗色 #001B2F 为 navy.950 再降一阶,不在色阶表内。 public static let bgSunken = Color(light: sand100, dark: Color(.sRGB, red: 0 / 255.0, green: 27 / 255.0, blue: 47 / 255.0, opacity: 1)) /// 反色区块。 public static let bgInverse = Color(light: navy900, dark: sand50) /// 正文。 public static let fg = Color(light: sand950, dark: sand50) /// 次级文字。 public static let fgMuted = Color(light: sand700, dark: sand300) /// 占位、禁用——装饰角色,按大字/图形 3:1 核验。亮色取 sand.600(sand.500 对 sand.50 只有 2.7:1)。 public static let fgSubtle = Color(light: sand600, dark: sand500) /// 反色区块上的文字。 public static let fgInverse = Color(light: sand50, dark: navy950) /// 品牌深色(标题、导航)。 public static let brand = Color(light: navy900, dark: navy300) /// 更强的品牌深色。 public static let brandStrong = Color(light: navy950, dark: navy200) /// 主操作、当前、活体。 public static let accent = Color(light: leaf600, dark: leaf500) /// accent 的悬停态。亮色向浅走(leaf.500),使 accent.fg(navy.950)在悬停态仍 ≥ 4.5:1。 public static let accentHover = Color(light: leaf500, dark: leaf400) /// 落在 accent 上的文字:小字一律用 navy.950;白字(color.white)只在 ≥ 18.66px 粗体(大字 3:1)时允许。 public static let accentFg = Color(light: navy950, dark: navy950) /// 浅绿底。 public static let accentSoft = Color(light: leaf100, dark: leaf900) /// 分割线。 public static let border = Color(light: sand200, dark: navy800) /// 输入框描边。 public static let borderStrong = Color(light: sand400, dark: navy600) /// 链接。 public static let link = Color(light: navy700, dark: sky300) /// 文字级成功。亮色取 leaf.800(leaf.700 对 sand.100 为 4.44:1,未达正文 4.5)。 public static let success = Color(light: leaf800, dark: leaf400) /// 文字级警告。亮色取 harvest.700(harvest.600 对 sand.50 为 3.75:1,未达正文 4.5)。 public static let warning = Color(light: harvest700, dark: harvest400) /// 文字级错误/危险。亮色取 crimson.700(crimson.600 对 sand.50 为 3.96:1,未达正文 4.5)。 public static let danger = Color(light: crimson700, dark: crimson400) /// 文字级信息。 public static let info = Color(light: sky700, dark: sky300) /// 图表序列 1。 public static let chart1 = Color(light: navy700, dark: navy400) /// 图表序列 2。亮色取 leaf.700(leaf.600 对 sand.50 为 2.91:1)。 public static let chart2 = Color(light: leaf700, dark: leaf400) /// 图表序列 3。亮色取 harvest.600(harvest.500 对 sand.50 为 2.79:1)。 public static let chart3 = Color(light: harvest600, dark: harvest400) /// 图表序列 4。亮色取 sky.600(sky.500 对 sand.50 为 2.70:1)。 public static let chart4 = Color(light: sky600, dark: sky300) /// 图表序列 5。 public static let chart5 = Color(light: soil600, dark: soil400) /// 图表序列 6。亮色取 crimson.600(crimson.500 对 sand.50 为 2.91:1)。 public static let chart6 = Color(light: crimson600, dark: crimson400) } public enum CXSpace { public static let s0: CGFloat = 0 public static let s1: CGFloat = 4 public static let s2: CGFloat = 8 public static let s3: CGFloat = 12 public static let s4: CGFloat = 16 public static let s5: CGFloat = 20 public static let s6: CGFloat = 24 public static let s8: CGFloat = 32 public static let s10: CGFloat = 40 public static let s12: CGFloat = 48 public static let s16: CGFloat = 64 public static let s20: CGFloat = 80 public static let s24: CGFloat = 96 public static let s32: CGFloat = 128 } public enum CXRadius { public static let none: CGFloat = 0 public static let xs: CGFloat = 2 /// 按钮 public static let sm: CGFloat = 4 /// 默认 public static let md: CGFloat = 8 /// 大卡片 public static let lg: CGFloat = 12 public static let xl: CGFloat = 16 public static let _2xl: CGFloat = 24 /// 胶囊 / 圆 public static let full: CGFloat = 9999 /// 头像 / App 图标底的圆角(占边长百分比)。 Fraction of the side length. public static let iconFraction: CGFloat = 0.22 } public enum CXFont { /// 拉丁 / 西里尔。Montserrat(OFL,可变字重 100–900)。 public static let familySans = "Montserrat" /// 简体中文。Web 端 Noto Sans SC(思源黑体);系统栈 PingFang SC → Hiragino Sans GB → Microsoft YaHei。 public static let familyCjk = "Montserrat" /// 繁体中文(台湾、香港)。Web 端 Noto Sans TC / HK;系统栈 PingFang TC → Hiragino Sans CNS → Microsoft JhengHei。 public static let familyCjkHant = "Montserrat" /// 日文。 public static let familyJa = "Montserrat" /// 韩文。 public static let familyKo = "Montserrat" /// 阿拉伯文 / 波斯文。 public static let familyArabic = "Montserrat" /// 天城文(印地)。 public static let familyDevanagari = "Montserrat" /// 泰文。 public static let familyThai = "Montserrat" /// 等宽:数据、代码。 public static let familyMono = "JetBrains Mono" public static let size_2xs: CGFloat = 11 public static let sizeXs: CGFloat = 12.8 public static let sizeSm: CGFloat = 14 public static let sizeMd: CGFloat = 16 public static let sizeLg: CGFloat = 20 public static let sizeXl: CGFloat = 25 public static let size_2xl: CGFloat = 31 public static let size_3xl: CGFloat = 39 public static let size_4xl: CGFloat = 49 public static let size_5xl: CGFloat = 61 public static let weightRegular: Font.Weight = .regular public static let weightMedium: Font.Weight = .medium public static let weightSemibold: Font.Weight = .semibold public static let weightBold: Font.Weight = .bold public static let lineHeight_2xs: CGFloat = 1.4 public static let lineHeightXs: CGFloat = 1.45 public static let lineHeightSm: CGFloat = 1.5 public static let lineHeightMd: CGFloat = 1.6 public static let lineHeightLg: CGFloat = 1.5 public static let lineHeightXl: CGFloat = 1.3 public static let lineHeight_2xl: CGFloat = 1.2 public static let lineHeight_3xl: CGFloat = 1.15 public static let lineHeight_4xl: CGFloat = 1.1 public static let lineHeight_5xl: CGFloat = 1.05 public static let lineHeightCjk2xs: CGFloat = 1.75 public static let lineHeightCjkXs: CGFloat = 1.75 public static let lineHeightCjkSm: CGFloat = 1.75 public static let lineHeightCjkMd: CGFloat = 1.75 public static let lineHeightCjkLg: CGFloat = 1.75 public static let lineHeightCjkXl: CGFloat = 1.3 public static let lineHeightCjk2xl: CGFloat = 1.3 public static let lineHeightCjk3xl: CGFloat = 1.3 public static let lineHeightCjk4xl: CGFloat = 1.3 public static let lineHeightCjk5xl: CGFloat = 1.3 public static let lineHeightVi2xs: CGFloat = 1.7 public static let lineHeightViXs: CGFloat = 1.7 public static let lineHeightViSm: CGFloat = 1.7 public static let lineHeightViMd: CGFloat = 1.7 public static let lineHeightViLg: CGFloat = 1.7 public static let lineHeightViXl: CGFloat = 1.3 public static let lineHeightVi2xl: CGFloat = 1.3 public static let lineHeightVi3xl: CGFloat = 1.3 public static let lineHeightVi4xl: CGFloat = 1.3 public static let lineHeightVi5xl: CGFloat = 1.3 /// em units; multiply by the font size for points. public static let letterSpacingBody: CGFloat = 0 /// em units; multiply by the font size for points. public static let letterSpacingHeading: CGFloat = -0.01 /// em units; multiply by the font size for points. public static let letterSpacingCaps: CGFloat = 0.08 public static func sans(_ size: CGFloat, weight: Font.Weight = .regular) -> Font { Font.custom(familySans, size: size).weight(weight) } public static func mono(_ size: CGFloat, weight: Font.Weight = .regular) -> Font { Font.custom(familyMono, size: size).weight(weight) } } public extension Color { /// A colour that resolves to `light` or `dark` with the current appearance. init(light: Color, dark: Color) { #if canImport(UIKit) self.init(uiColor: UIColor { traits in traits.userInterfaceStyle == .dark ? UIColor(dark) : UIColor(light) }) #elseif canImport(AppKit) self.init(nsColor: NSColor(name: nil) { appearance in let isDark = appearance.bestMatch(from: [.aqua, .darkAqua]) == .darkAqua return isDark ? NSColor(dark) : NSColor(light) }) #else self = light #endif } }