---
title: "getHue(_:saturation:brightness:alpha:)"
framework: appkit
role: symbol
role_heading: Instance Method
path: "appkit/nscolor/gethue(_:saturation:brightness:alpha:)"
---

# getHue(_:saturation:brightness:alpha:)

Returns the color object’s HSB component and opacity values in the respective arguments.

## Declaration

```swift
func getHue(_ hue: UnsafeMutablePointer<CGFloat>?, saturation: UnsafeMutablePointer<CGFloat>?, brightness: UnsafeMutablePointer<CGFloat>?, alpha: UnsafeMutablePointer<CGFloat>?)
```

## Parameters

- `hue`: Upon return, contains the hue component of the color object.
- `saturation`: Upon return, contains the saturation component of the color object.
- `brightness`: Upon return, contains the brightness component 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 calibratedRGB or deviceRGB color space. Sending it to other objects raises an exception.

## See Also

### Related Documentation

- [brightnessComponent](appkit/nscolor/brightnesscomponent.md)
- [hueComponent](appkit/nscolor/huecomponent.md)
- [alphaComponent](appkit/nscolor/alphacomponent.md)
- [saturationComponent](appkit/nscolor/saturationcomponent.md)

### Retrieving component values from color objects

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