hueSaturationValueGradient()
Generates a gradient representing a specified color space.
Declaration
class func hueSaturationValueGradient() -> any CIFilter & CIHueSaturationValueGradientReturn 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 CGColorSpace.
The hue-saturation-value gradient uses the following properties:
colorSpaceA CGColorSpace representing the color space for the generated color wheel.
ditherA
booleanvalue specifying whether the distort the generated output.radiusA
floatrepresenting the distance from the center of the effect as an NSNumber.softnessA
floatrepresenting the softness of the generated color wheel as an NSNumber.valueA
floatrepresenting the lightness of the hue-saturation gradient as an NSNumber.
The following code creates a filter that generates a color-space image:
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!
}[Image]