macOS Grid

NSColor.gridColor
Visual Structure & Grid Lines
Adaptive System Token•macOS 10.10+ / 10.14+, AppKit

Complete 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.

Light Mode#E6E6E6
Dark Mode#1A1A1A
Grid Color Preview

The grid lines of an interface element, such as a table.

ColorNSColor.gridColor
Copy:
Dynamic Asset
Visual Structure & Grid Lines
macOS 10.10+ / 10.14+, AppKit
Initializers & Color Spaces
Color(r:g:b:)Color(red: 0.902, green: 0.902, blue: 0.902)
Color(r:g:b:op:)Color(red: 0.902, green: 0.902, blue: 0.902, opacity: 1.00)
Color(hue:sat:bri:)HSBColor(hue: 0.000, saturation: 0.000, brightness: 0.902, opacity: 1.00)
Color(.displayP3)Wide GamutColor(.displayP3, red: 0.902, green: 0.902, blue: 0.902, opacity: 1.00)
Color(.sRGB)Color(.sRGB, red: 0.902, green: 0.902, blue: 0.902, opacity: 1.00)
Color(hex:)ExtensionColor(hex: "#E6E6E6")
#colorLiteralXcode#colorLiteral(red: 0.902, green: 0.902, blue: 0.902, alpha: 1.00)
Color(uiColor:)iOSColor(uiColor: UIColor(red: 0.902, green: 0.902, blue: 0.902, alpha: 1.00))
Active HEX: #E6E6E6P3 R: 0.902 G: 0.902 B: 0.902

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#E6E6E6#1A1A1AColor(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 / HSBhsl(0, 0%, 90%)hsl(0, 0%, 10%)Color(hue:sat:bri:)
Platform BridgeUIKit: UIColor.gridColorAppKit: NSColor.gridColorColor(uiColor:) / Color(nsColor:)

Light Appearance

Light Theme
HEX Code
#E6E6E6
RGB (0–255)
rgb(230, 230, 230)
HSL
hsl(0, 0%, 90%)
Normalized Swift Literal:
(r: 0.902, g: 0.902, b: 0.902)

Dark Appearance

Dark Theme
HEX Code
#1A1A1A
RGB (0–255)
rgb(26, 26, 26)
HSL
hsl(0, 0%, 10%)
Normalized Swift Literal:
(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.

Xcode Location: Save as Contents.json inside Assets.xcassets/Grid.colorset/
Includes Light + Dark Modes
Contents.json
{
  "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.

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

●SwiftUI Notification

Just now

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

Dynamic Headline in Grid

.foregroundStyle(NSColor.gridColor)

Platform Implementation Snippets

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

AppKit (macOS Swift)
// 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.

Light Mode (#E6E6E6)on White (#FFF)
Contrast Ratio:1.25:1
Normal Text (4.5:1 AA): Fail
Dark Mode (#1A1A1A)on Dark (#1C1C1E)
Contrast Ratio:1.02:1
Normal Text (4.5:1 AA): Fail

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

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.