libcolorpicker.h 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. #import <UIKit/UIKit.h>
  2. #ifdef __cplusplus /* If this is a C++ compiler, use C linkage */
  3. extern "C" {
  4. #endif
  5. UIColor *LCPParseColorString(NSString *colorStringFromPrefs, NSString *colorStringFallback);
  6. //old DONT USE
  7. UIColor *colorFromDefaultsWithKey(NSString *defaults, NSString *key, NSString *fallback);
  8. #ifdef __cplusplus /* If this is a C++ compiler, end C linkage */
  9. }
  10. #endif
  11. @interface UIColor (PFColor)
  12. + (UIColor *)PF_colorWithHex:(NSString *)hexString;
  13. + (NSString *)hexFromColor:(UIColor *)color;
  14. @property (nonatomic, assign, readonly) CGFloat alpha;
  15. @property (nonatomic, assign, readonly) CGFloat red;
  16. @property (nonatomic, assign, readonly) CGFloat green;
  17. @property (nonatomic, assign, readonly) CGFloat blue;
  18. @property (nonatomic, assign, readonly) CGFloat hue;
  19. @property (nonatomic, assign, readonly) CGFloat saturation;
  20. @property (nonatomic, assign, readonly) CGFloat brightness;
  21. - (UIColor *)desaturate:(CGFloat)percent;
  22. - (UIColor *)lighten:(CGFloat)percent;
  23. - (UIColor *)darken:(CGFloat)percent;
  24. @end
  25. @interface PFColorAlert : NSObject
  26. // DO NOT USE OLD METHOD
  27. //- (void)showWithStartColor:(UIColor *)startColor showAlpha:(BOOL)showAlpha completion:(void (^)(UIColor *pickedColor))completionBlock;
  28. + (PFColorAlert *)colorAlertWithStartColor:(UIColor *)startColor showAlpha:(BOOL)showAlpha;
  29. - (PFColorAlert *)initWithStartColor:(UIColor *)startColor showAlpha:(BOOL)showAlpha;
  30. - (void)displayWithCompletion:(void (^)(UIColor *pickedColor))fcompletionBlock;
  31. - (void)close;
  32. @end
  33. @interface PFLiteColorCell : UITableViewCell
  34. - (id)initWithStyle:(long long)style reuseIdentifier:(id)identifier specifier:(id)specifier;
  35. - (UIColor *)previewColor; // this will be used for the circle preview view. override in a subclass
  36. - (id)specifier;
  37. - (void)updateCellDisplay;
  38. @end
  39. @interface PFSimpleLiteColorCell : PFLiteColorCell
  40. @end