To run the example project, clone the repo, and run pod install
from the Example directory first.
@property (nonatomic) IBOutlet RSColorPickerView *colorPicker;
- (void)awakeFromNib {
[super awakeFromNib];
if(_colorPicker && _brightnessSlider && _opacitySlider){
_colorPicker.delegate = self;
_brightnessSlider.delegate = self;
_opacitySlider.delegate = self;
}
}
// Implement RSColorPickerViewDelegate
- (void)colorPickerDidChangeSelection:(RSColorPickerView *)colorPicker {
UIColor *selectedColor = [colorPicker selectionColor];
//todo: something ......
}
// Implement RSBrightnessSliderDelegate
- (void)brightnessSlide:(RSBrightnessSlider *)brightnessSlider valueChanged:(float)value {
[_colorPicker setBrightness:value];
}
// Implement RSOpacitySliderDelegate
- (void)opacitySlider:(RSOpacitySlider *)opacitySlider opacityChanged:(float)value {
[_colorPicker setOpacity:value];
}
LWColorPicker is available through CocoaPods. To install it, simply add the following line to your Podfile:
pod 'LWColorPicker'
Carthage
github "luowei/LWColorPicker"
luowei, luowei@wodedata.com
LWColorPicker is available under the MIT license. See the LICENSE file for more info.