Can anybody know how to get touch color of UIView
? When I touch on a view then I want the color which is on touched area of the view.
Thx
Asked
Active
Viewed 426 times
1 Answers
2
You can use this open source library for doing this.
It's a category of UIView
with additional features.
After adding this you can get the color like:
- (void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event
{
UITouch *touch = [[event allTouches] anyObject];
NSLog("%@",[self colorOfPoint:[touch locationInView:self]]);
}
Also check iPhone UIImage Pixel Color
Here is a link to another thread in SO