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

# getWhite(_:alpha:)

Returns the grayscale and alpha values of the color.

```
func getWhite(_ white: UnsafeMutablePointer<CGFloat>?, alpha: UnsafeMutablePointer<CGFloat>?)
```

## Parameters

`white`

Upon return, contains the grayscale value of the color object.

`alpha`

Upon return, contains the opacity value of the color object.

## Discussion

If `NULL` is passed in as an argument, the method doesn’t set that value. This method works only with objects representing colors in the [`calibratedWhite`](/documentation/AppKit/NSColorSpaceName/calibratedWhite), [`NSCalibratedBlackColorSpace`](/documentation/AppKit/NSCalibratedBlackColorSpace), [`NSDeviceBlackColorSpace`](/documentation/AppKit/NSDeviceBlackColorSpace), or [`deviceWhite`](/documentation/AppKit/NSColorSpaceName/deviceWhite) color space. Sending it to other objects raises an exception.

## See Also

[`NSColor`](/documentation/AppKit/NSColor)

An object that stores color data and sometimes opacity (alpha value).



---

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)