CRColorPicker icon indicating copy to clipboard operation
CRColorPicker copied to clipboard

Convert from color to touch point

Open amoshsueh opened this issue 9 years ago • 2 comments

Hello, it's a nice and clean control. Is any way to convert from color to touch point? Thank you very much.

amoshsueh avatar Sep 11 '15 11:09 amoshsueh

Hello, it is an over control. Maybe a touch grid control, not a color picker. But yes it easy but I need to create it.

Or in CRColorPicker.m (https://github.com/Cclleemm/CRColorPicker/blob/master/CRColorPicker/CRColorPicker/CRColorPicker.m#L84)

you can add an over method like that :

-(void)touchesMoved:(NSSet *)touches withEvent:(UIEvent *)event
{
     UITouch *touch = [touches anyObject];
    CGPoint touchPoint = [touch locationInView:self];
    [self positionWithTouchPoint:touchPoint];
    if(self.delegate!=nil){
        if([self.delegate respondsToSelector:@selector(positionIsChanging:)]){
            [self.delegate positionIsChanging:touchPoint];
        }
    }
}

Cclleemm avatar Sep 16 '15 15:09 Cclleemm

Hello,

Sorry I don't get it. I want to add a circle view on the color picker. When the touch moves, the circle view will present the color of point. This part is already finished, now I want to add an initial color for the circle view and set the circle view to the right position on the color picker. So my question is there any way to convert from color to touch point? Something like: (CGPoint)touchPointFromColor:(UIColor *)color

Thanks, Amos

amoshsueh avatar Sep 16 '15 15:09 amoshsueh