---
title: "init(deviceHue:saturation:brightness:alpha:)"
framework: appkit
role: symbol
role_heading: Initializer
path: "appkit/nscolor/init(devicehue:saturation:brightness:alpha:)"
---

# init(deviceHue:saturation:brightness:alpha:)

Creates a color object using the given opacity value and HSB color space components.

## Declaration

```swift
init(deviceHue hue: CGFloat, saturation: CGFloat, brightness: CGFloat, alpha: CGFloat)
```

## Parameters

- `hue`: The hue component of the color object.
- `saturation`: The saturation component of the color object.
- `brightness`: The brightness component of the color object.
- `alpha`: The opacity value of the color object.

## Return Value

Return Value The color object.

## Discussion

Discussion Values below 0.0 are interpreted as 0.0, and values above 1.0 are interpreted as 1.0.

## See Also

### Related Documentation

- [getHue(_:saturation:brightness:alpha:)](appkit/nscolor/gethue(_:saturation:brightness:alpha:).md)
- [init(deviceRed:green:blue:alpha:)](appkit/nscolor/init(devicered:green:blue:alpha:).md)

### Creating a color using HSB components

- [init(calibratedHue:saturation:brightness:alpha:)](appkit/nscolor/init(calibratedhue:saturation:brightness:alpha:).md)
- [init(hue:saturation:brightness:alpha:)](appkit/nscolor/init(hue:saturation:brightness:alpha:).md)
- [init(colorSpace:hue:saturation:brightness:alpha:)](appkit/nscolor/init(colorspace:hue:saturation:brightness:alpha:).md)
