macOS Grid
NSColor.gridColorComplete technical specification and developer reference for Grid in Apple's macOS design system. In light appearance, it resolves to HEX #E6E6E6; in dark appearance, it dynamically adapts to HEX #1A1A1A. Features wide-gamut Display P3 values, UIKit bridge (UIColor.gridColor), AppKit bridge (NSColor.gridColor), WCAG contrast audit, and Xcode drop-in initializers.
The grid lines of an interface element, such as a table.
ColorNSColor.gridColorColor(red: 0.902, green: 0.902, blue: 0.902)Color(red: 0.902, green: 0.902, blue: 0.902, opacity: 1.00)Color(hue: 0.000, saturation: 0.000, brightness: 0.902, opacity: 1.00)Color(.displayP3, red: 0.902, green: 0.902, blue: 0.902, opacity: 1.00)Color(.sRGB, red: 0.902, green: 0.902, blue: 0.902, opacity: 1.00)Color(hex: "#E6E6E6")#colorLiteral(red: 0.902, green: 0.902, blue: 0.902, alpha: 1.00)Color(uiColor: UIColor(red: 0.902, green: 0.902, blue: 0.902, 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 | #E6E6E6 | #1A1A1A | Color(hex: "#E6E6E6") |
| sRGB (0–255) | rgb(230, 230, 230) | rgb(26, 26, 26) | (r: 0.902, g: 0.902, b: 0.902) |
| Display P3 (Wide Gamut) | P3 (0.902, 0.902, 0.902) | P3 (0.102, 0.102, 0.102) | Color(.displayP3, ...) |
| HSL / HSB | hsl(0, 0%, 90%) | hsl(0, 0%, 10%) | Color(hue:sat:bri:) |
| Platform Bridge | UIKit: UIColor.gridColor | AppKit: NSColor.gridColor | Color(uiColor:) / Color(nsColor:) |
Light Appearance
#E6E6E6rgb(230, 230, 230)hsl(0, 0%, 90%)(r: 0.902, g: 0.902, b: 0.902)Dark Appearance
#1A1A1Argb(26, 26, 26)hsl(0, 0%, 10%)(r: 0.102, g: 0.102, b: 0.102)Drop-In Developer Snippets
Ready-to-paste code blocks for Xcode asset catalogs and Swift files.
Contents.json inside Assets.xcassets/Grid.colorset/{
"colors": [
{
"color": {
"color-space": "srgb",
"components": {
"red": "0.902",
"green": "0.902",
"blue": "0.902",
"alpha": "1.000"
}
},
"idiom": "universal"
},
{
"appearances": [
{
"appearance": "luminosity",
"value": "dark"
}
],
"color": {
"color-space": "srgb",
"components": {
"red": "0.102",
"green": "0.102",
"blue": "0.102",
"alpha": "1.000"
}
},
"idiom": "universal"
}
],
"info": {
"author": "xcode",
"version": 1
}
}Live UI Component Sandbox
Preview Color.grid inside standard Apple interface components.
●SwiftUI Notification
Just nowDemonstrates how Apple designers pair system background tints with dynamic Grid accents.
.foregroundStyle(NSColor.gridColor)
Platform Implementation Snippets
Ready-to-use Swift code for SwiftUI, UIKit, and AppKit applications.
// AppKit (macOS)
let button = NSButton()
button.contentTintColor = NSColor.gridColor
// Custom Layer Tint
let layer = CALayer()
layer.backgroundColor = NSColor.gridColor.cgColor
// Bridging AppKit into SwiftUI
let swiftUIColor = Color(nsColor: .gridColor)WCAG 2.1 Accessibility Contrast Audit
Contrast calculations of Grid against pure white and iOS OLED dark surfaces.
Recommended HIG Use Cases
- Table grid lines and list dividers
- Sidebar demarcation borders
- Status bar dividers
Anti-Patterns to Avoid
- Interactive button text
- Solid icon fills
Browse More macOS Colors
Quickly jump to other Apple system colors and semantic tokens.
Frequently Asked Questions
How do I use NSColor.gridColor in macOS AppKit apps?
In AppKit, assign NSColor.gridColor to NSView, NSTextField, or NSButton styling. In SwiftUI on macOS, bridge it using Color(nsColor: .gridColor).
What is the HEX code for macOS Grid in light and dark mode?
In light appearance, Grid resolves to #E6E6E6. In dark appearance, it automatically adapts to #1A1A1A.
How do I bridge NSColor.gridColor into SwiftUI?
In SwiftUI views on macOS, instantiate Color(nsColor: .gridColor) to access the native AppKit dynamic color token.
Does Grid adapt to Dark Mode and vibrancy in macOS?
Yes, NSColor.gridColor is an appearance-aware NSColor that updates automatically when switching between light and dark modes or across vibrant desktop materials.
Why use AppKit system colors instead of hardcoded hex values?
NSColor system tokens adapt automatically to user accent color preferences, Dark Mode, and accessibility contrast settings.