apple-human-interface-guidelines-colorslisted
Install: claude install-skill OPN48/skills-apple-human-interface-guidelines
# iOS System Colors
> **平台分流**
> - **Android**:下文 hex 表 → `values/colors.xml` / `values-night/colors.xml`
> - **iOS**:**禁止**在业务 UI 使用本表 hex;改用 SwiftUI `Color`(见 [iOS SwiftUI 实施方案](#ios-swiftui-实施方案))
## iOS SwiftUI 实施方案
iOS 全部界面语义色与主题色走 [SwiftUI `Color`](https://developer.apple.com/documentation/swiftui/color) — context-dependent,渲染前由系统解析,自动适配浅色/深色/增对比度。
### 创建颜色的优先级
1. `Color.primary` / `Color.secondary` — 主/次级文字
2. `Color.cyan` / `Color.pink` / `Color.blue` / `Color.red` 等标准 palette
3. `Color(uiColor: .systemBackground)` 等 — 背景、分割、grouped 列表(SwiftUI 无对应静态成员时)
4. `Color("Name")` — 仅 VIP/品牌等无系统等价色
**禁止**(业务 UI):`Color(red:)`、`Color(hex:)`、自定义 token 转发系统语义色、`UIColor.systemCyan` 作主题色。
### 主题色三档(App 设置)
| 设置项 | SwiftUI | 禁止 |
|--------|---------|------|
| 青柠青 | `Color.cyan` | hex、`Color(red:)`、封装 enum 转发 |
| 莓果粉 | `Color.pink` | 同上 |
| 海盐蓝 | `Color.blue` | 同上 |
```swift
@EnvironmentObject private var appearance: ThemeStore
.tint(appearance.accentColor)
.background(appearance.accentColor)
// ThemeStore.AccentTheme
var accentColor: Color {
switch self {
case .cyan: Color.cyan
case .pink: Color.pink
case .blue: Color.blue
}
}
```
业务 View 直接写 SwiftUI `Color`;主题色唯一来源是应用级 `ThemeStore`(或等价的 `ObservableObject`),不新增二次封装层。
### 语义色(View 内直接用)
| 用途 | 写法 |
|------|------|
| 主文字 | `Color.primary` |
| 次级文字 | `Color.secondary` |
| 页面背景 | `Color(uiColor: .systemBackground)` |
| Tab/卡片背景 | `Color(uiColor: .secondarySystemBackground)` |
| 分割线 | `Color(uiColor: .se