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

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

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

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

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`](/documentation/AppKit/NSColorSpaceName/calibratedRGB) or [`deviceRGB`](/documentation/AppKit/NSColorSpaceName/deviceRGB) color space. Sending it to other objects raises an exception.

## See Also

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

The brightness component value of the color.

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

The hue component value of the color.

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

The alpha (opacity) component value of the color.

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

The saturation component value 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)