Contents

hueSaturationValueGradient()

Generates a gradient representing a specified color space.

Declaration

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 CGColorSpace.

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

colorSpace

A 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 NSNumber.

softness

A float representing the softness of the generated color wheel as an NSNumber.

value

A float representing 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]

See Also

Filters