Я использую фильтр Hue для изменения оттенка изображения, минимум слайдера: -3.14 максимум слайдера: 3.14 Я получаю оттенок с более темными цветами, в то время как Photoshop имеет более светлую версию.Может кто-нибудь помочь мне с этим?![enter image description here](https://i.stack.imgur.com/x9wHc.png)
![enter image description here](https://i.stack.imgur.com/kGLab.png)
func rotateHue(with ciImage: CIImage,
rotatedByHue deltaHueRadians: CGFloat,
orientation:UIImageOrientation?,
screenWidth:CGFloat,
screenHeight:CGFloat) -> UIImage {
// Create a Core Image version of the image.
let sourceCore = ciImage
let resultCore = CIFilter(name: "CIHueAdjust",
withInputParameters: [kCIInputImageKey: sourceCore,
kCIInputAngleKey: deltaHueRadians])?.outputImage?
.cropped(to: sourceCore.extent)
// Convert the filter output back into a UIImage.
let context = CIContext(options: nil)
// let resultRef = context.createCGImage((vignette?.outputImage)!, from: (vignette?.outputImage!.extent)!)
let resultRef = context.createCGImage(resultCore!, from: (resultCore!.extent))
var result:UIImage? = nil
if(orientation != nil){
result = UIImage(cgImage: resultRef!, scale: 1.0, orientation: orientation!)
}else{
result = UIImage(cgImage: resultRef!)
}
return result!
}