<!--
{
  "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/hueSaturationValueGradient()",
  "metadataVersion" : "0.1.0",
  "role" : "Type Method",
  "symbol" : {
    "kind" : "Type Method",
    "modules" : [
      "Core Image",
      "CoreImage"
    ],
    "preciseIdentifier" : "c:objc(cs)CIFilter(cm)hueSaturationValueGradientFilter"
  },
  "title" : "hueSaturationValueGradient()"
}
-->

# hueSaturationValueGradient()

Generates a gradient representing a specified color space.

```
class func hueSaturationValueGradient() -> any CIFilter & CIHueSaturationValueGradient
```

## Return Value

The generated image.

## Discussion

This method generates a hue-saturation-value gradient image. The filter creates a color wheel that shows the hues and saturations for a specified <doc://com.apple.documentation/documentation/CoreGraphics/CGColorSpace>.

The hue-saturation-value gradient uses the following properties:

- `colorSpace`: A <doc://com.apple.documentation/documentation/CoreGraphics/CGColorSpace> representing the color space for the generated color wheel.
- `dither`: A `boolean` value specifying whether the distort the generated output.
- `radius`: A `float` representing the distance from the center of the effect as an <doc://com.apple.documentation/documentation/Foundation/NSNumber>.
- `softness`: A `float` representing the softness of the generated color wheel as an <doc://com.apple.documentation/documentation/Foundation/NSNumber>.
- `value`: A `float` representing the lightness of the hue-saturation gradient as an <doc://com.apple.documentation/documentation/Foundation/NSNumber>.

The following code creates a filter that generates a color-space image:

```swift
func hueSaturationValue() -> CIImage {
    let hueSaturationValueGradient = CIFilter.hueSaturationValueGradient()
    hueSaturationValueGradient.colorSpace = CGColorSpaceCreateDeviceRGB()
    hueSaturationValueGradient.dither = 1
    hueSaturationValueGradient.radius = 100
    hueSaturationValueGradient.softness = 2
    hueSaturationValueGradient.value = 1
    return hueSaturationValueGradient.outputImage!
}
```

![A circular image containing every color in the represented colorspace.](images/com.apple.coreimage/media-3558798@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)