Apple UI Colors

SwiftUI Colors: Complete Guide to System Colors, Hex Values, and Dark Mode

SwiftUI ships a compact set of built-in system colors—semantic foreground tokens, appearance-aware palette colors, and fixed absolutes—that align with Apple's Human Interface Guidelines. This guide explains how those colors work, shows resolved light and dark values, and links to searchable directories for SwiftUI, iOS, and macOS. For the interactive reference table, visit the SwiftUI colors directory.

What are SwiftUI system colors?

SwiftUI system colors are Apple-defined Color values that adapt to the current interface appearance. They fall into three practical groups:

  • Semantic foreground colors .primary, .secondary, and .accentColor for text and icons that should track content hierarchy.
  • Adaptable palette colors .red through .gray, including mint, cyan, and brown, which shift slightly between light and dark mode.
  • Fixed absolutes .black and .white, which stay constant across appearances.

Prefer system colors over hard-coded HEX when building interfaces that should feel native on iPhone, iPad, and Mac. They stay aligned with platform updates and respect accessibility expectations for contrast and hierarchy.

Complete SwiftUI color table

All built-in SwiftUI Color static properties with resolved light and dark values. This covers framework-provided colors only—not asset catalog or custom named colors.

SwatchNameAPILightDarkDescription
AccentColor.accentColor#007AFF#007AFFSwiftUI's accent color on the current runtime.
PrimaryColor.primaryrgba(0, 0, 0, 0.85)rgba(255, 255, 255, 0.85)SwiftUI's primary semantic foreground color.
SecondaryColor.secondaryrgba(0, 0, 0, 0.5)rgba(255, 255, 255, 0.55)SwiftUI's secondary semantic foreground color.
RedColor.red#FF383C#FF4245SwiftUI's adaptable red.
OrangeColor.orange#FF8D28#FF9230SwiftUI's adaptable orange.
YellowColor.yellow#FFCC00#FFD600SwiftUI's adaptable yellow.
GreenColor.green#34C759#30D158SwiftUI's adaptable green.
MintColor.mint#00C8B3#00DAC3SwiftUI's adaptable mint.
TealColor.teal#00C3D0#00D2E0SwiftUI's adaptable teal.
CyanColor.cyan#00C0E8#3CD3FESwiftUI's adaptable cyan.
BlueColor.blue#0088FF#0091FFSwiftUI's adaptable blue.
IndigoColor.indigo#6155F5#6D7CFFSwiftUI's adaptable indigo.
PurpleColor.purple#CB30E0#DB34F2SwiftUI's adaptable purple.
PinkColor.pink#FF2D55#FF375FSwiftUI's adaptable pink.
BrownColor.brown#AC7F5E#B78A66SwiftUI's adaptable brown.
GrayColor.gray#8E8E93#8E8E93SwiftUI's neutral gray.
BlackColor.black#000000#000000Pure black.
WhiteColor.white#FFFFFF#FFFFFFPure white.

iOS and iPadOS semantic colors

UIKit exposes a richer semantic layer for backgrounds, fills, labels, and separators. SwiftUI's .primary maps conceptually to UIColor.label for primary text. Browse the full UIKit set on the iOS and iPadOS colors directory.

SwatchNameAPILightDarkDescription
System BackgroundUIColor.systemBackground#FFFFFF#000000The background color for the overall view.
Secondary System BackgroundUIColor.secondarySystemBackground#F2F2F7#1C1C1EA background color for grouped content.
Tertiary System BackgroundUIColor.tertiarySystemBackground#FFFFFF#2C2C2EA background color for content nested inside secondary surfaces.
System Grouped BackgroundUIColor.systemGroupedBackground#F2F2F7#000000The background color for grouped table-style layouts.
Secondary System Grouped BackgroundUIColor.secondarySystemGroupedBackground#FFFFFF#1C1C1EA grouped background color for secondary surfaces.
Tertiary System Grouped BackgroundUIColor.tertiarySystemGroupedBackground#F2F2F7#2C2C2EA grouped background color for nested tertiary surfaces.
System FillUIColor.systemFill#78788033#7878805CA fill color for large shapes and controls.
Secondary System FillUIColor.secondarySystemFill#78788028#78788051A secondary fill color for medium emphasis shapes.
Tertiary System FillUIColor.tertiarySystemFill#7676801E#7676803DA tertiary fill color for subtle shapes.
Quaternary System FillUIColor.quaternarySystemFill#74748014#7676802EThe softest system fill used for low-emphasis shapes.
LabelUIColor.label#000000#FFFFFFThe primary color for text labels.
Secondary LabelUIColor.secondaryLabel#3C3C4399#EBEBF599The secondary color for text labels.
Tertiary LabelUIColor.tertiaryLabel#3C3C434C#EBEBF54CThe tertiary color for text labels.
Quaternary LabelUIColor.quaternaryLabel#3C3C432E#EBEBF52EThe quaternary color for text labels and separators.
LinkUIColor.link#007AFF#0984FFThe default color for links.
Placeholder TextUIColor.placeholderText#3C3C434C#EBEBF54CThe placeholder color for controls and text views.
SeparatorUIColor.separator#3C3C434A#54545899A separator that allows some underlying content to show through.
Opaque SeparatorUIColor.opaqueSeparator#C6C6C8#38383AA separator that fully obscures content behind it.

