SwiftUI Color.white
.whiteComplete 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.
Pure white.
Color.whiteColor(red: 1.000, green: 1.000, blue: 1.000)Color(red: 1.000, green: 1.000, blue: 1.000, opacity: 1.00)Color(hue: 0.000, saturation: 0.000, brightness: 1.000, opacity: 1.00)Color(.displayP3, red: 1.000, green: 1.000, blue: 1.000, opacity: 1.00)Color(.sRGB, red: 1.000, green: 1.000, blue: 1.000, opacity: 1.00)Color(hex: "#FFFFFF")#colorLiteral(red: 1.000, green: 1.000, blue: 1.000, alpha: 1.00)Color(uiColor: UIColor(red: 1.000, green: 1.000, blue: 1.000, alpha: 1.00))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 / Space | Light Appearance | Dark Appearance | Swift Code Literal |
|---|---|---|---|
| HEX Code | #FFFFFF | #FFFFFF | Color(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 / HSB | hsl(0, 0%, 100%) | hsl(0, 0%, 100%) | Color(hue:sat:bri:) |
| Platform Bridge | UIKit: UIColor.white | AppKit: NSColor.white | Color(uiColor:) / Color(nsColor:) |
Light Appearance
#FFFFFFrgb(255, 255, 255)hsl(0, 0%, 100%)(r: 1.000, g: 1.000, b: 1.000)Dark Appearance
#FFFFFFrgb(255, 255, 255)hsl(0, 0%, 100%)(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.
Contents.json inside Assets.xcassets/White.colorset/{
"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.
●SwiftUI Notification
Just nowDemonstrates how Apple designers pair system background tints with dynamic White accents.
.foregroundStyle(.white)
Platform Implementation Snippets
Ready-to-use Swift code for SwiftUI, UIKit, and AppKit applications.
// 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.
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.
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.