<!--
{
  "availability" : [
    "iOS: 2.0.0 -",
    "iPadOS: 2.0.0 -",
    "macCatalyst: 13.1.0 -",
    "macOS: 10.2.0 -",
    "tvOS: -",
    "visionOS: 1.0.0 -",
    "watchOS: 2.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "CoreGraphics",
  "identifier" : "/documentation/CoreGraphics/CGShading/init(radialSpace:start:startRadius:end:endRadius:function:extendStart:extendEnd:)",
  "metadataVersion" : "0.1.0",
  "role" : "Initializer",
  "symbol" : {
    "kind" : "Initializer",
    "modules" : [
      "Core Graphics",
      "CoreGraphics"
    ],
    "preciseIdentifier" : "c:@F@CGShadingCreateRadial"
  },
  "title" : "init(radialSpace:start:startRadius:end:endRadius:function:extendStart:extendEnd:)"
}
-->

# init(radialSpace:start:startRadius:end:endRadius:function:extendStart:extendEnd:)

Creates a shading object to use for radial shading.

```
init?(radialSpace space: CGColorSpace, start: CGPoint, startRadius: CGFloat, end: CGPoint, endRadius: CGFloat, function: CGFunction, extendStart: Bool, extendEnd: Bool)
```

## Parameters

`space`

The color space in which color values are expressed. Core Graphics retains this object; upon return, you may safely release it.

`start`

The center of the starting circle, in the shading’s target coordinate space.

`startRadius`

The radius of the starting circle, in the shading’s target coordinate space.

`end`

The center of the ending circle, in the shading’s target coordinate space.

`endRadius`

The radius of the ending circle, in the shading’s target coordinate space.

`function`

A CGFunction object created by the function [`init(info:domainDimension:domain:rangeDimension:range:callbacks:)`](/documentation/CoreGraphics/CGFunction/init(info:domainDimension:domain:rangeDimension:range:callbacks:)). This object refers to your function for creating a radial shading. Core Graphics retains this object; upon return, you may safely release it.

`extendStart`

A Boolean value that specifies whether to extend the shading beyond the starting circle.

`extendEnd`

A Boolean value that specifies whether to extend the shading beyond the ending circle.

## Return Value

A new Core Graphics radial shading. In Objective-C, you’re responsible for releasing this object using [`CGShadingRelease`](/documentation/CoreGraphics/CGShadingRelease).

## Discussion

A radial shading is a color blend that varies between two circles. To draw the shading, call the function [`drawShading(_:)`](/documentation/CoreGraphics/CGContext/drawShading(_:)).

---

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)