macOS system colors

AppKit uses NSColor semantic tokens with desktop-specific names such as NSColor.windowBackgroundColor and NSColor.controlAccentColor. Values differ from UIKit even when the role is similar. See all 53 AppKit colors on the macOS colors directory.

SwatchNameAPILightDarkDescription
LabelNSColor.labelColorrgba(0, 0, 0, 0.85)rgba(255, 255, 255, 0.85)The text of a label containing primary content.
Secondary LabelNSColor.secondaryLabelColorrgba(0, 0, 0, 0.5)rgba(255, 255, 255, 0.55)The text of a label of lesser importance than a primary label.
Tertiary LabelNSColor.tertiaryLabelColorrgba(0, 0, 0, 0.26)rgba(255, 255, 255, 0.25)The text of a label of lesser importance than a secondary label.
Quaternary LabelNSColor.quaternaryLabelColorrgba(0, 0, 0, 0.1)rgba(255, 255, 255, 0.1)The text of a label of lesser importance than a tertiary label.
TextNSColor.textColor#000000#FFFFFFThe color to use for text.
Placeholder TextNSColor.placeholderTextColorrgba(0, 0, 0, 0.5)rgba(255, 255, 255, 0.55)The color to use for placeholder text in controls or text views.
LinkNSColor.linkColor#0068DA#419CFFA link to other content.
System FillNSColor.systemFillrgba(0, 0, 0, 0.1)rgba(255, 255, 255, 0.1)The default fill color for controls and interface elements.
SeparatorNSColor.separatorColorrgba(0, 0, 0, 0.1)rgba(255, 255, 255, 0.1)A separator between different sections of content.
Control AccentNSColor.controlAccentColor#007AFF#007AFFThe accent color people select in System Settings.
Control BackgroundNSColor.controlBackgroundColor#FFFFFF#1E1E1EThe background of a large interface element, such as a browser or table.
Selected Content BackgroundNSColor.selectedContentBackgroundColor#0064E1#0059D1The background for selected content in a key window or view.
Window BackgroundNSColor.windowBackgroundColor#FFFFFF#1E1E1EThe background of a window.

How adaptive colors work

Most Apple system colors are dynamic: they resolve at runtime based on the active trait environment—light or dark appearance, and sometimes platform context. In SwiftUI, palette colors like Color.blue automatically return the correct variant without manual branching.

Some colors keep the same resolved value in both modes. Examples include Color.black, Color.white, Color.gray, and Color.accentColor in the current dataset. Others, like Color.primary, invert emphasis between appearances.

When you need UIKit or AppKit semantics inside SwiftUI, bridge with Color(uiColor:) or Color(nsColor:). You can also read @Environment(\.colorScheme) when custom views need explicit appearance-aware logic.

Light mode vs dark mode notes

Semantic foreground colors use rgba values so text remains legible on varied backgrounds. For example, Color.primary resolves to rgba(0, 0, 0, 0.85) in light mode and rgba(255, 255, 255, 0.85) in dark mode.

UIKit fill colors often encode alpha in 8-digit HEX notation. UIColor.systemFill uses #78788033 in light mode and #7878805C in dark mode—the trailing bytes represent opacity that increases in dark mode for visible contrast.

The searchable color directories on this site show one appearance at a time based on the theme toggle. This guide table lists both light and dark columns so crawlers and readers can compare values without switching themes.

SwiftUI code examples

Text("Hello, world!")
  .foregroundStyle(.primary)

Text("Supporting detail")
  .foregroundStyle(.secondary)

Rectangle()
  .fill(Color.blue)
  .frame(height: 44)

@Environment(\.colorScheme) private var colorScheme

UIColor to Color examples

When SwiftUI's built-in static colors are not enough, wrap UIKit or AppKit semantic colors directly:

// iOS / iPadOS backgrounds and labels
Color(uiColor: .systemBackground)
Color(uiColor: .label)
Color(uiColor: .secondaryLabel)

// macOS window and control surfaces
Color(nsColor: .windowBackgroundColor)
Color(nsColor: .controlAccentColor)
Color(nsColor: .labelColor)

Common cross-framework mappings for primary text:

SwiftUIUIKitAppKit
Color.primaryUIColor.labelNSColor.labelColor
Color.secondaryUIColor.secondaryLabelNSColor.secondaryLabelColor
Color(uiColor: .systemBackground)UIColor.systemBackgroundNSColor.windowBackgroundColor (approximate role)

FAQ