---
title: "getWhite(_:alpha:)"
framework: appkit
role: symbol
role_heading: Instance Method
path: "appkit/nscolor/getwhite(_:alpha:)"
---

# getWhite(_:alpha:)

Returns the grayscale and alpha values of the color.

## Declaration

```swift
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

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, NSCalibratedBlackColorSpace, NSDeviceBlackColorSpace, or deviceWhite color space. Sending it to other objects raises an exception.

## See Also

### Related Documentation

- [NSColor](appkit/nscolor.md)

### Retrieving component values from color objects

- [getCyan(_:magenta:yellow:black:alpha:)](appkit/nscolor/getcyan(_:magenta:yellow:black:alpha:).md)
- [getHue(_:saturation:brightness:alpha:)](appkit/nscolor/gethue(_:saturation:brightness:alpha:).md)
- [getRed(_:green:blue:alpha:)](appkit/nscolor/getred(_:green:blue:alpha:).md)
- [numberOfComponents](appkit/nscolor/numberofcomponents.md)
- [getComponents(_:)](appkit/nscolor/getcomponents(_:).md)
