iOS Color Palette — Semantic Colors + Liquid Glass
1. iOS 26 Semantic Colors
Use system semantic colors. They adapt automatically to Light/Dark Mode, accessibility settings, and glass surfaces.
Backgrounds
| Token |
Usage |
Color(.systemBackground) |
Primary background |
Color(.secondarySystemBackground) |
Grouped/card backgrounds |
Color(.tertiarySystemBackground) |
Nested groups |
Color(.systemGroupedBackground) |
Grouped table/list background |
Color(.secondarySystemGroupedBackground) |
Sections within grouped |
Color(.tertiarySystemGroupedBackground) |
Nested within grouped sections |
Labels (Text)
| Token |
Usage |
.foregroundStyle(.primary) |
Primary text — titles, body |
.foregroundStyle(.secondary) |
Supporting text — subtitles, metadata |
.foregroundStyle(.tertiary) |
Disabled or hint text |
.foregroundStyle(.quaternary) |
Barely visible — watermarks, separators |
System Colors
Color.red, .orange, .yellow, .green, .mint, .teal, .cyan, .blue, .indigo, .purple, .pink, .brown — all adapt to Light/Dark automatically.
Separators & Fills
| Token |
Usage |
Color(.separator) |
Standard divider lines |
Color(.opaqueSeparator) |
Non-translucent dividers |
Color(.systemFill) |
Thin fill for small elements |
Color(.secondarySystemFill) |
Medium fill |
Color(.tertiarySystemFill) |
Thick fill |
2. Liquid Glass Color Behavior
Glass surfaces are translucent — the background bleeds through. This changes how color works:
3. Palette Construction Rules
The One-Accent Rule
- Choose one accent color for your entire app
- Set it in asset catalog as
AccentColor or via .tint() at the app level
- Use it for: primary buttons, active tab icons, links, toggles, selection highlights
- Everything else uses semantic system colors
Color Constraints
- No oversaturated neons — keep saturation below 80% in HSB
- No pure black (
#000000) — use Color(.systemBackground) which is near-black in Dark Mode
- No pure white (
#FFFFFF) for backgrounds — use Color(.systemBackground)
- No custom grays — use
Color(.secondaryLabel), Color(.systemFill), etc.
- Tinted shadows carry the background hue — use
.shadow(.drop(color: .accent.opacity(0.15), radius: 8))
Contrast Requirements
- Accent color must pass WCAG AA (4.5:1 ratio) against both light and dark system backgrounds
- Test with Accessibility Inspector in Xcode
- Body text on glass: use
.foregroundStyle(.primary) — the system ensures contrast via vibrancy
- Small text (caption/footnote): needs even higher contrast — use
.foregroundStyle(.primary), never .tertiary
4. Light/Dark Mode
Asset Catalog Setup
- Create a Color Set in
Assets.xcassets
- Set Appearances to "Any, Dark"
- Define both variants
Code Pattern
// Asset catalog color (automatically adapts)
Color("BrandAccent")
// Programmatic adaptive color
extension Color {
static let accent = Color("BrandAccent")
}
// Inline adaptive (rare — prefer asset catalog)
@Environment(\.colorScheme) var colorScheme
let tint = colorScheme == .dark ? Color.blue : Color.indigo
Glass in Both Modes
- Light Mode: glass is bright, subtle tints show clearly
- Dark Mode: glass is darker, tints are more muted
- Always test
.glassEffect(.regular.tint(.yourAccent)) in both modes
- If tint looks too strong in one mode, consider using a semantic color that adapts
5. Quick Reference
Color Modifier Patterns
// Text color
.foregroundStyle(.primary)
.foregroundStyle(.secondary)
.foregroundStyle(Color.accentColor)
// Hierarchical foreground (primary + secondary in one view)
.foregroundStyle(.blue, .blue.opacity(0.5))
// View tinting (buttons, controls)
.tint(.blue)
// App-wide accent
// Set AccentColor in asset catalog — no code needed
// Background
.background(Color(.secondarySystemBackground))
.background(.ultraThinMaterial) // pre-iOS 26 glass alternative
// Shapes with fill
RoundedRectangle(cornerRadius: 12)
.fill(Color(.secondarySystemGroupedBackground))
Color Debugging
// Temporarily visualize color tokens
.border(Color.red) // layout debugging
.background(Color.yellow.opacity(0.3)) // hit area debugging
1---2name: ios-color-palette3description: iOS color palette guidance. Triggers on: color palette, colors, color scheme, tinting, vibrancy, iOS colors, dark mode colors, accent color, semantic colors.4---56# iOS Color Palette — Semantic Colors + Liquid Glass78---910## 1. iOS 26 Semantic Colors1112Use system semantic colors. They adapt automatically to Light/Dark Mode, accessibility settings, and glass surfaces.1314### Backgrounds15| Token | Usage |16|---|---|17| `Color(.systemBackground)` | Primary background |18| `Color(.secondarySystemBackground)` | Grouped/card backgrounds |19| `Color(.tertiarySystemBackground)` | Nested groups |20| `Color(.systemGroupedBackground)` | Grouped table/list background |21| `Color(.secondarySystemGroupedBackground)` | Sections within grouped |22| `Color(.tertiarySystemGroupedBackground)` | Nested within grouped sections |2324### Labels (Text)25| Token | Usage |26|---|---|27| `.foregroundStyle(.primary)` | Primary text — titles, body |28| `.foregroundStyle(.secondary)` | Supporting text — subtitles, metadata |29| `.foregroundStyle(.tertiary)` | Disabled or hint text |30| `.foregroundStyle(.quaternary)` | Barely visible — watermarks, separators |3132### System Colors33`Color.red`, `.orange`, `.yellow`, `.green`, `.mint`, `.teal`, `.cyan`, `.blue`, `.indigo`, `.purple`, `.pink`, `.brown` — all adapt to Light/Dark automatically.3435### Separators & Fills36| Token | Usage |37|---|---|38| `Color(.separator)` | Standard divider lines |39| `Color(.opaqueSeparator)` | Non-translucent dividers |40| `Color(.systemFill)` | Thin fill for small elements |41| `Color(.secondarySystemFill)` | Medium fill |42| `Color(.tertiarySystemFill)` | Thick fill |4344---4546## 2. Liquid Glass Color Behavior4748Glass surfaces are translucent — the background bleeds through. This changes how color works:4950- **`.tint()` on glass**: Adds a subtle color wash to the glass surface. Use your accent color here.51 ```swift52 .glassEffect(.regular.tint(.blue))53 ```54- **Vibrancy**: Text and symbols on glass automatically get vibrancy treatment. Use `.foregroundStyle(.primary)` — the system handles the rest.55- **Don't fight the glass**: Avoid opaque backgrounds behind glass elements. The translucency IS the design.56- **Test over different backgrounds**: Glass looks different over light content, dark content, and images. Verify readability across all.5758---5960## 3. Palette Construction Rules6162### The One-Accent Rule63- Choose **one** accent color for your entire app64- Set it in asset catalog as `AccentColor` or via `.tint()` at the app level65- Use it for: primary buttons, active tab icons, links, toggles, selection highlights66- Everything else uses semantic system colors6768### Color Constraints69- **No oversaturated neons** — keep saturation below 80% in HSB70- **No pure black** (`#000000`) — use `Color(.systemBackground)` which is near-black in Dark Mode71- **No pure white** (`#FFFFFF`) for backgrounds — use `Color(.systemBackground)`72- **No custom grays** — use `Color(.secondaryLabel)`, `Color(.systemFill)`, etc.73- **Tinted shadows** carry the background hue — use `.shadow(.drop(color: .accent.opacity(0.15), radius: 8))`7475### Contrast Requirements76- Accent color must pass **WCAG AA** (4.5:1 ratio) against both light and dark system backgrounds77- Test with Accessibility Inspector in Xcode78- Body text on glass: use `.foregroundStyle(.primary)` — the system ensures contrast via vibrancy79- Small text (caption/footnote): needs even higher contrast — use `.foregroundStyle(.primary)`, never `.tertiary`8081---8283## 4. Light/Dark Mode8485### Asset Catalog Setup861. Create a Color Set in `Assets.xcassets`872. Set Appearances to "Any, Dark"883. Define both variants8990### Code Pattern91```swift92// Asset catalog color (automatically adapts)93Color("BrandAccent")9495// Programmatic adaptive color96extension Color {97 static let accent = Color("BrandAccent")98}99100// Inline adaptive (rare — prefer asset catalog)101@Environment(\.colorScheme) var colorScheme102let tint = colorScheme == .dark ? Color.blue : Color.indigo103```104105### Glass in Both Modes106- Light Mode: glass is bright, subtle tints show clearly107- Dark Mode: glass is darker, tints are more muted108- Always test `.glassEffect(.regular.tint(.yourAccent))` in both modes109- If tint looks too strong in one mode, consider using a semantic color that adapts110111---112113## 5. Quick Reference114115### Color Modifier Patterns116```swift117// Text color118.foregroundStyle(.primary)119.foregroundStyle(.secondary)120.foregroundStyle(Color.accentColor)121122// Hierarchical foreground (primary + secondary in one view)123.foregroundStyle(.blue, .blue.opacity(0.5))124125// View tinting (buttons, controls)126.tint(.blue)127128// App-wide accent129// Set AccentColor in asset catalog — no code needed130131// Background132.background(Color(.secondarySystemBackground))133.background(.ultraThinMaterial) // pre-iOS 26 glass alternative134135// Shapes with fill136RoundedRectangle(cornerRadius: 12)137 .fill(Color(.secondarySystemGroupedBackground))138```139140### Color Debugging141```swift142// Temporarily visualize color tokens143.border(Color.red) // layout debugging144.background(Color.yellow.opacity(0.3)) // hit area debugging145```