<!--
{
  "availability" : [
    "macOS: -"
  ],
  "documentType" : "symbol",
  "framework" : "AppKit",
  "identifier" : "/documentation/AppKit/NSColor/init(calibratedRed:green:blue:alpha:)",
  "metadataVersion" : "0.1.0",
  "role" : "Initializer",
  "symbol" : {
    "kind" : "Initializer",
    "modules" : [
      "AppKit"
    ],
    "preciseIdentifier" : "c:objc(cs)NSColor(cm)colorWithCalibratedRed:green:blue:alpha:"
  },
  "title" : "init(calibratedRed:green:blue:alpha:)"
}
-->

# init(calibratedRed:green:blue:alpha:)

Creates a color object using the given opacity and RGB components.

```
init(calibratedRed red: CGFloat, green: CGFloat, blue: CGFloat, alpha: CGFloat)
```

## Parameters

`red`

The red component of the color object.

`green`

The green component of the color object.

`blue`

The blue component of the color object.

`alpha`

The opacity value of the color object.

## Return Value

The color object.

## Discussion

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

## See Also

[`getRed(_:green:blue:alpha:)`](/documentation/AppKit/NSColor/getRed(_:green:blue:alpha:))

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

[`init(calibratedHue:saturation:brightness:alpha:)`](/documentation/AppKit/NSColor/init(calibratedHue:saturation:brightness:alpha:))

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



---

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)