---
title: "getRed(_:green:blue:alpha:)"
framework: uikit
role: symbol
role_heading: Instance Method
path: "uikit/uicolor/getred(_:green:blue:alpha:)"
---

# getRed(_:green:blue:alpha:)

Returns the components that form the color in the RGB color space.

## Declaration

```swift
func getRed(_ red: UnsafeMutablePointer<CGFloat>?, green: UnsafeMutablePointer<CGFloat>?, blue: UnsafeMutablePointer<CGFloat>?, alpha: UnsafeMutablePointer<CGFloat>?) -> Bool
```

## Parameters

- `red`: On return, the red component of the color object. On applications linked for iOS 10 or later, an extended range sRGB color space specifies the red component and can have any value. Values between 0.0 and 1.0 are inside the sRGB color gamut. On earlier versions of iOS, the specified value is always between 0.0 and 1.0.
- `green`: On return, the green component of the color object. On applications linked for iOS 10 or later,an extended range sRGB color space specifies the green component and can have any value. Values between 0.0 and 1.0 are inside the sRGB color gamut. On earlier versions of iOS, the specified value is always between 0.0 and 1.0.
- `blue`: On return, the blue component of the color object. On applications linked for iOS 10 or later, an extended range sRGB color space specifies the blue component and can have any value. Values between 0.0 and 1.0 are inside the sRGB color gamut. On earlier versions of iOS, the specified value is always between 0.0 and 1.0.
- `alpha`: On return, the opacity component of the color object, specified as a value between 0.0 and 1.0.

## Return Value

Return Value true if the color could be converted, false otherwise.

## Discussion

Discussion If the color is in a compatible color space, it converts into RGB format and its components return to your application. If the color isn’t in a compatible color space, the parameters don’t change.

## See Also

### Getting the color information

- [Determining color values with color spaces](uikit/determining-color-values-with-color-spaces.md)
- [cgColor](uikit/uicolor/cgcolor.md)
- [ciColor](uikit/uicolor/cicolor.md)
- [getHue(_:saturation:brightness:alpha:)](uikit/uicolor/gethue(_:saturation:brightness:alpha:).md)
- [getWhite(_:alpha:)](uikit/uicolor/getwhite(_:alpha:).md)
- [linearExposure](uikit/uicolor/linearexposure.md)
- [accessibilityName](uikit/uicolor/accessibilityname.md)
