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

# hueComponent

The hue component value of the color.

```
var hueComponent: CGFloat { get }
```

## Discussion

Access this property only for colors in the [`calibratedRGB`](/documentation/AppKit/NSColorSpaceName/calibratedRGB) or [`deviceRGB`](/documentation/AppKit/NSColorSpaceName/deviceRGB) color spaces. RGB values are converted to HSB values as needed. Accessing it for other color types raises an exception.

## See Also

[`getHue(_:saturation:brightness:alpha:)`](/documentation/AppKit/NSColor/getHue(_:saturation:brightness:alpha:))

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



---

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)