<!--
{
  "availability" : [
    "macOS: -"
  ],
  "documentType" : "symbol",
  "framework" : "AppKit",
  "identifier" : "/documentation/AppKit/NSColor/whiteComponent",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Property",
  "symbol" : {
    "kind" : "Instance Property",
    "modules" : [
      "AppKit"
    ],
    "preciseIdentifier" : "c:objc(cs)NSColor(py)whiteComponent"
  },
  "title" : "whiteComponent"
}
-->

# whiteComponent

The white component value of the color.

```
var whiteComponent: CGFloat { get }
```

## Discussion

Access this property only for colors in the [`calibratedWhite`](/documentation/AppKit/NSColorSpaceName/calibratedWhite), [`NSCalibratedBlackColorSpace`](/documentation/AppKit/NSCalibratedBlackColorSpace), [`NSDeviceBlackColorSpace`](/documentation/AppKit/NSDeviceBlackColorSpace), or [`deviceWhite`](/documentation/AppKit/NSColorSpaceName/deviceWhite) color spaces. Accessing it for other color types raises an exception.

## See Also

[`getWhite(_:alpha:)`](/documentation/AppKit/NSColor/getWhite(_:alpha:))

Returns the grayscale and alpha values of the color.



---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)