I am using the following code to change hue of UIImage
UIImage *image = [UIImage imageNamed:@"Image.png"];
// Create a Core Image version of the image.
CIImage *sourceCore = [CIImage imageWithCGImage:[image CGImage]];
// Apply a CIHueAdjust filter
CIFilter *hueAdjust = [CIFilter filterWithName:@"CIHueAdjust"];
[hueAdjust setDefaults];
[hueAdjust setValue: sourceCore forKey: @"inputImage"];
[hueAdjust setValue: [NSNumber numberWithFloat: 1.0f] forKey: @"inputAngle"];
CIImage *resultCore = [hueAdjust valueForKey: @"outputImage"];
// Convert the filter output back into a UIImage.
CIContext *context = [CIContext contextWithOptions:nil];
CGImageRef resultRef = [context createCGImage:resultCore fromRect:[resultCore extent]];
UIImage *result = [UIImage imageWithCGImage:resultRef];
CGImageRelease(resultRef);
The code works fine, i'm just trying to find a way to get the correct NSNumber values of inputAngle for the specific colors.
so can i maybe:
- Get the value by converting a
[UIColor colorWithRed:0.89 green:0.718 blue:0.102 alpha:1.0]
- or maybe just use the UIColor in some way ?
- or is there any list with the specific numbers for each color ?
The docs says:
Thanks in advance