Skip to content

Commit

Permalink
adding delegate hooks to setBrightness and setOpacity
Browse files Browse the repository at this point in the history
  • Loading branch information
vphamdev committed Oct 16, 2013
1 parent f808bfe commit 95e0dfb
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions RSColorPicker/ColorPickerClasses/RSColorPickerView.m
Original file line number Diff line number Diff line change
Expand Up @@ -182,13 +182,21 @@ - (UIColor*)colorAtPoint:(CGPoint)point {
#pragma mark - Setters

- (void)setBrightness:(CGFloat)bright {
if ([self.delegate respondsToSelector:@selector(colorPicker:willChangeSelectionFromCurrentColor:)])
{
[self.delegate colorPicker:self willChangeSelectionFromCurrentColor:self.selectionColor];
}
_brightness = bright;

_gradientView.alpha = _brightness;
[self updateSelectionAtPoint:_selection];
}

- (void)setOpacity:(CGFloat)opacity {
if ([self.delegate respondsToSelector:@selector(colorPicker:willChangeSelectionFromCurrentColor:)])
{
[self.delegate colorPicker:self willChangeSelectionFromCurrentColor:self.selectionColor];
}
_opacity = opacity;

_opacityView.alpha = 1 - _opacity;
Expand Down

0 comments on commit 95e0dfb

Please sign in to comment.