<!--
{
  "availability" : [
    "iOS: 13.0.0 -",
    "iPadOS: 13.0.0 -",
    "macCatalyst: 13.1.0 -",
    "macOS: 10.15.0 -",
    "tvOS: 13.0.0 -",
    "visionOS: 1.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "CoreImage",
  "identifier" : "/documentation/CoreImage/CIFilter-swift.class/sunbeamsGenerator()",
  "metadataVersion" : "0.1.0",
  "role" : "Type Method",
  "symbol" : {
    "kind" : "Type Method",
    "modules" : [
      "Core Image",
      "CoreImage"
    ],
    "preciseIdentifier" : "c:objc(cs)CIFilter(cm)sunbeamsGeneratorFilter"
  },
  "title" : "sunbeamsGenerator()"
}
-->

# sunbeamsGenerator()

Generates an image resembling the sun.

```
class func sunbeamsGenerator() -> any CIFilter & CISunbeamsGenerator
```

## Return Value

The generated image.

## Discussion

This method generates a sunbeam as an image. The effect generates a center-textured sun with striations. You can combine with other filters to create more sophisticated images.

The sunbeams generator filter uses the following properties:

- `center`: A vector representing the center of the image as a [`CIVector`](/documentation/CoreImage/CIVector).
- `color`: A [`CIColor`](/documentation/CoreImage/CIColor) representing the color of the sun.
- `sunRadius`: A `float` representing the radius of the center sun as an <doc://com.apple.documentation/documentation/Foundation/NSNumber>.
- `maxStriationRadius`: A `float` representing the striation radius as an <doc://com.apple.documentation/documentation/Foundation/NSNumber>.
- `striationStrength`: A `float` representing the striation strength as an <doc://com.apple.documentation/documentation/Foundation/NSNumber>.
- `striationContrast`: A `float` representing the striation contrast as an <doc://com.apple.documentation/documentation/Foundation/NSNumber>.
- `time`: A `float` representing the time as an <doc://com.apple.documentation/documentation/Foundation/NSNumber>.

The following code creates a filter that generates an image that resembles a yellow sun with sunbeams:

```swift
    func sunBeam () -> CIImage {
        let sunBeamGenerator = CIFilter.sunbeamsGenerator()
        sunBeamGenerator.center = CGPoint(x: 150, y: 150)
        sunBeamGenerator.color = CIColor(red: 0.96, green: 1, blue: 1, alpha: 1)
        sunBeamGenerator.sunRadius = 40
        sunBeamGenerator.maxStriationRadius = 2.58
        sunBeamGenerator.striationStrength = 0.50
        sunBeamGenerator.striationContrast = 1.38
        sunBeamGenerator.time = 0
        return sunBeamGenerator.outputImage!
    }
```

![An image of a hazy yellow and white ball with lines of color gradually fading to the periphery.](images/com.apple.coreimage/media-3546315@2x.png)

---

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)