SwiftUI Color.white

.white
Absolute Monochromatic White
Adaptive System Token•iOS 13.0+, macOS 10.15+, tvOS 13.0+, watchOS 6.0+, visionOS 1.0+

Complete technical specification and developer reference for White in Apple's SwiftUI design system. In light appearance, it resolves to HEX #FFFFFF; in dark appearance, it dynamically adapts to HEX #FFFFFF. Features wide-gamut Display P3 values, UIKit bridge (UIColor.white), AppKit bridge (NSColor.white), WCAG contrast audit, and Xcode drop-in initializers.

Light Mode#FFFFFF
Dark Mode#FFFFFF
White Color Preview

Pure white.

Color.white
Copy:
Dynamic Asset
Absolute Monochromatic White
iOS 13.0+, macOS 10.15+, tvOS 13.0+, watchOS 6.0+, visionOS 1.0+
Initializers & Color Spaces
Color(r:g:b:)Color(red: 1.000, green: 1.000, blue: 1.000)
Color(r:g:b:op:)Color(red: 1.000, green: 1.000, blue: 1.000, opacity: 1.00)
Color(hue:sat:bri:)HSBColor(hue: 0.000, saturation: 0.000, brightness: 1.000, opacity: 1.00)
Color(.displayP3)Wide GamutColor(.displayP3, red: 1.000, green: 1.000, blue: 1.000, opacity: 1.00)
Color(.sRGB)Color(.sRGB, red: 1.000, green: 1.000, blue: 1.000, opacity: 1.00)
Color(hex:)ExtensionColor(hex: "#FFFFFF")
#colorLiteralXcode#colorLiteral(red: 1.000, green: 1.000, blue: 1.000, alpha: 1.00)
Color(uiColor:)iOSColor(uiColor: UIColor(red: 1.000, green: 1.000, blue: 1.000, alpha: 1.00))
Active HEX: #FFFFFFP3 R: 1.000 G: 1.000 B: 1.000

Technical Color Specifications

Exact resolved HEX codes, sRGB 8-bit components, HSL, and normalized Swift floating-point decimals for Light and Dark modes.

Color Metric / SpaceLight AppearanceDark AppearanceSwift Code Literal
HEX Code#FFFFFF#FFFFFFColor(hex: "#FFFFFF")
sRGB (0–255)rgb(255, 255, 255)rgb(255, 255, 255)(r: 1.000, g: 1.000, b: 1.000)
Display P3 (Wide Gamut)P3 (1.000, 1.000, 1.000)P3 (1.000, 1.000, 1.000)Color(.displayP3, ...)
HSL / HSBhsl(0, 0%, 100%)hsl(0, 0%, 100%)Color(hue:sat:bri:)
Platform BridgeUIKit: UIColor.whiteAppKit: NSColor.whiteColor(uiColor:) / Color(nsColor:)

Light Appearance

Light Theme
HEX Code
#FFFFFF
RGB (0–255)
rgb(255, 255, 255)
HSL
hsl(0, 0%, 100%)
Normalized Swift Literal:
(r: 1.000, g: 1.000, b: 1.000)

Dark Appearance

Dark Theme
HEX Code
#FFFFFF
RGB (0–255)
rgb(255, 255, 255)
HSL
hsl(0, 0%, 100%)
Normalized Swift Literal:
(r: 1.000, g: 1.000, b: 1.000)

Drop-In Developer Snippets

Ready-to-paste code blocks for Xcode asset catalogs and Swift files.

Xcode Location: Save as Contents.json inside Assets.xcassets/White.colorset/
Includes Light + Dark Modes
Contents.json
{
  "colors": [
    {
      "color": {
        "color-space": "srgb",
        "components": {
          "red": "1.000",
          "green": "1.000",
          "blue": "1.000",
          "alpha": "1.000"
        }
      },
      "idiom": "universal"
    },
    {
      "appearances": [
        {
          "appearance": "luminosity",
          "value": "dark"
        }
      ],
      "color": {
        "color-space": "srgb",
        "components": {
          "red": "1.000",
          "green": "1.000",
          "blue": "1.000",
          "alpha": "1.000"
        }
      },
      "idiom": "universal"
    }
  ],
  "info": {
    "author": "xcode",
    "version": 1
  }
}

Live UI Component Sandbox

Preview Color.white inside standard Apple interface components.

Interactive Controls
Active TagBadge 99+
Toggle Tint
Container & Typography Styling

●SwiftUI Notification

Just now

Demonstrates how Apple designers pair system background tints with dynamic White accents.

Dynamic Headline in White

.foregroundStyle(.white)

Platform Implementation Snippets

Ready-to-use Swift code for SwiftUI, UIKit, and AppKit applications.

SwiftUI (Swift 5.9+)
// Standard SwiftUI Usage
Text("Hello, Apple")
    .foregroundStyle(Color.white)

// Background & Shape Fill
RoundedRectangle(cornerRadius: 16)
    .fill(Color.white)
    .frame(width: 200, height: 50)

// Prominent Action Button
Button("Confirm Action") {
    // Action
}
.buttonStyle(.borderedProminent)
.tint(Color.white)

WCAG 2.1 Accessibility Contrast Audit

Contrast calculations of White against pure white and iOS OLED dark surfaces.

Light Mode (#FFFFFF)on White (#FFF)
Contrast Ratio:1.00:1
Normal Text (4.5:1 AA): Fail
Dark Mode (#FFFFFF)on Dark (#1C1C1E)
Contrast Ratio:17.01:1
Normal Text (4.5:1 AA): Pass (AA)

Recommended HIG Use Cases

  • Clean pure white cards and backgrounds
  • High-contrast dark-mode foreground text
  • Fixed light elements that should not invert

Anti-Patterns to Avoid

  • Direct use where adaptive dark mode inversion is expected (use Color(uiColor: .systemBackground) instead)

Browse More SwiftUI Colors

Quickly jump to other Apple system colors and semantic tokens.

All 18 Colors →

Frequently Asked Questions

How do I use Color.white in SwiftUI?

In SwiftUI, apply the color directly using view modifiers like .foregroundStyle(.white), .tint(.white), or .background(.white). You can also instantiate it via Color.white.

What is the HEX code for SwiftUI White in light and dark mode?

In light appearance, SwiftUI White resolves to #FFFFFF. In dark appearance, it automatically adapts to #FFFFFF.

What is the UIKit and AppKit equivalent of SwiftUI Color.white?

The UIKit equivalent is UIColor.white (accessible in SwiftUI via Color(uiColor: .white)). The AppKit equivalent is NSColor.white (accessible via Color(nsColor: .white)).

Does SwiftUI Color.white adapt automatically to dark mode?

Yes, Color.white is a dynamic Apple system token that automatically updates between light (#FFFFFF) and dark (#FFFFFF) appearances when the system appearance changes.

What is the Display P3 and sRGB value of Color.white?

Color.white uses resolved sRGB values (#FFFFFF in light, #FFFFFF in dark) and supports wide color gamut Display P3 coordinates for high-fidelity rendering on Apple Retina displays.