<!--
{
  "availability" : [
    "iOS: 5.0.0 -",
    "iPadOS: 5.0.0 -",
    "macCatalyst: 13.1.0 -",
    "macOS: 10.4.0 -",
    "tvOS: -",
    "visionOS: 1.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "CoreImage",
  "identifier" : "/documentation/CoreImage/CIColor/colorWithRed:green:blue:alpha:",
  "metadataVersion" : "0.1.0",
  "role" : "Type Method",
  "symbol" : {
    "kind" : "Type Method",
    "modules" : [
      "Core Image"
    ],
    "preciseIdentifier" : "c:objc(cs)CIColor(cm)colorWithRed:green:blue:alpha:"
  },
  "title" : "colorWithRed:green:blue:alpha:"
}
-->

# colorWithRed:green:blue:alpha:

Create a Core Image color object in the sRGB color space
with the specified red, green, blue, and alpha component values.

```
+ (instancetype) colorWithRed:(CGFloat) red green:(CGFloat) green blue:(CGFloat) blue alpha:(CGFloat) alpha;
```

## Parameters

`red`

The color’s unpremultiplied red component value between 0 and 1.

`green`

The color’s unpremultiplied green component value between 0 and 1.

`blue`

The color’s unpremultiplied blue component value between 0 and 1.

`alpha`

The color’s alpha (opacity) value between 0 and 1.

## Return Value


An autoreleased [`CIColor`](/documentation/CoreImage/CIColor) instance.

## Discussion

On macOS before 10.10, the CIColor’s color space will be Generic RGB.

---

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)