Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Convert from color to touch point #1

Open
amoshsueh opened this issue Sep 11, 2015 · 2 comments
Open

Convert from color to touch point #1

amoshsueh opened this issue Sep 11, 2015 · 2 comments

Comments

@amoshsueh
Copy link

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

@Cclleemm
Copy link
Owner

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];
        }
    }
}

@amoshsueh
Copy link
Author

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants