Skip to content

Instantly share code, notes, and snippets.

@prafullakumar
Created June 21, 2020 15:43
Show Gist options
  • Save prafullakumar/cefcb6c96e3fec691ca0d854191fb0b7 to your computer and use it in GitHub Desktop.
Save prafullakumar/cefcb6c96e3fec691ca0d854191fb0b7 to your computer and use it in GitHub Desktop.
private func updateColor(image: CIImage) -> CIImage? {
guard let colorFilter = CIFilter(name: "CIFalseColor") else { return nil }
colorFilter.setValue(image, forKey: kCIInputImageKey)
colorFilter.setValue(color, forKey: "inputColor0")
colorFilter.setValue(backgroundColor, forKey: "inputColor1")
return colorFilter.outputImage
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment