├── .gitignore ├── ColorPicker ├── Base.lproj │ └── Main.storyboard ├── ColorAppDelegate.h ├── ColorAppDelegate.m ├── ColorDetectView.h ├── ColorDetectView.m ├── ColorMainViewController.h ├── ColorMainViewController.m ├── ColorRealTimeViewController.h ├── ColorRealTimeViewController.m ├── ColorSingleColorCell.h ├── ColorSingleColorCell.m ├── ColorSingleColorCell.xib ├── ColorViewController.h ├── ColorViewController.m ├── Images.xcassets │ ├── AppIcon.appiconset │ │ ├── 29-1.png │ │ ├── 29.png │ │ ├── 40-1.png │ │ ├── 40.png │ │ ├── 50.png │ │ ├── 57.png │ │ ├── 60.png │ │ ├── 72.png │ │ ├── 76.png │ │ └── Contents.json │ ├── LaunchImage.launchimage │ │ └── Contents.json │ ├── Main │ │ ├── icon1x1.imageset │ │ │ ├── Contents.json │ │ │ └── icon1x1(1).pdf │ │ ├── icon2x1.imageset │ │ │ ├── Contents.json │ │ │ └── icon2x1(1).pdf │ │ ├── icon3x1.imageset │ │ │ ├── Contents.json │ │ │ └── icon3x1(1).pdf │ │ ├── plus.imageset │ │ │ ├── Contents.json │ │ │ └── 加号x1.pdf │ │ ├── reminder.imageset │ │ │ ├── Contents.json │ │ │ └── 提示框x1.pdf │ │ └── tableViewPlaceHolder.imageset │ │ │ ├── Contents.json │ │ │ ├── 首页图x2.png │ │ │ └── 首页图x3.png │ ├── TransparentPixel.imageset │ │ ├── Contents.json │ │ └── TransparentPixel.png │ ├── colorView │ │ ├── RGBHex.imageset │ │ │ ├── Contents.json │ │ │ └── RGBX1.pdf │ │ ├── picker.imageset │ │ │ ├── Contents.json │ │ │ └── picker.png │ │ └── y 148.imageset │ │ │ ├── Contents.json │ │ │ ├── y 148.png │ │ │ └── y 148@2x.png │ └── realTimeUI │ │ ├── 0,23 B.imageset │ │ ├── 0,23 B.png │ │ └── Contents.json │ │ ├── 0,23.imageset │ │ ├── 0,23.png │ │ └── Contents.json │ │ ├── 0,817.imageset │ │ ├── 0,817.png │ │ └── Contents.json │ │ ├── 275,436.imageset │ │ ├── 275,436.png │ │ └── Contents.json │ │ ├── 500,883 B.imageset │ │ ├── 500,883 B.png │ │ └── Contents.json │ │ ├── 500,883 C.imageset │ │ ├── 500,883 C.png │ │ └── Contents.json │ │ └── 500,883.imageset │ │ ├── 500,883.png │ │ └── Contents.json ├── Launch Screen.xib ├── Main.storyboard ├── TouchColor-Info.plist ├── TouchColor-Prefix.pch ├── UIView+AnimationExtensions.h ├── UIView+AnimationExtensions.m ├── UIView+Tools.h ├── UIView+Tools.m ├── en.lproj │ └── InfoPlist.strings └── main.m ├── ColorPickerTests ├── ColorPickerTests.m ├── TouchColorTests-Info.plist └── en.lproj │ └── InfoPlist.strings ├── Podfile ├── Podfile.lock ├── README.md ├── TouchColor.xcodeproj ├── project.pbxproj └── project.xcworkspace │ ├── contents.xcworkspacedata │ ├── xcshareddata │ └── ColorPicker.xccheckout │ └── xcuserdata │ └── Mango.xcuserdatad │ ├── UserInterfaceState.xcuserstate │ └── WorkspaceSettings.xcsettings └── TouchColor.xcworkspace └── contents.xcworkspacedata /.gitignore: -------------------------------------------------------------------------------- 1 | # Created by https://www.gitignore.io 2 | 3 | ### Objective-C ### 4 | # Xcode 5 | # 6 | build/ 7 | *.pbxuser 8 | !default.pbxuser 9 | *.mode1v3 10 | !default.mode1v3 11 | *.mode2v3 12 | !default.mode2v3 13 | *.perspectivev3 14 | !default.perspectivev3 15 | xcuserdata 16 | *.xccheckout 17 | *.moved-aside 18 | DerivedData 19 | *.hmap 20 | *.ipa 21 | *.xcuserstate 22 | 23 | # CocoaPods 24 | # 25 | # We recommend against adding the Pods directory to your .gitignore. However 26 | # you should judge for yourself, the pros and cons are mentioned at: 27 | # http://guides.cocoapods.org/using/using-cocoapods.html#should-i-ignore-the-pods-directory-in-source-control 28 | # 29 | Pods/ 30 | 31 | *.xcuserstate 32 | 33 | *.xcuserstate 34 | 35 | *.xcuserstate 36 | 37 | ColorPicker.xcworkspace/xcuserdata/Mango.xcuserdatad/UserInterfaceState.xcuserstate 38 | 39 | ColorPicker.xcodeproj/xcuserdata/Mango.xcuserdatad/xcschemes/ColorPicker.xcscheme 40 | 41 | Pods/Pods.xcodeproj/project.pbxproj 42 | 43 | Pods/Pods.xcodeproj/xcuserdata/Mango.xcuserdatad/xcschemes/Pods-GPUImage.xcscheme 44 | 45 | Pods/Pods.xcodeproj/xcuserdata/Mango.xcuserdatad/xcschemes/Pods.xcscheme 46 | 47 | Pods/GPUImage/framework/Source/GPUImage.h 48 | 49 | Pods/GPUImage/framework/Source/GPUImageAmatorkaFilter.m 50 | 51 | ColorPicker.xcodeproj/xcuserdata/Mango.xcuserdatad/xcschemes/xcschememanagement.plist 52 | -------------------------------------------------------------------------------- /ColorPicker/Base.lproj/Main.storyboard: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 29 | 36 | 42 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | -------------------------------------------------------------------------------- /ColorPicker/ColorAppDelegate.h: -------------------------------------------------------------------------------- 1 | // 2 | // ColorAppDelegate.h 3 | // ColorPicker 4 | // 5 | // Created by Mango on 14-2-5. 6 | // Copyright (c) 2014年 Mango. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface ColorAppDelegate : UIResponder 12 | 13 | @property (strong, nonatomic) UIWindow *window; 14 | 15 | @end 16 | -------------------------------------------------------------------------------- /ColorPicker/ColorAppDelegate.m: -------------------------------------------------------------------------------- 1 | // 2 | // ColorAppDelegate.m 3 | // ColorPicker 4 | // 5 | // Created by Mango on 14-2-5. 6 | // Copyright (c) 2014年 Mango. All rights reserved. 7 | // 8 | 9 | #import "ColorAppDelegate.h" 10 | 11 | @implementation ColorAppDelegate 12 | 13 | - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions 14 | { 15 | 16 | //magic 防止没有内容时 出现多余的separator 17 | [[UITableView appearance] setTableFooterView:[[UIView alloc] initWithFrame:CGRectZero]]; 18 | 19 | return YES; 20 | } 21 | 22 | - (void)applicationWillResignActive:(UIApplication *)application 23 | { 24 | // Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state. 25 | // Use this method to pause ongoing tasks, disable timers, and throttle down OpenGL ES frame rates. Games should use this method to pause the game. 26 | } 27 | 28 | - (void)applicationDidEnterBackground:(UIApplication *)application 29 | { 30 | // Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later. 31 | // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits. 32 | } 33 | 34 | - (void)applicationWillEnterForeground:(UIApplication *)application 35 | { 36 | // Called as part of the transition from the background to the inactive state; here you can undo many of the changes made on entering the background. 37 | } 38 | 39 | - (void)applicationDidBecomeActive:(UIApplication *)application 40 | { 41 | // Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface. 42 | } 43 | 44 | - (void)applicationWillTerminate:(UIApplication *)application 45 | { 46 | // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:. 47 | } 48 | 49 | @end 50 | -------------------------------------------------------------------------------- /ColorPicker/ColorDetectView.h: -------------------------------------------------------------------------------- 1 | // 2 | // ColorScrollView.h 3 | // ColorPicker 4 | // 5 | // Created by Mango on 14-2-11. 6 | // Copyright (c) 2014年 Mango. All rights reserved. 7 | // 8 | 9 | #import 10 | @class ColorImageView; 11 | 12 | 13 | @protocol ColorDetectViewDelegate 14 | 15 | @optional 16 | - (void)handelColor:(NSString*)hexColor; 17 | 18 | @end 19 | 20 | 21 | @interface ColorDetectView : UIScrollView 22 | 23 | @property (weak,nonatomic) id delegate; 24 | 25 | @property (strong,readonly,nonatomic) UIImageView *imageView; 26 | - (instancetype)initWithFrame:(CGRect)frame andUIImage:(UIImage*)image; 27 | 28 | 29 | @end 30 | -------------------------------------------------------------------------------- /ColorPicker/ColorDetectView.m: -------------------------------------------------------------------------------- 1 | // 2 | // ColorScrollView.m 3 | // ColorPicker 4 | // 5 | // Created by Mango on 14-2-11. 6 | // Copyright (c) 2014年 Mango. All rights reserved. 7 | // 8 | 9 | #import "ColorDetectView.h" 10 | #import "Masonry.h" 11 | 12 | @interface ColorDetectView () 13 | @property (strong,nonatomic) UIImageView *pickerView; 14 | @property (strong,readwrite,nonatomic) UIImageView *imageView; 15 | @property (assign,nonatomic) CGPoint pointInImageView; 16 | @end 17 | 18 | @implementation ColorDetectView 19 | 20 | @dynamic delegate; 21 | 22 | - (instancetype)initWithFrame:(CGRect)frame andUIImage:(UIImage *)image 23 | { 24 | self = [super initWithFrame:frame]; 25 | if (self) 26 | { 27 | //初始化自身设置 28 | self.maximumZoomScale = 100.0; 29 | self.minimumZoomScale = 1.0; 30 | self.contentSize = frame.size; 31 | self.bounces = NO; 32 | self.bouncesZoom = NO; //禁止缩小至最小比例之下 33 | self.backgroundColor = [UIColor colorWithRed:55/255.0 green:55/255.0 blue:54/255.0 alpha:1]; 34 | [self.pinchGestureRecognizer addTarget:self action:@selector(handelPinchGeture:)]; 35 | 36 | UITapGestureRecognizer *tap = [[UITapGestureRecognizer alloc]initWithTarget:self action:@selector(handelTapGesture:)]; 37 | [self addGestureRecognizer:tap]; 38 | [self.imageView addGestureRecognizer:tap]; 39 | 40 | 41 | //初始化要放大的Imageview 42 | self.imageView = [[UIImageView alloc]initWithFrame:self.bounds]; 43 | self.imageView.image = image; 44 | self.imageView.contentMode = UIViewContentModeScaleAspectFit; 45 | [self addSubview:self.imageView]; 46 | 47 | //初始取色器 48 | UIPanGestureRecognizer *pan = [[UIPanGestureRecognizer alloc]initWithTarget:self action:@selector(handelPangesture:)]; 49 | self.pickerView = [[UIImageView alloc]initWithImage:[UIImage imageNamed:@"picker"]]; 50 | [self.pickerView addGestureRecognizer:pan]; 51 | //self.pickerView.exclusiveTouch = YES; 52 | self.pickerView.userInteractionEnabled = YES; 53 | self.pickerView.hidden = YES; 54 | [self addSubview:self.pickerView]; 55 | 56 | } 57 | return self; 58 | } 59 | 60 | 61 | - (void)setFrame:(CGRect)frame 62 | { 63 | [super setFrame:frame]; 64 | self.imageView.frame = frame; 65 | } 66 | 67 | - (void)handelColor:(NSString *)hexColor 68 | { 69 | [self.delegate handelColor:hexColor]; 70 | } 71 | 72 | - (void) getColorOfPoint:(CGPoint)point InView:(UIView*)view 73 | { 74 | 75 | unsigned char pixel[4] = {0}; 76 | CGColorSpaceRef colorSpace = CGColorSpaceCreateDeviceRGB(); 77 | CGContextRef context = CGBitmapContextCreate(pixel, 78 | 1, 1, 8, 4, colorSpace, (CGBitmapInfo)kCGImageAlphaPremultipliedLast); 79 | 80 | CGContextTranslateCTM(context, -point.x, -point.y); 81 | 82 | [view.layer renderInContext:context]; 83 | 84 | CGContextRelease(context); 85 | CGColorSpaceRelease(colorSpace); 86 | 87 | NSString *hexColor = [NSString stringWithFormat:@"#%02x%02x%02x",pixel[0],pixel[1],pixel[2]]; 88 | 89 | [self.delegate handelColor:hexColor]; 90 | } 91 | 92 | 93 | #pragma mark - tap gesture delegate 94 | - (void)handelTapGesture:(UITapGestureRecognizer*)gesture 95 | { 96 | CGPoint point = [gesture locationInView:self]; 97 | self.pointInImageView = [gesture locationInView:self.imageView]; 98 | self.pickerView.center = point; 99 | self.pickerView.hidden = NO; 100 | [self getColorOfPoint:self.pointInImageView InView:self.imageView]; 101 | 102 | } 103 | 104 | #pragma mark - pinch gesture delegate 105 | - (void)handelPinchGeture:(UIPinchGestureRecognizer*)gesture 106 | { 107 | if (gesture.state == UIGestureRecognizerStateChanged) { 108 | self.pickerView.center = [self convertPoint:self.pointInImageView fromView:self.imageView]; 109 | } 110 | } 111 | 112 | #pragma mark - pan gesture delegate 113 | - (void)handelPangesture:(UIPanGestureRecognizer*)gesture 114 | { 115 | if (gesture.state == UIGestureRecognizerStateChanged) { 116 | self.pickerView.center = [gesture locationInView:self]; 117 | [self getColorOfPoint:[gesture locationInView:self.imageView] InView:self.imageView]; 118 | } 119 | } 120 | 121 | 122 | @end 123 | -------------------------------------------------------------------------------- /ColorPicker/ColorMainViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // ColorMainViewController.h 3 | // ColorPicker 4 | // 5 | // Created by Mango on 15/1/16. 6 | // Copyright (c) 2015年 Mango. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface ColorMainViewController : UIViewController 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /ColorPicker/ColorMainViewController.m: -------------------------------------------------------------------------------- 1 | // 2 | // ColorMainViewController.m 3 | // ColorPicker 4 | // 5 | // Created by Mango on 15/1/16. 6 | // Copyright (c) 2015年 Mango. All rights reserved. 7 | // 8 | 9 | #import "ColorMainViewController.h" 10 | 11 | //view 12 | #import "UIView+Tools.h" 13 | #import "ColorSingleColorCell.h" 14 | 15 | //controller 16 | #import "ColorViewController.h" 17 | @interface ColorMainViewController () 18 | 19 | 20 | 21 | //点击开始取色区域 22 | @property (weak, nonatomic) IBOutlet UIView *bottomBar; 23 | @property (weak, nonatomic) IBOutlet UIButton *addColorButton; 24 | //选择取色区域 25 | @property (weak, nonatomic) IBOutlet UIButton *PickColorButton; 26 | @property (weak, nonatomic) IBOutlet NSLayoutConstraint *pickImageTopConstraint; 27 | @property (weak, nonatomic) IBOutlet UIVisualEffectView *pickImageArea; 28 | @property (weak, nonatomic) IBOutlet UIView *pickImageFromAlbumView; 29 | @property (weak, nonatomic) IBOutlet UIView *pickImageFromCameraView; 30 | @property (weak, nonatomic) IBOutlet UIView *pickColorFromRealTimeView; 31 | //被选中的图片 32 | @property (nonatomic,strong) UIImage *pickImage; 33 | //tableview 34 | @property (weak, nonatomic) IBOutlet UITableView *recordTableView; 35 | @property (strong,nonatomic) NSMutableArray *colorArray; 36 | @property (weak, nonatomic) IBOutlet UIImageView *tableViewPlaceHolder; 37 | @property (weak, nonatomic) IBOutlet UIImageView *addColorReminder; 38 | 39 | @end 40 | 41 | static NSString *showColorViewControllerSegueIdentifier = @"showColorViewController"; 42 | static NSString *showRealTimeControllerSegueIdentifier = @"showRealTimeViewController"; 43 | static NSString *colorSigleCellIdentifier = @"colorSigleCellIdentifier"; 44 | 45 | @implementation ColorMainViewController 46 | 47 | - (void)didReceiveMemoryWarning { 48 | [super didReceiveMemoryWarning]; 49 | // Dispose of any resources that can be recreated. 50 | } 51 | 52 | 53 | #pragma mark - View Life Cycle 54 | 55 | - (void)viewDidLoad { 56 | [super viewDidLoad]; 57 | 58 | //setup view 59 | [self setupNavigationBar]; 60 | [self setupButtonView]; 61 | [self setupBottomBar]; 62 | 63 | [self.recordTableView registerNib:[UINib nibWithNibName:@"ColorSingleColorCell" bundle:nil] forCellReuseIdentifier:colorSigleCellIdentifier]; 64 | self.recordTableView.allowsSelection = NO; 65 | self.recordTableView.estimatedRowHeight = 44; 66 | self.recordTableView.rowHeight = UITableViewAutomaticDimension; 67 | } 68 | 69 | - (void)viewWillAppear:(BOOL)animated 70 | { 71 | [super viewWillAppear:animated]; 72 | 73 | //取数据 74 | NSUserDefaults * defaults = [NSUserDefaults standardUserDefaults]; 75 | self.colorArray = [[defaults arrayForKey:@"colorArray"] mutableCopy]; 76 | [self.recordTableView reloadData]; 77 | 78 | } 79 | 80 | 81 | - (void)setupNavigationBar 82 | { 83 | self.title = @"Touch Color"; 84 | self.navigationController.navigationBar.tintColor = [UIColor whiteColor]; 85 | [self.navigationController.navigationBar setTranslucent:NO]; 86 | //隐藏细线 87 | [self.navigationController.navigationBar setShadowImage:[UIImage imageNamed:@"TransparentPixel"]]; 88 | [self.navigationController.navigationBar setBackgroundImage:[UIImage new] forBarMetrics:UIBarMetricsDefault]; 89 | 90 | self.navigationController.navigationBar.barTintColor = [UIColor colorWithRed:55/255.0 green:55/255.0 blue:44/255.0 alpha:1]; 91 | 92 | } 93 | 94 | - (void)setupButtonView 95 | { 96 | //[self.pickImageFromAlbumView addBottomBorderWithColor:[UIColor colorWithRed:209/255.0 green:209/255.0 blue:209/255.0 alpha:1] andWidth:1]; 97 | //[self.pickImageFromCameraView addBottomBorderWithColor:[UIColor colorWithRed:209/255.0 green:209/255.0 blue:209/255.0 alpha:1] andWidth:1]; 98 | //[self.pickColorFromRealTimeView addBottomBorderWithColor:[UIColor colorWithRed:209/255.0 green:209/255.0 blue:209/255.0 alpha:1] andWidth:1]; 99 | 100 | [self.pickImageFromAlbumView touchEndedBlock:^(UIView *selfView) 101 | { 102 | //检查有无照相机 103 | if ([UIImagePickerController isSourceTypeAvailable:UIImagePickerControllerSourceTypePhotoLibrary] == NO 104 | ) 105 | { 106 | UIAlertView * alert = [[UIAlertView alloc]initWithTitle:@"无本地相册" message:Nil delegate:nil cancelButtonTitle:@"OK" otherButtonTitles:nil, nil]; 107 | [alert show]; 108 | } 109 | else 110 | { 111 | 112 | UIImagePickerController *imageLibray = [[UIImagePickerController alloc]init]; 113 | imageLibray.sourceType = UIImagePickerControllerSourceTypePhotoLibrary; 114 | imageLibray.delegate = self; 115 | //定制选择图片时的的navigationBar外观 116 | imageLibray.navigationBar.barTintColor = [UIColor colorWithRed:55/255.0 green:55/255.0 blue:54/255.0 alpha:1]; 117 | imageLibray.navigationBar.tintColor = [UIColor whiteColor]; 118 | imageLibray.navigationBar.translucent = NO; 119 | imageLibray.navigationBar.titleTextAttributes = @{NSForegroundColorAttributeName: [UIColor whiteColor]}; 120 | [imageLibray setNeedsStatusBarAppearanceUpdate]; 121 | 122 | [self presentViewController:imageLibray animated:YES completion:nil]; 123 | //[self closeButtonView]; 124 | } 125 | }]; 126 | 127 | [self.pickImageFromCameraView touchEndedBlock:^(UIView *selfView) { 128 | //检查有无摄像头 129 | if ([UIImagePickerController isSourceTypeAvailable:UIImagePickerControllerSourceTypeCamera] == NO 130 | ) 131 | { 132 | UIAlertView * alert = [[UIAlertView alloc]initWithTitle:@"无照相机" message:Nil delegate:nil cancelButtonTitle:@"OK" otherButtonTitles:nil, nil]; 133 | [alert show]; 134 | } 135 | else 136 | { 137 | UIImagePickerController *imagePicker = [[UIImagePickerController alloc]init]; 138 | imagePicker.sourceType = UIImagePickerControllerSourceTypeCamera; 139 | imagePicker.delegate = self; 140 | [self presentViewController:imagePicker animated:YES completion:nil]; 141 | //[self closeButtonView]; 142 | } 143 | }]; 144 | 145 | [self.pickColorFromRealTimeView touchEndedBlock:^(UIView *selfView) { 146 | [self performSegueWithIdentifier:showRealTimeControllerSegueIdentifier sender:self]; 147 | }]; 148 | } 149 | 150 | - (void)setupBottomBar 151 | { 152 | [self.bottomBar touchEndedBlock:^(UIView *selfView) { 153 | if (self.addColorButton.selected == NO) 154 | { 155 | self.addColorButton.selected = YES; 156 | [self.addColorButton rotateViewWithAngle:M_PI/4*3 andDuration:0.3]; 157 | self.pickImageTopConstraint.constant = -self.recordTableView.frame.size.height; 158 | [UIView animateWithDuration:0.3 animations:^{ 159 | [self.view layoutIfNeeded]; 160 | }]; 161 | } 162 | else 163 | { 164 | self.addColorButton.selected = NO; 165 | [self.addColorButton rotateViewWithAngle:-M_PI/4*3 andDuration:0.3]; 166 | self.pickImageTopConstraint.constant = 0; 167 | [UIView animateWithDuration:0.3 animations:^{ 168 | [self.view layoutIfNeeded]; 169 | }]; 170 | } 171 | }]; 172 | } 173 | 174 | #pragma mark - action 175 | 176 | - (IBAction)segemtedControlValueChanged:(UISegmentedControl *)sender 177 | { 178 | /* 179 | if (sender.selectedSegmentIndex == 0) 180 | { 181 | self.recordTableView.hidden = YES; 182 | self.pickImageFromAlbumButton.hidden = NO; 183 | self.pickImageFromCameraButton.hidden = NO; 184 | } 185 | else 186 | { 187 | self.recordTableView.hidden = NO; 188 | self.pickImageFromAlbumButton.hidden = YES; 189 | self.pickImageFromCameraButton.hidden = YES; 190 | } 191 | */ 192 | } 193 | 194 | 195 | - (void)closeButtonView 196 | { 197 | self.pickImageTopConstraint.constant = 0; 198 | self.PickColorButton.selected = NO; 199 | [self.view layoutIfNeeded]; 200 | } 201 | 202 | - (IBAction)pickNewColor:(UIButton *)sender 203 | { 204 | if (self.addColorButton.selected == NO) 205 | { 206 | self.addColorButton.selected = YES; 207 | [self.addColorButton rotateViewWithAngle:M_PI/4*3 andDuration:0.3]; 208 | self.pickImageTopConstraint.constant = -self.recordTableView.frame.size.height; 209 | [UIView animateWithDuration:0.3 animations:^{ 210 | [self.view layoutIfNeeded]; 211 | }]; 212 | } 213 | else 214 | { 215 | self.addColorButton.selected = NO; 216 | [self.addColorButton rotateViewWithAngle:-M_PI/4*3 andDuration:0.3]; 217 | self.pickImageTopConstraint.constant = 0; 218 | [UIView animateWithDuration:0.3 animations:^{ 219 | [self.view layoutIfNeeded]; 220 | }]; 221 | } 222 | } 223 | #pragma mark -imagePicker delegate 224 | 225 | - (void)imagePickerController:(UIImagePickerController *)picker didFinishPickingMediaWithInfo:(NSDictionary *)info 226 | { 227 | UIImage *image = [info objectForKey:UIImagePickerControllerOriginalImage]; 228 | self.pickImage = image; 229 | 230 | [picker.presentingViewController dismissViewControllerAnimated:NO completion:^{ 231 | [self performSegueWithIdentifier:showColorViewControllerSegueIdentifier sender:self]; 232 | 233 | }]; 234 | } 235 | 236 | #pragma mark -tableView datasource 237 | 238 | -(NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section 239 | { 240 | //检测是否需要tableViewPlaceHolder和Reminder 241 | if (self.colorArray == nil || self.colorArray.count == 0) 242 | { 243 | self.tableViewPlaceHolder.hidden = NO; 244 | self.addColorReminder.hidden = NO; 245 | } 246 | else 247 | { 248 | self.tableViewPlaceHolder.hidden = YES; 249 | self.addColorReminder.hidden = YES; 250 | } 251 | 252 | //返回需要显示的行数 253 | return [self.colorArray count]; 254 | } 255 | 256 | -(UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath 257 | { 258 | ColorSingleColorCell *cell = [tableView dequeueReusableCellWithIdentifier:colorSigleCellIdentifier]; 259 | 260 | [cell setColorInformationWith:[self.colorArray objectAtIndex:indexPath.row]]; 261 | 262 | return cell; 263 | } 264 | 265 | 266 | 267 | //删除选择列,更新颜色值数组 268 | - (void)tableView:(UITableView *)tableView commitEditingStyle:(UITableViewCellEditingStyle)editingStyle forRowAtIndexPath:(NSIndexPath *)indexPath 269 | { 270 | 271 | [self.colorArray removeObjectAtIndex:indexPath.row]; 272 | 273 | //保存进本地 274 | NSUserDefaults * userDefault = [NSUserDefaults standardUserDefaults]; 275 | [userDefault setObject:self.colorArray forKey:@"colorArray"]; 276 | [userDefault synchronize]; 277 | 278 | [tableView deleteRowsAtIndexPaths:[NSArray arrayWithObject:indexPath] withRowAnimation:UITableViewRowAnimationAutomatic]; 279 | } 280 | 281 | #pragma mark -tableview delegate 282 | 283 | // 返回cell editing的样式 284 | - (UITableViewCellEditingStyle)tableView:(UITableView *)tableView editingStyleForRowAtIndexPath:(NSIndexPath *)indexPath 285 | { 286 | return UITableViewCellEditingStyleDelete; 287 | } 288 | 289 | 290 | #pragma mark - Navigation 291 | 292 | - (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender 293 | { 294 | if ([segue.identifier isEqualToString:showColorViewControllerSegueIdentifier]) 295 | { 296 | ColorViewController *controller = (ColorViewController*)[segue destinationViewController]; 297 | [controller setChooseImage:self.pickImage]; 298 | } 299 | 300 | if ([segue.identifier isEqualToString:showRealTimeControllerSegueIdentifier]) { 301 | } 302 | } 303 | 304 | @end 305 | -------------------------------------------------------------------------------- /ColorPicker/ColorRealTimeViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // ColorRealTimeViewController.h 3 | // ColorPicker 4 | // 5 | // Created by Mango on 14-2-11. 6 | // Copyright (c) 2014年 Mango. All rights reserved. 7 | // 8 | 9 | #import 10 | #import 11 | @interface ColorRealTimeViewController : UIViewController 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /ColorPicker/ColorRealTimeViewController.m: -------------------------------------------------------------------------------- 1 | // 2 | // ColorRealTimeViewController.m 3 | // ColorPicker 4 | // 5 | // Created by Mango on 14-2-11. 6 | // Copyright (c) 2014年 Mango. All rights reserved. 7 | // 8 | 9 | #import "ColorRealTimeViewController.h" 10 | #import 11 | #import "GPUImage.h" 12 | #define DEVICE_IS_IPHONE5 ([[UIScreen mainScreen] bounds].size.height == 568) 13 | 14 | @interface ColorRealTimeViewController () 15 | { 16 | CALayer *trackingDot; 17 | 18 | GPUImageVideoCamera *videoCamera; 19 | GPUImageFilter *thresholdFilter, *positionFilter; 20 | GPUImageRawDataOutput *positionRawData, *videoRawData; 21 | GPUImageAverageColor *positionAverageColor; 22 | GPUImageView *filteredVideoView; 23 | 24 | 25 | BOOL shouldReplaceThresholdColor; 26 | CGPoint currentTouchPoint; 27 | GLfloat thresholdSensitivity; 28 | GPUVector3 thresholdColor; 29 | } 30 | 31 | @property (strong,nonatomic) UIButton *backButton; 32 | @property (strong,nonatomic) UIButton *saveButton; 33 | //@property (strong,nonatomic) GPUImageVideoCamera *videoCamera; 34 | //@property (strong,nonatomic) GPUImageRawDataOutput *videoRawData; 35 | //@property (strong,nonatomic) GPUImageView *VideoView; 36 | @property (weak, nonatomic) IBOutlet GPUImageView *VideoView; 37 | @property (strong,nonatomic) UILabel *red; 38 | @property (strong,nonatomic) UILabel *green; 39 | @property (strong,nonatomic) UILabel *blue; 40 | @property (strong,nonatomic) NSString *hexRGB; 41 | @property (strong,nonatomic) UIImageView *labelBackground; 42 | @property (strong,nonatomic) UIImageView *colorVIewCircle; 43 | @property (strong,nonatomic) UIColor *pointColor; 44 | @property (strong,nonatomic) UIView *colorView; 45 | @end 46 | 47 | @implementation ColorRealTimeViewController 48 | 49 | //设置状态栏 50 | - (BOOL)prefersStatusBarHidden{ 51 | return YES; 52 | } 53 | 54 | - (void)viewDidLoad 55 | { 56 | [super viewDidLoad]; 57 | 58 | [self setupGPUImage]; 59 | [self setupButton]; 60 | [self setupLabels]; 61 | [self setupColorPointView]; 62 | 63 | } 64 | 65 | - (void)viewDidAppear:(BOOL)animated 66 | { 67 | [super viewDidAppear:animated]; 68 | //[self setupGPUImage]; 69 | 70 | } 71 | 72 | 73 | #pragma setupView 74 | - (void)setupButton 75 | { 76 | _backButton = [UIButton buttonWithType:UIButtonTypeCustom]; 77 | self.backButton.frame = CGRectMake(0, 23/2, 105/2, 96/2); 78 | [self.backButton setImage:[UIImage imageNamed:@"0,23"] forState:UIControlStateNormal]; 79 | [self.backButton setImage:[UIImage imageNamed:@"0,23 B"] forState:UIControlStateHighlighted]; 80 | [self.backButton addTarget:self action:@selector(back) forControlEvents:UIControlEventTouchUpInside]; 81 | [self.view addSubview:self.backButton]; 82 | 83 | _saveButton = [UIButton buttonWithType:UIButtonTypeCustom]; 84 | if (DEVICE_IS_IPHONE5) { 85 | self.saveButton.frame = CGRectMake(500/2, 884/2 + 176/2, 140/2, 77/2); 86 | } 87 | else 88 | { 89 | self.saveButton.frame = CGRectMake(500/2, 884/2, 140/2, 77/2); 90 | } 91 | [self.saveButton setImage:[UIImage imageNamed:@"500,883"] forState:UIControlStateNormal]; 92 | [self.saveButton setImage:[UIImage imageNamed:@"500,883 B"] forState:UIControlStateHighlighted]; 93 | [self.saveButton setImage:[UIImage imageNamed:@"500,883 C"] forState:UIControlStateSelected]; 94 | [self.saveButton addTarget:self action:@selector(save) forControlEvents:UIControlEventTouchUpInside]; 95 | [self.view addSubview:self.saveButton]; 96 | 97 | } 98 | 99 | - (void)setupLabels 100 | { 101 | if (DEVICE_IS_IPHONE5) { 102 | _labelBackground = [[UIImageView alloc]initWithFrame:CGRectMake(0, 818/2 + 176/2, 171/2, 143/2)]; 103 | _red = [[UILabel alloc]initWithFrame:CGRectMake(74/2, 820/2 + 176/2, 40, 40)]; 104 | _green = [[UILabel alloc]initWithFrame:CGRectMake(74/2, 860/2 + 176/2, 40, 40)]; 105 | _blue = [[UILabel alloc]initWithFrame:CGRectMake(74/2, 900/2 + 176/2, 40, 40)]; 106 | } 107 | else 108 | { 109 | _labelBackground = [[UIImageView alloc]initWithFrame:CGRectMake(0, 818/2, 171/2, 143/2)]; 110 | _red = [[UILabel alloc]initWithFrame:CGRectMake(74/2, 820/2, 40, 40)]; 111 | _green = [[UILabel alloc]initWithFrame:CGRectMake(74/2, 860/2, 40, 40)]; 112 | _blue = [[UILabel alloc]initWithFrame:CGRectMake(74/2, 900/2, 40, 40)]; 113 | } 114 | self.labelBackground.image = [UIImage imageNamed:@"0,817"]; 115 | [self.view addSubview:self.labelBackground]; 116 | 117 | self.red.text = @"255"; 118 | self.green.text = @"255"; 119 | self.blue.text = @"255"; 120 | 121 | [self.view addSubview:self.red]; 122 | [self.view addSubview:self.green]; 123 | [self.view addSubview:self.blue]; 124 | } 125 | 126 | - (void)setupColorPointView 127 | { 128 | self.colorVIewCircle = [[UIImageView alloc]initWithFrame:CGRectMake(0, 0, 45, 45)]; 129 | self.colorVIewCircle.center = self.view.center; 130 | self.colorVIewCircle.image = [UIImage imageNamed:@"275,436"]; 131 | 132 | self.colorView = [[UIView alloc]initWithFrame:CGRectMake(0,0, 46/2, 46/2)]; 133 | self.colorView.center = self.view.center; 134 | self.colorView.backgroundColor = [UIColor clearColor]; 135 | self.colorView.layer.cornerRadius = 46/2/2; 136 | 137 | [self.view addSubview:self.colorView]; 138 | [self.view addSubview:self.colorVIewCircle]; 139 | } 140 | 141 | - (void)setupGPUImage 142 | { 143 | videoCamera = [[GPUImageVideoCamera alloc] initWithSessionPreset:AVCaptureSessionPreset640x480 cameraPosition:AVCaptureDevicePositionBack]; 144 | videoCamera.outputImageOrientation = UIInterfaceOrientationPortrait; 145 | CGSize videoPixelSize = CGSizeMake(480.0, 640.0); 146 | CGRect mainScreenFrame = [[UIScreen mainScreen] applicationFrame]; 147 | 148 | filteredVideoView = [[GPUImageView alloc] initWithFrame:CGRectMake(0.0, 0.0, mainScreenFrame.size.width, mainScreenFrame.size.height)]; 149 | filteredVideoView.fillMode = kGPUImageFillModePreserveAspectRatioAndFill; 150 | [self.view addSubview:filteredVideoView]; 151 | 152 | __unsafe_unretained ColorRealTimeViewController *weakSelf = self; 153 | 154 | videoRawData = [[GPUImageRawDataOutput alloc] initWithImageSize:videoPixelSize resultsInBGRAFormat:YES]; 155 | __weak ColorRealTimeViewController *safeSelf = self; 156 | [videoRawData setNewFrameAvailableBlock:^{ 157 | 158 | 159 | CGPoint focusPoint = {480/2,640/2}; 160 | 161 | 162 | GPUByteColorVector colorAtTouchPoint = [weakSelf->videoRawData colorAtLocation:focusPoint]; 163 | 164 | NSLog(@"Color at touch point: %d, %d, %d, %d", colorAtTouchPoint.red, colorAtTouchPoint.green, colorAtTouchPoint.blue, colorAtTouchPoint.alpha); 165 | 166 | dispatch_async(dispatch_get_main_queue(), ^{ 167 | 168 | int red = (int)colorAtTouchPoint.red; 169 | int green = (int)colorAtTouchPoint.green; 170 | int blue = (int)colorAtTouchPoint.blue; 171 | 172 | safeSelf.red.text = [NSString stringWithFormat:@"%d",red]; 173 | safeSelf.green.text = [NSString stringWithFormat:@"%d",green]; 174 | safeSelf.blue.text = [NSString stringWithFormat:@"%d",blue]; 175 | safeSelf.hexRGB = [NSString stringWithFormat:@"#%02x%02x%02x",red,green,blue]; 176 | 177 | 178 | safeSelf.pointColor = [UIColor colorWithRed:red/255.0 green:green/255.0 blue:blue/255.0 alpha:1]; 179 | safeSelf.colorView.backgroundColor = safeSelf.pointColor; 180 | }); 181 | 182 | 183 | }]; 184 | 185 | 186 | [videoCamera addTarget:filteredVideoView]; 187 | [videoCamera addTarget:videoRawData]; 188 | [videoCamera startCameraCapture]; 189 | } 190 | 191 | #pragma mark -buttonEvent 192 | - (void)back 193 | { 194 | [self.presentingViewController dismissViewControllerAnimated:YES completion:nil]; 195 | } 196 | 197 | - (void)save 198 | { 199 | self.saveButton.selected = YES; 200 | dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{ 201 | 202 | NSUserDefaults * userDefaults = [NSUserDefaults standardUserDefaults]; 203 | NSArray * colorArray = [userDefaults arrayForKey:@"colorArray"]; 204 | 205 | if (colorArray == nil) 206 | { 207 | NSArray * newColorArray = @[self.hexRGB]; 208 | [userDefaults setObject:newColorArray forKey:@"colorArray"]; 209 | } 210 | else 211 | { 212 | NSMutableArray *newColorArray = [colorArray mutableCopy]; 213 | [newColorArray addObject:self.hexRGB]; 214 | [userDefaults setObject:newColorArray forKey:@"colorArray"]; 215 | } 216 | [userDefaults synchronize]; 217 | 218 | dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(0.8 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{ 219 | self.saveButton.selected = NO; 220 | }); 221 | 222 | }); 223 | } 224 | 225 | @end 226 | -------------------------------------------------------------------------------- /ColorPicker/ColorSingleColorCell.h: -------------------------------------------------------------------------------- 1 | // 2 | // ColorSingleColorCell.h 3 | // ColorPicker 4 | // 5 | // Created by Mango on 15/1/20. 6 | // Copyright (c) 2015年 Mango. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface ColorSingleColorCell : UITableViewCell 12 | 13 | - (void)setColorInformationWith:(NSString*)hexColor; 14 | 15 | 16 | @end 17 | -------------------------------------------------------------------------------- /ColorPicker/ColorSingleColorCell.m: -------------------------------------------------------------------------------- 1 | // 2 | // ColorSingleColorCell.m 3 | // ColorPicker 4 | // 5 | // Created by Mango on 15/1/20. 6 | // Copyright (c) 2015年 Mango. All rights reserved. 7 | // 8 | 9 | #import "ColorSingleColorCell.h" 10 | 11 | @interface ColorSingleColorCell () 12 | @property (weak, nonatomic) IBOutlet UILabel *red; 13 | @property (weak, nonatomic) IBOutlet UILabel *green; 14 | @property (weak, nonatomic) IBOutlet UILabel *blue; 15 | @property (weak, nonatomic) IBOutlet UILabel *hex; 16 | @property (weak, nonatomic) IBOutlet UIView *colorView; 17 | 18 | @end 19 | 20 | 21 | @implementation ColorSingleColorCell 22 | 23 | - (void)setColorInformationWith:(NSString*)hexColor 24 | { 25 | //转换hex值 26 | unsigned int red ,green,blue; 27 | 28 | NSScanner *scanner = [NSScanner scannerWithString:[hexColor substringWithRange:NSMakeRange(1, 2)]]; 29 | [scanner scanHexInt:&red]; 30 | 31 | scanner = [NSScanner scannerWithString:[hexColor substringWithRange:NSMakeRange(3, 2)]]; 32 | [scanner scanHexInt:&green]; 33 | 34 | scanner = [NSScanner scannerWithString:[hexColor substringWithRange:NSMakeRange(5, 2)]]; 35 | [scanner scanHexInt:&blue]; 36 | 37 | 38 | self.red.text = [NSString stringWithFormat:@"%d",red]; 39 | self.green.text = [NSString stringWithFormat:@"%d",green]; 40 | self.blue.text = [NSString stringWithFormat:@"%d",blue]; 41 | self.hex.text = hexColor; 42 | 43 | self.colorView.backgroundColor = [UIColor colorWithRed:red/255.0 green:green/255.0 blue:blue/255.0 alpha:1]; 44 | } 45 | 46 | - (void)awakeFromNib { 47 | // Initialization code 48 | } 49 | 50 | - (void)setSelected:(BOOL)selected animated:(BOOL)animated { 51 | [super setSelected:selected animated:animated]; 52 | 53 | // Configure the view for the selected state 54 | } 55 | 56 | @end 57 | -------------------------------------------------------------------------------- /ColorPicker/ColorSingleColorCell.xib: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 32 | 42 | 49 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | 110 | 111 | 112 | 113 | 114 | 115 | 116 | -------------------------------------------------------------------------------- /ColorPicker/ColorViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // ColorViewController.h 3 | // ColorPicker 4 | // 5 | // Created by Mango on 14-2-5. 6 | // Copyright (c) 2014年 Mango. All rights reserved. 7 | // 8 | 9 | #import 10 | @class ColorScrollView; 11 | 12 | @interface ColorViewController : UIViewController 13 | 14 | - (void)setChooseImage:(UIImage *)image; 15 | 16 | @end 17 | -------------------------------------------------------------------------------- /ColorPicker/ColorViewController.m: -------------------------------------------------------------------------------- 1 | // 2 | // ColorViewController.m 3 | // ColorPicker 4 | // 5 | // Created by Mango on 14-2-5. 6 | // Copyright (c) 2014年 Mango. All rights reserved. 7 | // 8 | 9 | #import "ColorViewController.h" 10 | #import 11 | 12 | //view 13 | #import "UIView+Tools.h" 14 | #import "ColorDetectView.h" 15 | 16 | @interface ColorViewController () 17 | 18 | @property (strong, nonatomic) ColorDetectView *colorDetectView; 19 | @property (nonatomic,strong) UIImage *image; 20 | 21 | @property (weak, nonatomic) IBOutlet UILabel *red; 22 | @property (weak, nonatomic) IBOutlet UILabel *green; 23 | @property (weak, nonatomic) IBOutlet UILabel *blue; 24 | @property (weak, nonatomic) IBOutlet UILabel *hexRGB; 25 | @property (weak, nonatomic) IBOutlet UIView *scrollViewSizeView; 26 | @property (weak, nonatomic) IBOutlet UIButton *saveButton; 27 | 28 | @property (weak, nonatomic) IBOutlet UIView *bottomBar; 29 | 30 | @end 31 | 32 | @implementation ColorViewController 33 | 34 | //设置状态栏 35 | - (BOOL)prefersStatusBarHidden 36 | { 37 | return YES; 38 | } 39 | 40 | 41 | - (void)didReceiveMemoryWarning 42 | { 43 | [super didReceiveMemoryWarning]; 44 | // Dispose of any resources that can be recreated. 45 | } 46 | 47 | 48 | #pragma mark - public method 49 | 50 | - (void)setChooseImage:(UIImage *)image 51 | { 52 | //不能在这里直接赋值照片给ColorScrollView 因为ScrollView还为Null 53 | self.image = image; 54 | } 55 | 56 | #pragma mark - view life cycle 57 | 58 | - (void)viewDidLoad 59 | { 60 | [super viewDidLoad]; 61 | 62 | //setup view 63 | [self setupBackgroud]; 64 | [self setupScrollView]; 65 | 66 | //init text 67 | self.red.text = @"255"; 68 | self.green.text = @"255"; 69 | self.blue.text = @"255"; 70 | self.hexRGB.text = @"#ffffff"; 71 | 72 | } 73 | 74 | - (void)viewDidLayoutSubviews 75 | { 76 | [super viewDidLayoutSubviews]; 77 | 78 | //update scrollView frame 79 | // fix reset imageview frame by comparing first 80 | if (!CGRectEqualToRect(self.colorDetectView.frame,self.scrollViewSizeView.bounds)) { 81 | self.colorDetectView.frame = self.scrollViewSizeView.bounds; 82 | } 83 | } 84 | 85 | - (void)setupScrollView 86 | { 87 | CGRect frame = self.scrollViewSizeView.bounds; 88 | self.colorDetectView = [[ColorDetectView alloc]initWithFrame:frame andUIImage:self.image]; 89 | self.colorDetectView.delegate = self; 90 | [self.scrollViewSizeView addSubview:self.colorDetectView]; 91 | } 92 | 93 | - (void)setupBackgroud 94 | { 95 | //设置背景颜色 96 | self.view.backgroundColor = [UIColor colorWithRed:239.0/255 green:239.0/255 blue:237.0/255 alpha:1.0]; 97 | } 98 | 99 | #pragma mark -Action 100 | - (IBAction)saveColor:(UIButton *)sender 101 | { 102 | self.saveButton.selected = YES; 103 | dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{ 104 | 105 | NSUserDefaults * userDefaults = [NSUserDefaults standardUserDefaults]; 106 | NSArray * colorArray = [userDefaults arrayForKey:@"colorArray"]; 107 | 108 | if (colorArray == nil) 109 | { 110 | NSArray * newColorArray = @[self.hexRGB.text]; 111 | [userDefaults setObject:newColorArray forKey:@"colorArray"]; 112 | } 113 | else 114 | { 115 | NSMutableArray *newColorArray = [colorArray mutableCopy]; 116 | [newColorArray addObject:self.hexRGB.text]; 117 | [userDefaults setObject:newColorArray forKey:@"colorArray"]; 118 | } 119 | [userDefaults synchronize]; 120 | 121 | dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(0.8 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{ 122 | self.saveButton.selected = NO; 123 | }); 124 | 125 | }); 126 | } 127 | 128 | #pragma mark -colorDetectView delegate 129 | 130 | -(UIView *)viewForZoomingInScrollView:(UIScrollView *)scrollView 131 | { 132 | return self.colorDetectView.imageView; 133 | } 134 | 135 | - (void)handelColor:(NSString *)hexColor 136 | { 137 | [self setColorInformationWith:hexColor]; 138 | } 139 | 140 | - (void)setColorInformationWith:(NSString*)hexColor 141 | { 142 | //转换hex值 143 | unsigned int red ,green,blue; 144 | 145 | NSScanner *scanner = [NSScanner scannerWithString:[hexColor substringWithRange:NSMakeRange(1, 2)]]; 146 | [scanner scanHexInt:&red]; 147 | 148 | scanner = [NSScanner scannerWithString:[hexColor substringWithRange:NSMakeRange(3, 2)]]; 149 | [scanner scanHexInt:&green]; 150 | 151 | scanner = [NSScanner scannerWithString:[hexColor substringWithRange:NSMakeRange(5, 2)]]; 152 | [scanner scanHexInt:&blue]; 153 | 154 | 155 | self.red.text = [NSString stringWithFormat:@"%d",red]; 156 | self.green.text = [NSString stringWithFormat:@"%d",green]; 157 | self.blue.text = [NSString stringWithFormat:@"%d",blue]; 158 | self.hexRGB.text = hexColor; 159 | 160 | self.saveButton.backgroundColor = [UIColor colorWithRed:red/255.0 green:green/255.0 blue:blue/255.0 alpha:1]; 161 | } 162 | @end 163 | -------------------------------------------------------------------------------- /ColorPicker/Images.xcassets/AppIcon.appiconset/29-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/100mango/ColorPicker/df48f021553437c72acf442e860527dd1cd44a29/ColorPicker/Images.xcassets/AppIcon.appiconset/29-1.png -------------------------------------------------------------------------------- /ColorPicker/Images.xcassets/AppIcon.appiconset/29.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/100mango/ColorPicker/df48f021553437c72acf442e860527dd1cd44a29/ColorPicker/Images.xcassets/AppIcon.appiconset/29.png -------------------------------------------------------------------------------- /ColorPicker/Images.xcassets/AppIcon.appiconset/40-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/100mango/ColorPicker/df48f021553437c72acf442e860527dd1cd44a29/ColorPicker/Images.xcassets/AppIcon.appiconset/40-1.png -------------------------------------------------------------------------------- /ColorPicker/Images.xcassets/AppIcon.appiconset/40.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/100mango/ColorPicker/df48f021553437c72acf442e860527dd1cd44a29/ColorPicker/Images.xcassets/AppIcon.appiconset/40.png -------------------------------------------------------------------------------- /ColorPicker/Images.xcassets/AppIcon.appiconset/50.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/100mango/ColorPicker/df48f021553437c72acf442e860527dd1cd44a29/ColorPicker/Images.xcassets/AppIcon.appiconset/50.png -------------------------------------------------------------------------------- /ColorPicker/Images.xcassets/AppIcon.appiconset/57.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/100mango/ColorPicker/df48f021553437c72acf442e860527dd1cd44a29/ColorPicker/Images.xcassets/AppIcon.appiconset/57.png -------------------------------------------------------------------------------- /ColorPicker/Images.xcassets/AppIcon.appiconset/60.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/100mango/ColorPicker/df48f021553437c72acf442e860527dd1cd44a29/ColorPicker/Images.xcassets/AppIcon.appiconset/60.png -------------------------------------------------------------------------------- /ColorPicker/Images.xcassets/AppIcon.appiconset/72.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/100mango/ColorPicker/df48f021553437c72acf442e860527dd1cd44a29/ColorPicker/Images.xcassets/AppIcon.appiconset/72.png -------------------------------------------------------------------------------- /ColorPicker/Images.xcassets/AppIcon.appiconset/76.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/100mango/ColorPicker/df48f021553437c72acf442e860527dd1cd44a29/ColorPicker/Images.xcassets/AppIcon.appiconset/76.png -------------------------------------------------------------------------------- /ColorPicker/Images.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "iphone", 5 | "size" : "29x29", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "size" : "29x29", 10 | "idiom" : "iphone", 11 | "filename" : "29-1.png", 12 | "scale" : "2x" 13 | }, 14 | { 15 | "size" : "40x40", 16 | "idiom" : "iphone", 17 | "filename" : "40.png", 18 | "scale" : "2x" 19 | }, 20 | { 21 | "idiom" : "iphone", 22 | "size" : "57x57", 23 | "scale" : "1x" 24 | }, 25 | { 26 | "size" : "57x57", 27 | "idiom" : "iphone", 28 | "filename" : "57.png", 29 | "scale" : "2x" 30 | }, 31 | { 32 | "size" : "60x60", 33 | "idiom" : "iphone", 34 | "filename" : "60.png", 35 | "scale" : "2x" 36 | }, 37 | { 38 | "idiom" : "iphone", 39 | "size" : "60x60", 40 | "scale" : "3x" 41 | }, 42 | { 43 | "idiom" : "ipad", 44 | "size" : "29x29", 45 | "scale" : "1x" 46 | }, 47 | { 48 | "size" : "29x29", 49 | "idiom" : "ipad", 50 | "filename" : "29.png", 51 | "scale" : "2x" 52 | }, 53 | { 54 | "idiom" : "ipad", 55 | "size" : "40x40", 56 | "scale" : "1x" 57 | }, 58 | { 59 | "size" : "40x40", 60 | "idiom" : "ipad", 61 | "filename" : "40-1.png", 62 | "scale" : "2x" 63 | }, 64 | { 65 | "idiom" : "ipad", 66 | "size" : "50x50", 67 | "scale" : "1x" 68 | }, 69 | { 70 | "size" : "50x50", 71 | "idiom" : "ipad", 72 | "filename" : "50.png", 73 | "scale" : "2x" 74 | }, 75 | { 76 | "idiom" : "ipad", 77 | "size" : "72x72", 78 | "scale" : "1x" 79 | }, 80 | { 81 | "size" : "72x72", 82 | "idiom" : "ipad", 83 | "filename" : "72.png", 84 | "scale" : "2x" 85 | }, 86 | { 87 | "idiom" : "ipad", 88 | "size" : "76x76", 89 | "scale" : "1x" 90 | }, 91 | { 92 | "size" : "76x76", 93 | "idiom" : "ipad", 94 | "filename" : "76.png", 95 | "scale" : "2x" 96 | } 97 | ], 98 | "info" : { 99 | "version" : 1, 100 | "author" : "xcode" 101 | } 102 | } -------------------------------------------------------------------------------- /ColorPicker/Images.xcassets/LaunchImage.launchimage/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "orientation" : "portrait", 5 | "idiom" : "iphone", 6 | "extent" : "full-screen", 7 | "minimum-system-version" : "7.0", 8 | "scale" : "2x" 9 | }, 10 | { 11 | "orientation" : "portrait", 12 | "idiom" : "iphone", 13 | "subtype" : "retina4", 14 | "extent" : "full-screen", 15 | "minimum-system-version" : "7.0", 16 | "scale" : "2x" 17 | } 18 | ], 19 | "info" : { 20 | "version" : 1, 21 | "author" : "xcode" 22 | } 23 | } -------------------------------------------------------------------------------- /ColorPicker/Images.xcassets/Main/icon1x1.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "icon1x1(1).pdf" 6 | } 7 | ], 8 | "info" : { 9 | "version" : 1, 10 | "author" : "xcode" 11 | } 12 | } -------------------------------------------------------------------------------- /ColorPicker/Images.xcassets/Main/icon1x1.imageset/icon1x1(1).pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/100mango/ColorPicker/df48f021553437c72acf442e860527dd1cd44a29/ColorPicker/Images.xcassets/Main/icon1x1.imageset/icon1x1(1).pdf -------------------------------------------------------------------------------- /ColorPicker/Images.xcassets/Main/icon2x1.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "icon2x1(1).pdf" 6 | } 7 | ], 8 | "info" : { 9 | "version" : 1, 10 | "author" : "xcode" 11 | } 12 | } -------------------------------------------------------------------------------- /ColorPicker/Images.xcassets/Main/icon2x1.imageset/icon2x1(1).pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/100mango/ColorPicker/df48f021553437c72acf442e860527dd1cd44a29/ColorPicker/Images.xcassets/Main/icon2x1.imageset/icon2x1(1).pdf -------------------------------------------------------------------------------- /ColorPicker/Images.xcassets/Main/icon3x1.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "icon3x1(1).pdf" 6 | } 7 | ], 8 | "info" : { 9 | "version" : 1, 10 | "author" : "xcode" 11 | } 12 | } -------------------------------------------------------------------------------- /ColorPicker/Images.xcassets/Main/icon3x1.imageset/icon3x1(1).pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/100mango/ColorPicker/df48f021553437c72acf442e860527dd1cd44a29/ColorPicker/Images.xcassets/Main/icon3x1.imageset/icon3x1(1).pdf -------------------------------------------------------------------------------- /ColorPicker/Images.xcassets/Main/plus.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "加号x1.pdf" 6 | } 7 | ], 8 | "info" : { 9 | "version" : 1, 10 | "author" : "xcode" 11 | } 12 | } -------------------------------------------------------------------------------- /ColorPicker/Images.xcassets/Main/plus.imageset/加号x1.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/100mango/ColorPicker/df48f021553437c72acf442e860527dd1cd44a29/ColorPicker/Images.xcassets/Main/plus.imageset/加号x1.pdf -------------------------------------------------------------------------------- /ColorPicker/Images.xcassets/Main/reminder.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "提示框x1.pdf" 6 | } 7 | ], 8 | "info" : { 9 | "version" : 1, 10 | "author" : "xcode" 11 | } 12 | } -------------------------------------------------------------------------------- /ColorPicker/Images.xcassets/Main/reminder.imageset/提示框x1.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/100mango/ColorPicker/df48f021553437c72acf442e860527dd1cd44a29/ColorPicker/Images.xcassets/Main/reminder.imageset/提示框x1.pdf -------------------------------------------------------------------------------- /ColorPicker/Images.xcassets/Main/tableViewPlaceHolder.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x" 6 | }, 7 | { 8 | "idiom" : "universal", 9 | "scale" : "2x", 10 | "filename" : "首页图x2.png" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x", 15 | "filename" : "首页图x3.png" 16 | } 17 | ], 18 | "info" : { 19 | "version" : 1, 20 | "author" : "xcode" 21 | } 22 | } -------------------------------------------------------------------------------- /ColorPicker/Images.xcassets/Main/tableViewPlaceHolder.imageset/首页图x2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/100mango/ColorPicker/df48f021553437c72acf442e860527dd1cd44a29/ColorPicker/Images.xcassets/Main/tableViewPlaceHolder.imageset/首页图x2.png -------------------------------------------------------------------------------- /ColorPicker/Images.xcassets/Main/tableViewPlaceHolder.imageset/首页图x3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/100mango/ColorPicker/df48f021553437c72acf442e860527dd1cd44a29/ColorPicker/Images.xcassets/Main/tableViewPlaceHolder.imageset/首页图x3.png -------------------------------------------------------------------------------- /ColorPicker/Images.xcassets/TransparentPixel.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x", 6 | "filename" : "TransparentPixel.png" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "version" : 1, 19 | "author" : "xcode" 20 | } 21 | } -------------------------------------------------------------------------------- /ColorPicker/Images.xcassets/TransparentPixel.imageset/TransparentPixel.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/100mango/ColorPicker/df48f021553437c72acf442e860527dd1cd44a29/ColorPicker/Images.xcassets/TransparentPixel.imageset/TransparentPixel.png -------------------------------------------------------------------------------- /ColorPicker/Images.xcassets/colorView/RGBHex.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "RGBX1.pdf" 6 | } 7 | ], 8 | "info" : { 9 | "version" : 1, 10 | "author" : "xcode" 11 | } 12 | } -------------------------------------------------------------------------------- /ColorPicker/Images.xcassets/colorView/RGBHex.imageset/RGBX1.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/100mango/ColorPicker/df48f021553437c72acf442e860527dd1cd44a29/ColorPicker/Images.xcassets/colorView/RGBHex.imageset/RGBX1.pdf -------------------------------------------------------------------------------- /ColorPicker/Images.xcassets/colorView/picker.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x" 6 | }, 7 | { 8 | "idiom" : "universal", 9 | "scale" : "2x", 10 | "filename" : "picker.png" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "version" : 1, 19 | "author" : "xcode" 20 | } 21 | } -------------------------------------------------------------------------------- /ColorPicker/Images.xcassets/colorView/picker.imageset/picker.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/100mango/ColorPicker/df48f021553437c72acf442e860527dd1cd44a29/ColorPicker/Images.xcassets/colorView/picker.imageset/picker.png -------------------------------------------------------------------------------- /ColorPicker/Images.xcassets/colorView/y 148.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x", 6 | "filename" : "y 148.png" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "scale" : "2x", 11 | "filename" : "y 148@2x.png" 12 | }, 13 | { 14 | "idiom" : "universal", 15 | "scale" : "3x" 16 | } 17 | ], 18 | "info" : { 19 | "version" : 1, 20 | "author" : "xcode" 21 | } 22 | } -------------------------------------------------------------------------------- /ColorPicker/Images.xcassets/colorView/y 148.imageset/y 148.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/100mango/ColorPicker/df48f021553437c72acf442e860527dd1cd44a29/ColorPicker/Images.xcassets/colorView/y 148.imageset/y 148.png -------------------------------------------------------------------------------- /ColorPicker/Images.xcassets/colorView/y 148.imageset/y 148@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/100mango/ColorPicker/df48f021553437c72acf442e860527dd1cd44a29/ColorPicker/Images.xcassets/colorView/y 148.imageset/y 148@2x.png -------------------------------------------------------------------------------- /ColorPicker/Images.xcassets/realTimeUI/0,23 B.imageset/0,23 B.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/100mango/ColorPicker/df48f021553437c72acf442e860527dd1cd44a29/ColorPicker/Images.xcassets/realTimeUI/0,23 B.imageset/0,23 B.png -------------------------------------------------------------------------------- /ColorPicker/Images.xcassets/realTimeUI/0,23 B.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x" 6 | }, 7 | { 8 | "idiom" : "universal", 9 | "scale" : "2x", 10 | "filename" : "0,23 B.png" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "version" : 1, 19 | "author" : "xcode" 20 | } 21 | } -------------------------------------------------------------------------------- /ColorPicker/Images.xcassets/realTimeUI/0,23.imageset/0,23.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/100mango/ColorPicker/df48f021553437c72acf442e860527dd1cd44a29/ColorPicker/Images.xcassets/realTimeUI/0,23.imageset/0,23.png -------------------------------------------------------------------------------- /ColorPicker/Images.xcassets/realTimeUI/0,23.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x" 6 | }, 7 | { 8 | "idiom" : "universal", 9 | "scale" : "2x", 10 | "filename" : "0,23.png" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "version" : 1, 19 | "author" : "xcode" 20 | } 21 | } -------------------------------------------------------------------------------- /ColorPicker/Images.xcassets/realTimeUI/0,817.imageset/0,817.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/100mango/ColorPicker/df48f021553437c72acf442e860527dd1cd44a29/ColorPicker/Images.xcassets/realTimeUI/0,817.imageset/0,817.png -------------------------------------------------------------------------------- /ColorPicker/Images.xcassets/realTimeUI/0,817.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x" 6 | }, 7 | { 8 | "idiom" : "universal", 9 | "scale" : "2x", 10 | "filename" : "0,817.png" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "version" : 1, 19 | "author" : "xcode" 20 | } 21 | } -------------------------------------------------------------------------------- /ColorPicker/Images.xcassets/realTimeUI/275,436.imageset/275,436.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/100mango/ColorPicker/df48f021553437c72acf442e860527dd1cd44a29/ColorPicker/Images.xcassets/realTimeUI/275,436.imageset/275,436.png -------------------------------------------------------------------------------- /ColorPicker/Images.xcassets/realTimeUI/275,436.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x" 6 | }, 7 | { 8 | "idiom" : "universal", 9 | "scale" : "2x", 10 | "filename" : "275,436.png" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "version" : 1, 19 | "author" : "xcode" 20 | } 21 | } -------------------------------------------------------------------------------- /ColorPicker/Images.xcassets/realTimeUI/500,883 B.imageset/500,883 B.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/100mango/ColorPicker/df48f021553437c72acf442e860527dd1cd44a29/ColorPicker/Images.xcassets/realTimeUI/500,883 B.imageset/500,883 B.png -------------------------------------------------------------------------------- /ColorPicker/Images.xcassets/realTimeUI/500,883 B.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x" 6 | }, 7 | { 8 | "idiom" : "universal", 9 | "scale" : "2x", 10 | "filename" : "500,883 B.png" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "version" : 1, 19 | "author" : "xcode" 20 | } 21 | } -------------------------------------------------------------------------------- /ColorPicker/Images.xcassets/realTimeUI/500,883 C.imageset/500,883 C.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/100mango/ColorPicker/df48f021553437c72acf442e860527dd1cd44a29/ColorPicker/Images.xcassets/realTimeUI/500,883 C.imageset/500,883 C.png -------------------------------------------------------------------------------- /ColorPicker/Images.xcassets/realTimeUI/500,883 C.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x" 6 | }, 7 | { 8 | "idiom" : "universal", 9 | "scale" : "2x", 10 | "filename" : "500,883 C.png" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "version" : 1, 19 | "author" : "xcode" 20 | } 21 | } -------------------------------------------------------------------------------- /ColorPicker/Images.xcassets/realTimeUI/500,883.imageset/500,883.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/100mango/ColorPicker/df48f021553437c72acf442e860527dd1cd44a29/ColorPicker/Images.xcassets/realTimeUI/500,883.imageset/500,883.png -------------------------------------------------------------------------------- /ColorPicker/Images.xcassets/realTimeUI/500,883.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x" 6 | }, 7 | { 8 | "idiom" : "universal", 9 | "scale" : "2x", 10 | "filename" : "500,883.png" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "version" : 1, 19 | "author" : "xcode" 20 | } 21 | } -------------------------------------------------------------------------------- /ColorPicker/Launch Screen.xib: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 25 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | -------------------------------------------------------------------------------- /ColorPicker/Main.storyboard: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | 110 | 111 | 112 | 113 | 114 | 115 | 116 | 117 | 118 | 119 | 120 | 121 | 122 | 123 | 130 | 131 | 132 | 133 | 134 | 135 | 136 | 137 | 138 | 139 | 140 | 141 | 142 | 143 | 144 | 145 | 146 | 147 | 148 | 149 | 150 | 151 | 152 | 153 | 154 | 155 | 156 | 157 | 158 | 159 | 160 | 161 | 162 | 163 | 164 | 165 | 166 | 173 | 174 | 175 | 176 | 177 | 178 | 179 | 180 | 181 | 182 | 183 | 184 | 185 | 186 | 187 | 188 | 189 | 190 | 191 | 192 | 193 | 194 | 195 | 196 | 197 | 198 | 199 | 200 | 201 | 202 | 203 | 204 | 205 | 206 | 207 | 208 | 209 | 210 | 211 | 212 | 213 | 214 | 215 | 216 | 217 | 218 | 219 | 220 | 221 | 222 | 223 | 224 | 225 | 226 | 227 | 228 | 229 | 230 | 231 | 232 | 233 | 263 | 264 | 265 | 266 | 267 | 268 | 269 | 270 | 271 | 272 | 273 | 274 | 275 | 276 | 277 | 278 | 279 | 280 | 281 | 282 | 283 | 284 | 285 | 286 | 287 | 288 | 289 | 290 | 291 | 292 | 293 | 294 | 295 | 296 | 297 | 298 | 299 | 300 | 301 | 302 | 303 | 304 | 305 | 306 | 307 | 308 | 309 | 310 | 311 | 312 | 313 | 314 | 315 | 316 | 317 | 318 | 319 | 320 | 321 | 322 | 323 | 324 | 325 | 326 | 327 | 328 | 329 | 330 | 331 | 332 | 333 | 334 | 335 | 336 | 337 | 338 | 339 | 340 | 341 | 342 | 343 | 344 | 345 | 346 | 347 | 348 | 349 | 350 | 351 | 352 | 353 | 354 | 355 | 356 | 357 | 358 | 359 | 360 | 361 | 362 | 363 | 364 | 365 | 366 | 367 | 368 | 369 | 370 | 371 | 372 | 373 | 374 | 375 | 376 | 377 | 378 | 379 | 380 | 381 | 382 | 413 | 414 | 415 | 416 | 417 | 418 | 419 | 420 | 427 | 434 | 441 | 448 | 449 | 450 | 451 | 452 | 453 | 454 | 455 | 456 | 457 | 458 | 459 | 460 | 461 | 462 | 463 | 464 | 465 | 466 | 467 | 468 | 469 | 470 | 471 | 472 | 473 | 474 | 475 | 476 | 477 | 478 | 479 | 480 | 481 | 482 | 483 | 484 | 485 | 486 | 487 | 488 | 489 | 490 | 491 | 492 | 493 | 494 | 495 | 496 | 497 | 498 | 499 | 500 | 501 | 502 | 503 | 504 | 505 | 506 | 507 | 508 | 509 | 510 | 511 | 512 | 513 | 514 | 515 | 516 | 517 | 518 | 519 | 520 | 521 | 522 | 523 | 524 | 525 | 526 | 527 | 528 | 529 | 530 | 531 | 532 | 533 | 534 | 535 | 536 | 537 | 538 | 539 | 540 | 541 | 542 | 543 | 544 | 545 | 546 | 547 | 548 | 549 | 550 | 551 | 552 | 553 | 554 | 555 | 556 | 557 | 558 | 559 | 560 | 561 | 562 | 563 | 564 | 565 | 566 | 567 | 568 | 569 | 570 | 571 | 572 | 573 | 574 | 575 | 576 | 577 | 578 | 579 | 580 | 581 | 582 | 583 | 584 | 585 | 586 | 587 | 588 | 589 | 590 | 591 | 592 | 593 | 594 | 595 | 596 | 597 | 598 | 599 | 600 | 601 | 602 | 603 | 604 | 605 | 606 | 607 | 608 | 609 | 610 | 611 | 612 | 613 | 614 | 615 | 616 | 617 | 618 | 619 | 620 | 621 | 622 | 623 | 624 | 625 | 626 | 627 | 628 | 629 | 630 | 631 | 632 | 633 | 634 | 635 | 636 | 637 | 638 | 639 | 640 | 641 | 642 | 643 | 644 | 645 | 646 | 647 | 648 | 649 | 650 | 651 | 652 | 653 | 654 | 655 | 656 | 657 | 658 | 659 | 660 | 661 | 662 | 663 | 664 | 665 | 666 | 667 | 668 | 669 | 670 | 671 | 672 | 673 | -------------------------------------------------------------------------------- /ColorPicker/TouchColor-Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleDisplayName 8 | ${PRODUCT_NAME} 9 | CFBundleExecutable 10 | ${EXECUTABLE_NAME} 11 | CFBundleIdentifier 12 | $(PRODUCT_BUNDLE_IDENTIFIER) 13 | CFBundleInfoDictionaryVersion 14 | 6.0 15 | CFBundleName 16 | ${PRODUCT_NAME} 17 | CFBundlePackageType 18 | APPL 19 | CFBundleShortVersionString 20 | 2.0 21 | CFBundleSignature 22 | ???? 23 | CFBundleVersion 24 | 2.0 25 | LSRequiresIPhoneOS 26 | 27 | UILaunchStoryboardName 28 | Launch Screen 29 | UIMainStoryboardFile 30 | Main 31 | UIRequiredDeviceCapabilities 32 | 33 | armv7 34 | 35 | UIStatusBarStyle 36 | UIStatusBarStyleLightContent 37 | UISupportedInterfaceOrientations 38 | 39 | UIInterfaceOrientationPortrait 40 | 41 | UIViewControllerBasedStatusBarAppearance 42 | 43 | 44 | 45 | -------------------------------------------------------------------------------- /ColorPicker/TouchColor-Prefix.pch: -------------------------------------------------------------------------------- 1 | // 2 | // Prefix header 3 | // 4 | // The contents of this file are implicitly included at the beginning of every source file. 5 | // 6 | 7 | #import 8 | 9 | #ifndef __IPHONE_5_0 10 | #warning "This project uses features only available in iOS SDK 5.0 and later." 11 | #endif 12 | 13 | #ifdef __OBJC__ 14 | #import 15 | #import 16 | #endif 17 | 18 | #ifdef DEBUG 19 | #define DebugLog(...) NSLog(__VA_ARGS__) 20 | #else 21 | #define DebugLog(...) while(0) 22 | #endif 23 | 24 | #ifdef DEBUG 25 | # define DLog(fmt, ...) NSLog((@"%s [Line %d] " fmt), __PRETTY_FUNCTION__, __LINE__, ##__VA_ARGS__); 26 | #else 27 | # define DLog(...) 28 | #endif 29 | 30 | -------------------------------------------------------------------------------- /ColorPicker/UIView+AnimationExtensions.h: -------------------------------------------------------------------------------- 1 | // 2 | // Created by Rafal Sroka 3 | // 4 | // License CC0. 5 | // This is free and unencumbered software released into the public domain. 6 | // 7 | // Anyone is free to copy, modify, publish, use, compile, sell, or 8 | // distribute this software, either in source code form or as a compiled 9 | // binary, for any purpose, commercial or non-commercial, and by any means. 10 | // 11 | 12 | 13 | /** 14 | @brief Direction of flip animation. 15 | */ 16 | typedef NS_ENUM(NSUInteger, UIViewAnimationFlipDirection) 17 | { 18 | UIViewAnimationFlipDirectionFromTop, 19 | UIViewAnimationFlipDirectionFromLeft, 20 | UIViewAnimationFlipDirectionFromRight, 21 | UIViewAnimationFlipDirectionFromBottom, 22 | }; 23 | 24 | 25 | /** 26 | @brief Direction of rotation animation. 27 | */ 28 | typedef NS_ENUM(NSUInteger, UIViewAnimationRotationDirection) 29 | { 30 | UIViewAnimationRotationDirectionRight, 31 | UIViewAnimationRotationDirectionLeft 32 | }; 33 | 34 | 35 | @interface UIView (AnimationExtensions) 36 | 37 | /** 38 | @brief Shakes the view horizontally for a short period of time. 39 | */ 40 | - (void)shakeHorizontally; 41 | 42 | 43 | /** 44 | @brief Shakes the view vertically for a short period of time. 45 | */ 46 | - (void)shakeVertically; 47 | 48 | 49 | /** 50 | @brief Adds a motion effect to the view. Similar effect can be seen in the 51 | background of the Home Screen on iOS 7. 52 | @note Motion effects are available starting from iOS 7. Calling this method on 53 | older iOS will be ignored. 54 | */ 55 | - (void)applyMotionEffects; 56 | 57 | 58 | /** 59 | @brief Performs a pulsing scale animation on a view. 60 | @param duration - duration of the animation 61 | @param repeat - pass YES for the animation to repeat. 62 | */ 63 | - (void)pulseToSize:(CGFloat)scale 64 | duration:(NSTimeInterval)duration 65 | repeat:(BOOL)repeat; 66 | 67 | 68 | /** 69 | @brief Performs a 3D-like flip animation of the view around center X or Y axis. 70 | @param duration - total time of the animation. 71 | @param direction - direction of the flip movement. 72 | @param repeatCount - number of repetitions of the animation. Pass HUGE_VALF to repeat forever. 73 | @param shouldAutoreverse - pass YES to make the animation reverse when it reaches the end. 74 | */ 75 | - (void)flipWithDuration:(NSTimeInterval)duration 76 | direction:(UIViewAnimationFlipDirection)direction 77 | repeatCount:(NSUInteger)repeatCount 78 | autoreverse:(BOOL)shouldAutoreverse; 79 | 80 | 81 | /** 82 | @brief Performs a rotation animation of the view around its anchor point. 83 | @param angle - end angle of the rotation. Pass M_PI * 2.0 for full circle rotation. 84 | @param duration - total time of the animation. 85 | @param direction - left or right direction of the rotation. 86 | @param repeatCount - number of repetitions of the animation. Pass HUGE_VALF to repeat forever. 87 | @param shouldAutoreverse - pass YES to make the animation reverse when it reaches the end. 88 | */ 89 | - (void)rotateToAngle:(CGFloat)angle 90 | duration:(NSTimeInterval)duration 91 | direction:(UIViewAnimationRotationDirection)direction 92 | repeatCount:(NSUInteger)repeatCount 93 | autoreverse:(BOOL)shouldAutoreverse; 94 | 95 | 96 | /** 97 | @brief Stops current animations. 98 | */ 99 | - (void)stopAnimation; 100 | 101 | 102 | /** 103 | @brief Checks if the view is being animated. 104 | */ 105 | - (BOOL)isBeingAnimated; 106 | 107 | 108 | @end -------------------------------------------------------------------------------- /ColorPicker/UIView+AnimationExtensions.m: -------------------------------------------------------------------------------- 1 | // 2 | // Created by Rafal Sroka 3 | // 4 | // License CC0. 5 | // This is free and unencumbered software released into the public domain. 6 | // 7 | // Anyone is free to copy, modify, publish, use, compile, sell, or 8 | // distribute this software, either in source code form or as a compiled 9 | // binary, for any purpose, commercial or non-commercial, and by any means. 10 | // 11 | 12 | 13 | #import "UIView+AnimationExtensions.h" 14 | 15 | 16 | @implementation UIView (AnimationExtensions) 17 | 18 | 19 | - (void)shakeHorizontally 20 | { 21 | CAKeyframeAnimation *animation = [CAKeyframeAnimation animationWithKeyPath:@"transform.translation.x"]; 22 | 23 | animation.timingFunction = [CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionLinear]; 24 | animation.duration = 0.5; 25 | animation.values = @[@(-12), @(12), @(-8), @(8), @(-4), @(4), @(0) ]; 26 | 27 | [self.layer addAnimation:animation forKey:@"shake"]; 28 | } 29 | 30 | 31 | - (void)shakeVertically 32 | { 33 | CAKeyframeAnimation *animation = [CAKeyframeAnimation animationWithKeyPath:@"transform.translation.y"]; 34 | 35 | animation.timingFunction = [CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionLinear]; 36 | animation.duration = 0.5; 37 | animation.values = @[@(-12), @(12), @(-8), @(8), @(-4), @(4), @(0) ]; 38 | 39 | [self.layer addAnimation:animation forKey:@"shake"]; 40 | } 41 | 42 | 43 | - (void)applyMotionEffects 44 | { 45 | // Motion effects are available starting from iOS 7. 46 | if (([[[UIDevice currentDevice] systemVersion] compare:@"7.0" options:NSNumericSearch] != NSOrderedAscending)) 47 | { 48 | 49 | UIInterpolatingMotionEffect *horizontalEffect = [[UIInterpolatingMotionEffect alloc] initWithKeyPath:@"center.x" 50 | type:UIInterpolatingMotionEffectTypeTiltAlongHorizontalAxis]; 51 | horizontalEffect.minimumRelativeValue = @(-10.0f); 52 | horizontalEffect.maximumRelativeValue = @( 10.0f); 53 | UIInterpolatingMotionEffect *verticalEffect = [[UIInterpolatingMotionEffect alloc] initWithKeyPath:@"center.y" 54 | type:UIInterpolatingMotionEffectTypeTiltAlongVerticalAxis]; 55 | verticalEffect.minimumRelativeValue = @(-10.0f); 56 | verticalEffect.maximumRelativeValue = @( 10.0f); 57 | UIMotionEffectGroup *motionEffectGroup = [[UIMotionEffectGroup alloc] init]; 58 | motionEffectGroup.motionEffects = @[horizontalEffect, verticalEffect]; 59 | 60 | [self addMotionEffect:motionEffectGroup]; 61 | } 62 | } 63 | 64 | 65 | - (void)pulseToSize:(CGFloat)scale 66 | duration:(NSTimeInterval)duration 67 | repeat:(BOOL)repeat 68 | { 69 | CABasicAnimation *pulseAnimation = [CABasicAnimation animationWithKeyPath:@"transform.scale"]; 70 | 71 | pulseAnimation.duration = duration; 72 | pulseAnimation.toValue = [NSNumber numberWithFloat:scale]; 73 | pulseAnimation.timingFunction = [CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionEaseInEaseOut]; 74 | pulseAnimation.autoreverses = YES; 75 | pulseAnimation.repeatCount = repeat ? HUGE_VALF : 0; 76 | 77 | [self.layer addAnimation:pulseAnimation 78 | forKey:@"pulse"]; 79 | } 80 | 81 | 82 | - (void)flipWithDuration:(NSTimeInterval)duration 83 | direction:(UIViewAnimationFlipDirection)direction 84 | repeatCount:(NSUInteger)repeatCount 85 | autoreverse:(BOOL)shouldAutoreverse 86 | { 87 | NSString *subtype = nil; 88 | 89 | switch (direction) 90 | { 91 | case UIViewAnimationFlipDirectionFromTop: 92 | subtype = @"fromTop"; 93 | break; 94 | case UIViewAnimationFlipDirectionFromLeft: 95 | subtype = @"fromLeft"; 96 | break; 97 | case UIViewAnimationFlipDirectionFromBottom: 98 | subtype = @"fromBottom"; 99 | break; 100 | case UIViewAnimationFlipDirectionFromRight: 101 | default: 102 | subtype = @"fromRight"; 103 | break; 104 | } 105 | 106 | CATransition *transition = [CATransition animation]; 107 | 108 | transition.startProgress = 0; 109 | transition.endProgress = 1.0; 110 | transition.type = @"flip"; 111 | transition.subtype = subtype; 112 | transition.duration = duration; 113 | transition.repeatCount = repeatCount; 114 | transition.autoreverses = shouldAutoreverse; 115 | 116 | [self.layer addAnimation:transition 117 | forKey:@"spin"]; 118 | } 119 | 120 | 121 | - (void)rotateToAngle:(CGFloat)angle 122 | duration:(NSTimeInterval)duration 123 | direction:(UIViewAnimationRotationDirection)direction 124 | repeatCount:(NSUInteger)repeatCount 125 | autoreverse:(BOOL)shouldAutoreverse; 126 | { 127 | CABasicAnimation *rotationAnimation = [CABasicAnimation animationWithKeyPath:@"transform.rotation.z"]; 128 | 129 | rotationAnimation.toValue = @(direction == UIViewAnimationRotationDirectionRight ? angle : -angle); 130 | rotationAnimation.duration = duration; 131 | rotationAnimation.autoreverses = shouldAutoreverse; 132 | rotationAnimation.repeatCount = repeatCount; 133 | rotationAnimation.timingFunction = [CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionEaseInEaseOut]; 134 | 135 | [self.layer addAnimation:rotationAnimation 136 | forKey:@"transform.rotation.z"]; 137 | } 138 | 139 | 140 | - (void)stopAnimation 141 | { 142 | [CATransaction begin]; 143 | [self.layer removeAllAnimations]; 144 | [CATransaction commit]; 145 | 146 | [CATransaction flush]; 147 | } 148 | 149 | 150 | - (BOOL)isBeingAnimated 151 | { 152 | return [self.layer.animationKeys count]; 153 | } 154 | 155 | 156 | @end -------------------------------------------------------------------------------- /ColorPicker/UIView+Tools.h: -------------------------------------------------------------------------------- 1 | // 2 | // UIView+Tools.h 3 | // shike 4 | // 5 | // Created by Mango on 14/12/12. 6 | // Copyright (c) 2014年 shixun. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "UIView+AnimationExtensions.h" 11 | 12 | @interface UIView (Tools) 13 | 14 | //将正方形的View裁剪为圆形 15 | - (void)ClipSquareViewToRound; 16 | 17 | //添加边框 18 | - (void)addBottomBorderWithColor: (UIColor *) color andWidth:(CGFloat) borderWidth; 19 | 20 | - (void)addLeftBorderWithColor: (UIColor *) color andWidth:(CGFloat) borderWidth; 21 | 22 | - (void)addRightBorderWithColor: (UIColor *) color andWidth:(CGFloat) borderWidth; 23 | 24 | - (void)addTopBorderWithColor: (UIColor *) color andWidth:(CGFloat) borderWidth; 25 | 26 | //anmation helper 27 | //请使用UIView+AnimationExtensions.h 28 | /** 29 | * 旋转view 30 | * @param angle 弧度:PI = 360度 31 | */ 32 | - (void)rotateViewWithAngle:(CGFloat)angle andDuration:(CGFloat)duration; 33 | 34 | 35 | //封装gestureRecognizer到UIView中,用的时候直接把需触发的block传入即可 36 | - (void)touchEndedBlock:(void(^)(UIView *selfView))block; 37 | 38 | - (void)touchEndedGesture; 39 | 40 | - (void)longPressEndedBlock:(void(^)(UIView *selfView))block; 41 | 42 | - (void)longPressEndedGesture:(UIGestureRecognizer*)gesture; 43 | @end 44 | -------------------------------------------------------------------------------- /ColorPicker/UIView+Tools.m: -------------------------------------------------------------------------------- 1 | // 2 | // UIView+Tools.m 3 | // shike 4 | // 5 | // Created by Mango on 14/12/12. 6 | // Copyright (c) 2014年 shixun. All rights reserved. 7 | // 8 | 9 | #import "UIView+Tools.h" 10 | #import 11 | static const void *BGTouchEndedViewBlockKey = &BGTouchEndedViewBlockKey; 12 | static const void *BGTouchLongPressEndedViewBlockKey = &BGTouchLongPressEndedViewBlockKey; 13 | 14 | 15 | @implementation UIView (Tools) 16 | 17 | - (void)ClipSquareViewToRound 18 | { 19 | if (self.frame.size.width == self.frame.size.height) 20 | { 21 | self.layer.cornerRadius = self.frame.size.width/2; 22 | } 23 | } 24 | 25 | - (void)addTopBorderWithColor:(UIColor *)color andWidth:(CGFloat) borderWidth { 26 | CALayer *border = [CALayer layer]; 27 | border.backgroundColor = color.CGColor; 28 | 29 | border.frame = CGRectMake(0, 0, self.frame.size.width, borderWidth); 30 | [self.layer addSublayer:border]; 31 | } 32 | 33 | - (void)addBottomBorderWithColor:(UIColor *)color andWidth:(CGFloat) borderWidth { 34 | CALayer *border = [CALayer layer]; 35 | border.backgroundColor = color.CGColor; 36 | 37 | border.frame = CGRectMake(0, self.frame.size.height - borderWidth, self.frame.size.width, borderWidth); 38 | [self.layer addSublayer:border]; 39 | } 40 | 41 | - (void)addLeftBorderWithColor:(UIColor *)color andWidth:(CGFloat) borderWidth { 42 | CALayer *border = [CALayer layer]; 43 | border.backgroundColor = color.CGColor; 44 | 45 | border.frame = CGRectMake(0, 0, borderWidth, self.frame.size.height); 46 | [self.layer addSublayer:border]; 47 | } 48 | 49 | - (void)addRightBorderWithColor:(UIColor *)color andWidth:(CGFloat) borderWidth { 50 | CALayer *border = [CALayer layer]; 51 | border.backgroundColor = color.CGColor; 52 | 53 | border.frame = CGRectMake(self.frame.size.width - borderWidth, 0, borderWidth, self.frame.size.height); 54 | [self.layer addSublayer:border]; 55 | } 56 | 57 | #pragma mark -animation 58 | - (void)rotateViewWithAngle:(CGFloat)angle andDuration:(CGFloat)duration 59 | { 60 | 61 | [UIView animateWithDuration:duration animations:^{ 62 | CGAffineTransform oldTransForm = self.transform; 63 | self.transform = CGAffineTransformRotate(oldTransForm, angle); 64 | }]; 65 | } 66 | 67 | #pragma mark -handel action 68 | - (void)touchEndedBlock:(void (^)(UIView *selfView))block 69 | { 70 | self.userInteractionEnabled = YES; 71 | UITapGestureRecognizer *tapped = [[UITapGestureRecognizer alloc] initWithTarget:self 72 | action:@selector(touchEndedGesture)]; 73 | tapped.numberOfTapsRequired = 1; 74 | [self addGestureRecognizer:tapped]; 75 | objc_setAssociatedObject(self, BGTouchEndedViewBlockKey, block, OBJC_ASSOCIATION_COPY_NONATOMIC); 76 | } 77 | 78 | - (void)touchEndedGesture 79 | { 80 | void(^_touchBlock)(UIView *selfView) = objc_getAssociatedObject(self, BGTouchEndedViewBlockKey); 81 | if (_touchBlock) { 82 | _touchBlock(self); 83 | } 84 | } 85 | 86 | -(void)longPressEndedBlock:(void (^)(UIView *selfView))block 87 | { 88 | self.userInteractionEnabled = YES; 89 | UILongPressGestureRecognizer *longPress = [[UILongPressGestureRecognizer alloc]initWithTarget:self action:@selector(longPressEndedGesture:)]; 90 | longPress.minimumPressDuration = 0.5; 91 | [self addGestureRecognizer:longPress]; 92 | objc_setAssociatedObject(self, BGTouchLongPressEndedViewBlockKey, block, OBJC_ASSOCIATION_COPY_NONATOMIC); 93 | } 94 | 95 | -(void)longPressEndedGesture:(UIGestureRecognizer*)gesture 96 | { 97 | if (gesture.state == UIGestureRecognizerStateBegan) { 98 | void(^_touchBlock)(UIView *selfView) = objc_getAssociatedObject(self, BGTouchLongPressEndedViewBlockKey); 99 | if (_touchBlock) { 100 | _touchBlock(self); 101 | } 102 | } 103 | } 104 | 105 | 106 | @end 107 | -------------------------------------------------------------------------------- /ColorPicker/en.lproj/InfoPlist.strings: -------------------------------------------------------------------------------- 1 | /* Localized versions of Info.plist keys */ 2 | 3 | -------------------------------------------------------------------------------- /ColorPicker/main.m: -------------------------------------------------------------------------------- 1 | // 2 | // main.m 3 | // ColorPicker 4 | // 5 | // Created by Mango on 14-2-5. 6 | // Copyright (c) 2014年 Mango. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | #import "ColorAppDelegate.h" 12 | 13 | int main(int argc, char * argv[]) 14 | { 15 | @autoreleasepool { 16 | return UIApplicationMain(argc, argv, nil, NSStringFromClass([ColorAppDelegate class])); 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /ColorPickerTests/ColorPickerTests.m: -------------------------------------------------------------------------------- 1 | // 2 | // ColorPickerTests.m 3 | // ColorPickerTests 4 | // 5 | // Created by Mango on 14-2-5. 6 | // Copyright (c) 2014年 Mango. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface ColorPickerTests : XCTestCase 12 | 13 | @end 14 | 15 | @implementation ColorPickerTests 16 | 17 | - (void)setUp 18 | { 19 | [super setUp]; 20 | // Put setup code here. This method is called before the invocation of each test method in the class. 21 | } 22 | 23 | - (void)tearDown 24 | { 25 | // Put teardown code here. This method is called after the invocation of each test method in the class. 26 | [super tearDown]; 27 | } 28 | 29 | - (void)testExample 30 | { 31 | XCTFail(@"No implementation for \"%s\"", __PRETTY_FUNCTION__); 32 | } 33 | 34 | @end 35 | -------------------------------------------------------------------------------- /ColorPickerTests/TouchColorTests-Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | ${EXECUTABLE_NAME} 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundlePackageType 14 | BNDL 15 | CFBundleShortVersionString 16 | 1.0 17 | CFBundleSignature 18 | ???? 19 | CFBundleVersion 20 | 1 21 | 22 | 23 | -------------------------------------------------------------------------------- /ColorPickerTests/en.lproj/InfoPlist.strings: -------------------------------------------------------------------------------- 1 | /* Localized versions of Info.plist keys */ 2 | 3 | -------------------------------------------------------------------------------- /Podfile: -------------------------------------------------------------------------------- 1 | pod 'GPUImage' 2 | pod 'Masonry' -------------------------------------------------------------------------------- /Podfile.lock: -------------------------------------------------------------------------------- 1 | PODS: 2 | - GPUImage (0.1.7) 3 | - Masonry (0.6.2) 4 | 5 | DEPENDENCIES: 6 | - GPUImage 7 | - Masonry 8 | 9 | SPEC CHECKSUMS: 10 | GPUImage: 733a5f0fab92df9de1c37ba9df520a833ccb406d 11 | Masonry: 362e8a1cc0beada4a4c4832d5e863da2a51533be 12 | 13 | COCOAPODS: 0.39.0 14 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Touch Color 2 | 3 | 1.0版本已于AppStore上架 [AppStore 链接](https://itunes.apple.com/cn/app/touchcolor/id859727780?mt=8) 4 | 5 | 一个优雅简洁,功能完善的取色器。照片取色,照相取色,实时取色三大功能为你带来移动平台最优秀的取色体验。 6 | 7 | ### 1.0版本主要功能 8 | 1. 主要功能 9 | - 照片取色功能 10 | - 实时取色功能 11 | 12 | 2. 技术实现细节 13 | - 纯代码布局与适配iPhone5 14 | - 利用GPUImage实时解析颜色 15 | - 利用CGBitmapContext提取点颜色 16 | 17 | ### 2.0版本进行中 18 | 1. 优化特点 19 | - 全面适配iPhone6,iPhone6 Plus 20 | - 添加图片色调提取功能 21 | - 全新简洁优美设计 22 | 23 | 2. 技术实现细节 24 | - 使用Auto Layout与Size Classes进行布局与设配 25 | - 新架构,优化代码,引用iOS8新特性。例:Self Sizing Cell 与 UIVisualEffectView 26 | 27 | -------------------------------------------------------------------------------- /TouchColor.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 46; 7 | objects = { 8 | 9 | /* Begin PBXBuildFile section */ 10 | 919F8C10591B4FEC9C29849F /* libPods.a in Frameworks */ = {isa = PBXBuildFile; fileRef = ECA1429469F24160A189FA16 /* libPods.a */; }; 11 | DB8C5C5E1A68E0DB00B4B2CA /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = DB8C5C5D1A68E0DB00B4B2CA /* Main.storyboard */; }; 12 | DB8C5C611A68E72900B4B2CA /* ColorMainViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = DB8C5C601A68E72900B4B2CA /* ColorMainViewController.m */; }; 13 | DB8C5C631A68E8C600B4B2CA /* Launch Screen.xib in Resources */ = {isa = PBXBuildFile; fileRef = DB8C5C621A68E8C600B4B2CA /* Launch Screen.xib */; }; 14 | DB93B18418A9267F005238B0 /* QuartzCore.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = DB93B18318A9267F005238B0 /* QuartzCore.framework */; }; 15 | DB93B18A18A9D536005238B0 /* ColorDetectView.m in Sources */ = {isa = PBXBuildFile; fileRef = DB93B18918A9D536005238B0 /* ColorDetectView.m */; }; 16 | DB93B19218AA1352005238B0 /* ColorRealTimeViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = DB93B19118AA1352005238B0 /* ColorRealTimeViewController.m */; }; 17 | DB93B19418AA1ED8005238B0 /* AVFoundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = DB93B19318AA1ED8005238B0 /* AVFoundation.framework */; }; 18 | DB9AE0D21A6E68C700E29EFF /* UIView+AnimationExtensions.m in Sources */ = {isa = PBXBuildFile; fileRef = DB9AE0D11A6E68C700E29EFF /* UIView+AnimationExtensions.m */; }; 19 | DB9AE0D51A6E68E900E29EFF /* UIView+Tools.m in Sources */ = {isa = PBXBuildFile; fileRef = DB9AE0D41A6E68E900E29EFF /* UIView+Tools.m */; }; 20 | DB9AE0DB1A6E94BE00E29EFF /* ColorSingleColorCell.m in Sources */ = {isa = PBXBuildFile; fileRef = DB9AE0D91A6E94BE00E29EFF /* ColorSingleColorCell.m */; }; 21 | DB9AE0DC1A6E94BE00E29EFF /* ColorSingleColorCell.xib in Resources */ = {isa = PBXBuildFile; fileRef = DB9AE0DA1A6E94BE00E29EFF /* ColorSingleColorCell.xib */; }; 22 | DB9D173018ABBF74009963BC /* CoreMedia.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = DB9D172F18ABBF74009963BC /* CoreMedia.framework */; }; 23 | DBD463141A6FE76800C29AFD /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = DBD463131A6FE76800C29AFD /* Images.xcassets */; }; 24 | DBE8C39318A20F5400E2B304 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = DBE8C39218A20F5400E2B304 /* Foundation.framework */; }; 25 | DBE8C39518A20F5400E2B304 /* CoreGraphics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = DBE8C39418A20F5400E2B304 /* CoreGraphics.framework */; }; 26 | DBE8C39718A20F5400E2B304 /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = DBE8C39618A20F5400E2B304 /* UIKit.framework */; }; 27 | DBE8C39D18A20F5400E2B304 /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = DBE8C39B18A20F5400E2B304 /* InfoPlist.strings */; }; 28 | DBE8C39F18A20F5400E2B304 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = DBE8C39E18A20F5400E2B304 /* main.m */; }; 29 | DBE8C3A318A20F5400E2B304 /* ColorAppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = DBE8C3A218A20F5400E2B304 /* ColorAppDelegate.m */; }; 30 | DBE8C3A918A20F5400E2B304 /* ColorViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = DBE8C3A818A20F5400E2B304 /* ColorViewController.m */; }; 31 | DBE8C3B218A20F5400E2B304 /* XCTest.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = DBE8C3B118A20F5400E2B304 /* XCTest.framework */; }; 32 | DBE8C3B318A20F5400E2B304 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = DBE8C39218A20F5400E2B304 /* Foundation.framework */; }; 33 | DBE8C3B418A20F5400E2B304 /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = DBE8C39618A20F5400E2B304 /* UIKit.framework */; }; 34 | DBE8C3BC18A20F5400E2B304 /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = DBE8C3BA18A20F5400E2B304 /* InfoPlist.strings */; }; 35 | DBE8C3BE18A20F5400E2B304 /* ColorPickerTests.m in Sources */ = {isa = PBXBuildFile; fileRef = DBE8C3BD18A20F5400E2B304 /* ColorPickerTests.m */; }; 36 | /* End PBXBuildFile section */ 37 | 38 | /* Begin PBXContainerItemProxy section */ 39 | DBE8C3B518A20F5400E2B304 /* PBXContainerItemProxy */ = { 40 | isa = PBXContainerItemProxy; 41 | containerPortal = DBE8C38718A20F5400E2B304 /* Project object */; 42 | proxyType = 1; 43 | remoteGlobalIDString = DBE8C38E18A20F5400E2B304; 44 | remoteInfo = ColorPicker; 45 | }; 46 | /* End PBXContainerItemProxy section */ 47 | 48 | /* Begin PBXFileReference section */ 49 | 869745FFE178D5DA597F4B90 /* Pods.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = Pods.debug.xcconfig; path = "Pods/Target Support Files/Pods/Pods.debug.xcconfig"; sourceTree = ""; }; 50 | B4FEEDA0039CCE82D5EAFCC3 /* Pods.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = Pods.release.xcconfig; path = "Pods/Target Support Files/Pods/Pods.release.xcconfig"; sourceTree = ""; }; 51 | DB8C5C5D1A68E0DB00B4B2CA /* Main.storyboard */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.storyboard; path = Main.storyboard; sourceTree = ""; }; 52 | DB8C5C5F1A68E72900B4B2CA /* ColorMainViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ColorMainViewController.h; sourceTree = ""; }; 53 | DB8C5C601A68E72900B4B2CA /* ColorMainViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ColorMainViewController.m; sourceTree = ""; }; 54 | DB8C5C621A68E8C600B4B2CA /* Launch Screen.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = "Launch Screen.xib"; sourceTree = ""; }; 55 | DB93B18318A9267F005238B0 /* QuartzCore.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = QuartzCore.framework; path = System/Library/Frameworks/QuartzCore.framework; sourceTree = SDKROOT; }; 56 | DB93B18818A9D536005238B0 /* ColorDetectView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ColorDetectView.h; sourceTree = ""; }; 57 | DB93B18918A9D536005238B0 /* ColorDetectView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ColorDetectView.m; sourceTree = ""; }; 58 | DB93B19018AA1352005238B0 /* ColorRealTimeViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ColorRealTimeViewController.h; sourceTree = ""; }; 59 | DB93B19118AA1352005238B0 /* ColorRealTimeViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ColorRealTimeViewController.m; sourceTree = ""; }; 60 | DB93B19318AA1ED8005238B0 /* AVFoundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AVFoundation.framework; path = System/Library/Frameworks/AVFoundation.framework; sourceTree = SDKROOT; }; 61 | DB9AE0D01A6E68C700E29EFF /* UIView+AnimationExtensions.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "UIView+AnimationExtensions.h"; sourceTree = ""; }; 62 | DB9AE0D11A6E68C700E29EFF /* UIView+AnimationExtensions.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "UIView+AnimationExtensions.m"; sourceTree = ""; }; 63 | DB9AE0D31A6E68E900E29EFF /* UIView+Tools.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "UIView+Tools.h"; sourceTree = ""; }; 64 | DB9AE0D41A6E68E900E29EFF /* UIView+Tools.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "UIView+Tools.m"; sourceTree = ""; }; 65 | DB9AE0D81A6E94BE00E29EFF /* ColorSingleColorCell.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ColorSingleColorCell.h; sourceTree = ""; }; 66 | DB9AE0D91A6E94BE00E29EFF /* ColorSingleColorCell.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ColorSingleColorCell.m; sourceTree = ""; }; 67 | DB9AE0DA1A6E94BE00E29EFF /* ColorSingleColorCell.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = ColorSingleColorCell.xib; sourceTree = ""; }; 68 | DB9D172F18ABBF74009963BC /* CoreMedia.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreMedia.framework; path = System/Library/Frameworks/CoreMedia.framework; sourceTree = SDKROOT; }; 69 | DBD463131A6FE76800C29AFD /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Images.xcassets; sourceTree = ""; }; 70 | DBE8C38F18A20F5400E2B304 /* TouchColor.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = TouchColor.app; sourceTree = BUILT_PRODUCTS_DIR; }; 71 | DBE8C39218A20F5400E2B304 /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; }; 72 | DBE8C39418A20F5400E2B304 /* CoreGraphics.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreGraphics.framework; path = System/Library/Frameworks/CoreGraphics.framework; sourceTree = SDKROOT; }; 73 | DBE8C39618A20F5400E2B304 /* UIKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = UIKit.framework; path = System/Library/Frameworks/UIKit.framework; sourceTree = SDKROOT; }; 74 | DBE8C39A18A20F5400E2B304 /* TouchColor-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "TouchColor-Info.plist"; sourceTree = ""; }; 75 | DBE8C39C18A20F5400E2B304 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = ""; }; 76 | DBE8C39E18A20F5400E2B304 /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; 77 | DBE8C3A018A20F5400E2B304 /* TouchColor-Prefix.pch */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "TouchColor-Prefix.pch"; sourceTree = ""; }; 78 | DBE8C3A118A20F5400E2B304 /* ColorAppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ColorAppDelegate.h; sourceTree = ""; }; 79 | DBE8C3A218A20F5400E2B304 /* ColorAppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = ColorAppDelegate.m; sourceTree = ""; }; 80 | DBE8C3A718A20F5400E2B304 /* ColorViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ColorViewController.h; sourceTree = ""; }; 81 | DBE8C3A818A20F5400E2B304 /* ColorViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = ColorViewController.m; sourceTree = ""; }; 82 | DBE8C3B018A20F5400E2B304 /* TouchColor.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = TouchColor.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; 83 | DBE8C3B118A20F5400E2B304 /* XCTest.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = XCTest.framework; path = Library/Frameworks/XCTest.framework; sourceTree = DEVELOPER_DIR; }; 84 | DBE8C3B918A20F5400E2B304 /* TouchColorTests-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "TouchColorTests-Info.plist"; sourceTree = ""; }; 85 | DBE8C3BB18A20F5400E2B304 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = ""; }; 86 | DBE8C3BD18A20F5400E2B304 /* ColorPickerTests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = ColorPickerTests.m; sourceTree = ""; }; 87 | ECA1429469F24160A189FA16 /* libPods.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libPods.a; sourceTree = BUILT_PRODUCTS_DIR; }; 88 | /* End PBXFileReference section */ 89 | 90 | /* Begin PBXFrameworksBuildPhase section */ 91 | DBE8C38C18A20F5400E2B304 /* Frameworks */ = { 92 | isa = PBXFrameworksBuildPhase; 93 | buildActionMask = 2147483647; 94 | files = ( 95 | DB9D173018ABBF74009963BC /* CoreMedia.framework in Frameworks */, 96 | DB93B19418AA1ED8005238B0 /* AVFoundation.framework in Frameworks */, 97 | DB93B18418A9267F005238B0 /* QuartzCore.framework in Frameworks */, 98 | DBE8C39518A20F5400E2B304 /* CoreGraphics.framework in Frameworks */, 99 | DBE8C39718A20F5400E2B304 /* UIKit.framework in Frameworks */, 100 | DBE8C39318A20F5400E2B304 /* Foundation.framework in Frameworks */, 101 | 919F8C10591B4FEC9C29849F /* libPods.a in Frameworks */, 102 | ); 103 | runOnlyForDeploymentPostprocessing = 0; 104 | }; 105 | DBE8C3AD18A20F5400E2B304 /* Frameworks */ = { 106 | isa = PBXFrameworksBuildPhase; 107 | buildActionMask = 2147483647; 108 | files = ( 109 | DBE8C3B218A20F5400E2B304 /* XCTest.framework in Frameworks */, 110 | DBE8C3B418A20F5400E2B304 /* UIKit.framework in Frameworks */, 111 | DBE8C3B318A20F5400E2B304 /* Foundation.framework in Frameworks */, 112 | ); 113 | runOnlyForDeploymentPostprocessing = 0; 114 | }; 115 | /* End PBXFrameworksBuildPhase section */ 116 | 117 | /* Begin PBXGroup section */ 118 | D2CDB3852B9D36D3DF50E479 /* Pods */ = { 119 | isa = PBXGroup; 120 | children = ( 121 | 869745FFE178D5DA597F4B90 /* Pods.debug.xcconfig */, 122 | B4FEEDA0039CCE82D5EAFCC3 /* Pods.release.xcconfig */, 123 | ); 124 | name = Pods; 125 | sourceTree = ""; 126 | }; 127 | DB93B18E18AA116A005238B0 /* Controller */ = { 128 | isa = PBXGroup; 129 | children = ( 130 | DBE8C3A718A20F5400E2B304 /* ColorViewController.h */, 131 | DBE8C3A818A20F5400E2B304 /* ColorViewController.m */, 132 | DB93B19018AA1352005238B0 /* ColorRealTimeViewController.h */, 133 | DB93B19118AA1352005238B0 /* ColorRealTimeViewController.m */, 134 | DB8C5C5F1A68E72900B4B2CA /* ColorMainViewController.h */, 135 | DB8C5C601A68E72900B4B2CA /* ColorMainViewController.m */, 136 | ); 137 | name = Controller; 138 | sourceTree = ""; 139 | }; 140 | DB93B18F18AA12A9005238B0 /* View */ = { 141 | isa = PBXGroup; 142 | children = ( 143 | DB93B18818A9D536005238B0 /* ColorDetectView.h */, 144 | DB93B18918A9D536005238B0 /* ColorDetectView.m */, 145 | DB9AE0D81A6E94BE00E29EFF /* ColorSingleColorCell.h */, 146 | DB9AE0D91A6E94BE00E29EFF /* ColorSingleColorCell.m */, 147 | DB9AE0DA1A6E94BE00E29EFF /* ColorSingleColorCell.xib */, 148 | ); 149 | name = View; 150 | sourceTree = ""; 151 | }; 152 | DBC3F3AC1A6E427300BD52B0 /* Tools */ = { 153 | isa = PBXGroup; 154 | children = ( 155 | DB9AE0D31A6E68E900E29EFF /* UIView+Tools.h */, 156 | DB9AE0D41A6E68E900E29EFF /* UIView+Tools.m */, 157 | DB9AE0D01A6E68C700E29EFF /* UIView+AnimationExtensions.h */, 158 | DB9AE0D11A6E68C700E29EFF /* UIView+AnimationExtensions.m */, 159 | ); 160 | name = Tools; 161 | sourceTree = ""; 162 | }; 163 | DBE8C38618A20F5400E2B304 = { 164 | isa = PBXGroup; 165 | children = ( 166 | DBE8C39818A20F5400E2B304 /* ColorPicker */, 167 | DBE8C3B718A20F5400E2B304 /* ColorPickerTests */, 168 | DBE8C39118A20F5400E2B304 /* Frameworks */, 169 | DBE8C39018A20F5400E2B304 /* Products */, 170 | D2CDB3852B9D36D3DF50E479 /* Pods */, 171 | ); 172 | sourceTree = ""; 173 | }; 174 | DBE8C39018A20F5400E2B304 /* Products */ = { 175 | isa = PBXGroup; 176 | children = ( 177 | DBE8C38F18A20F5400E2B304 /* TouchColor.app */, 178 | DBE8C3B018A20F5400E2B304 /* TouchColor.xctest */, 179 | ); 180 | name = Products; 181 | sourceTree = ""; 182 | }; 183 | DBE8C39118A20F5400E2B304 /* Frameworks */ = { 184 | isa = PBXGroup; 185 | children = ( 186 | DB9D172F18ABBF74009963BC /* CoreMedia.framework */, 187 | DB93B19318AA1ED8005238B0 /* AVFoundation.framework */, 188 | DB93B18318A9267F005238B0 /* QuartzCore.framework */, 189 | DBE8C39218A20F5400E2B304 /* Foundation.framework */, 190 | DBE8C39418A20F5400E2B304 /* CoreGraphics.framework */, 191 | DBE8C39618A20F5400E2B304 /* UIKit.framework */, 192 | DBE8C3B118A20F5400E2B304 /* XCTest.framework */, 193 | ECA1429469F24160A189FA16 /* libPods.a */, 194 | ); 195 | name = Frameworks; 196 | sourceTree = ""; 197 | }; 198 | DBE8C39818A20F5400E2B304 /* ColorPicker */ = { 199 | isa = PBXGroup; 200 | children = ( 201 | DBC3F3AC1A6E427300BD52B0 /* Tools */, 202 | DBE8C3A118A20F5400E2B304 /* ColorAppDelegate.h */, 203 | DBE8C3A218A20F5400E2B304 /* ColorAppDelegate.m */, 204 | DB8C5C5D1A68E0DB00B4B2CA /* Main.storyboard */, 205 | DB8C5C621A68E8C600B4B2CA /* Launch Screen.xib */, 206 | DBD463131A6FE76800C29AFD /* Images.xcassets */, 207 | DB93B18E18AA116A005238B0 /* Controller */, 208 | DB93B18F18AA12A9005238B0 /* View */, 209 | DBE8C39918A20F5400E2B304 /* Supporting Files */, 210 | ); 211 | path = ColorPicker; 212 | sourceTree = ""; 213 | }; 214 | DBE8C39918A20F5400E2B304 /* Supporting Files */ = { 215 | isa = PBXGroup; 216 | children = ( 217 | DBE8C39A18A20F5400E2B304 /* TouchColor-Info.plist */, 218 | DBE8C39E18A20F5400E2B304 /* main.m */, 219 | DBE8C39B18A20F5400E2B304 /* InfoPlist.strings */, 220 | DBE8C3A018A20F5400E2B304 /* TouchColor-Prefix.pch */, 221 | ); 222 | name = "Supporting Files"; 223 | sourceTree = ""; 224 | }; 225 | DBE8C3B718A20F5400E2B304 /* ColorPickerTests */ = { 226 | isa = PBXGroup; 227 | children = ( 228 | DBE8C3BD18A20F5400E2B304 /* ColorPickerTests.m */, 229 | DBE8C3B818A20F5400E2B304 /* Supporting Files */, 230 | ); 231 | path = ColorPickerTests; 232 | sourceTree = ""; 233 | }; 234 | DBE8C3B818A20F5400E2B304 /* Supporting Files */ = { 235 | isa = PBXGroup; 236 | children = ( 237 | DBE8C3B918A20F5400E2B304 /* TouchColorTests-Info.plist */, 238 | DBE8C3BA18A20F5400E2B304 /* InfoPlist.strings */, 239 | ); 240 | name = "Supporting Files"; 241 | sourceTree = ""; 242 | }; 243 | /* End PBXGroup section */ 244 | 245 | /* Begin PBXNativeTarget section */ 246 | DBE8C38E18A20F5400E2B304 /* TouchColor */ = { 247 | isa = PBXNativeTarget; 248 | buildConfigurationList = DBE8C3C118A20F5400E2B304 /* Build configuration list for PBXNativeTarget "TouchColor" */; 249 | buildPhases = ( 250 | 4B5E31E6188646B1BC2F8EAA /* Check Pods Manifest.lock */, 251 | DBE8C38B18A20F5400E2B304 /* Sources */, 252 | DBE8C38C18A20F5400E2B304 /* Frameworks */, 253 | DBE8C38D18A20F5400E2B304 /* Resources */, 254 | 1A301488B60448E3B4C51C84 /* Copy Pods Resources */, 255 | 276FC8F6D0D30C9F9AFCC552 /* Embed Pods Frameworks */, 256 | ); 257 | buildRules = ( 258 | ); 259 | dependencies = ( 260 | ); 261 | name = TouchColor; 262 | productName = ColorPicker; 263 | productReference = DBE8C38F18A20F5400E2B304 /* TouchColor.app */; 264 | productType = "com.apple.product-type.application"; 265 | }; 266 | DBE8C3AF18A20F5400E2B304 /* TouchColorTests */ = { 267 | isa = PBXNativeTarget; 268 | buildConfigurationList = DBE8C3C418A20F5400E2B304 /* Build configuration list for PBXNativeTarget "TouchColorTests" */; 269 | buildPhases = ( 270 | DBE8C3AC18A20F5400E2B304 /* Sources */, 271 | DBE8C3AD18A20F5400E2B304 /* Frameworks */, 272 | DBE8C3AE18A20F5400E2B304 /* Resources */, 273 | ); 274 | buildRules = ( 275 | ); 276 | dependencies = ( 277 | DBE8C3B618A20F5400E2B304 /* PBXTargetDependency */, 278 | ); 279 | name = TouchColorTests; 280 | productName = ColorPickerTests; 281 | productReference = DBE8C3B018A20F5400E2B304 /* TouchColor.xctest */; 282 | productType = "com.apple.product-type.bundle.unit-test"; 283 | }; 284 | /* End PBXNativeTarget section */ 285 | 286 | /* Begin PBXProject section */ 287 | DBE8C38718A20F5400E2B304 /* Project object */ = { 288 | isa = PBXProject; 289 | attributes = { 290 | CLASSPREFIX = Color; 291 | LastUpgradeCheck = 0710; 292 | ORGANIZATIONNAME = Mango; 293 | TargetAttributes = { 294 | DBE8C38E18A20F5400E2B304 = { 295 | DevelopmentTeam = J8GWD93J5V; 296 | }; 297 | DBE8C3AF18A20F5400E2B304 = { 298 | TestTargetID = DBE8C38E18A20F5400E2B304; 299 | }; 300 | }; 301 | }; 302 | buildConfigurationList = DBE8C38A18A20F5400E2B304 /* Build configuration list for PBXProject "TouchColor" */; 303 | compatibilityVersion = "Xcode 3.2"; 304 | developmentRegion = English; 305 | hasScannedForEncodings = 0; 306 | knownRegions = ( 307 | en, 308 | Base, 309 | ); 310 | mainGroup = DBE8C38618A20F5400E2B304; 311 | productRefGroup = DBE8C39018A20F5400E2B304 /* Products */; 312 | projectDirPath = ""; 313 | projectRoot = ""; 314 | targets = ( 315 | DBE8C38E18A20F5400E2B304 /* TouchColor */, 316 | DBE8C3AF18A20F5400E2B304 /* TouchColorTests */, 317 | ); 318 | }; 319 | /* End PBXProject section */ 320 | 321 | /* Begin PBXResourcesBuildPhase section */ 322 | DBE8C38D18A20F5400E2B304 /* Resources */ = { 323 | isa = PBXResourcesBuildPhase; 324 | buildActionMask = 2147483647; 325 | files = ( 326 | DBE8C39D18A20F5400E2B304 /* InfoPlist.strings in Resources */, 327 | DB9AE0DC1A6E94BE00E29EFF /* ColorSingleColorCell.xib in Resources */, 328 | DB8C5C5E1A68E0DB00B4B2CA /* Main.storyboard in Resources */, 329 | DBD463141A6FE76800C29AFD /* Images.xcassets in Resources */, 330 | DB8C5C631A68E8C600B4B2CA /* Launch Screen.xib in Resources */, 331 | ); 332 | runOnlyForDeploymentPostprocessing = 0; 333 | }; 334 | DBE8C3AE18A20F5400E2B304 /* Resources */ = { 335 | isa = PBXResourcesBuildPhase; 336 | buildActionMask = 2147483647; 337 | files = ( 338 | DBE8C3BC18A20F5400E2B304 /* InfoPlist.strings in Resources */, 339 | ); 340 | runOnlyForDeploymentPostprocessing = 0; 341 | }; 342 | /* End PBXResourcesBuildPhase section */ 343 | 344 | /* Begin PBXShellScriptBuildPhase section */ 345 | 1A301488B60448E3B4C51C84 /* Copy Pods Resources */ = { 346 | isa = PBXShellScriptBuildPhase; 347 | buildActionMask = 2147483647; 348 | files = ( 349 | ); 350 | inputPaths = ( 351 | ); 352 | name = "Copy Pods Resources"; 353 | outputPaths = ( 354 | ); 355 | runOnlyForDeploymentPostprocessing = 0; 356 | shellPath = /bin/sh; 357 | shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods/Pods-resources.sh\"\n"; 358 | showEnvVarsInLog = 0; 359 | }; 360 | 276FC8F6D0D30C9F9AFCC552 /* Embed Pods Frameworks */ = { 361 | isa = PBXShellScriptBuildPhase; 362 | buildActionMask = 2147483647; 363 | files = ( 364 | ); 365 | inputPaths = ( 366 | ); 367 | name = "Embed Pods Frameworks"; 368 | outputPaths = ( 369 | ); 370 | runOnlyForDeploymentPostprocessing = 0; 371 | shellPath = /bin/sh; 372 | shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods/Pods-frameworks.sh\"\n"; 373 | showEnvVarsInLog = 0; 374 | }; 375 | 4B5E31E6188646B1BC2F8EAA /* Check Pods Manifest.lock */ = { 376 | isa = PBXShellScriptBuildPhase; 377 | buildActionMask = 2147483647; 378 | files = ( 379 | ); 380 | inputPaths = ( 381 | ); 382 | name = "Check Pods Manifest.lock"; 383 | outputPaths = ( 384 | ); 385 | runOnlyForDeploymentPostprocessing = 0; 386 | shellPath = /bin/sh; 387 | shellScript = "diff \"${PODS_ROOT}/../Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [[ $? != 0 ]] ; then\n cat << EOM\nerror: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\nEOM\n exit 1\nfi\n"; 388 | showEnvVarsInLog = 0; 389 | }; 390 | /* End PBXShellScriptBuildPhase section */ 391 | 392 | /* Begin PBXSourcesBuildPhase section */ 393 | DBE8C38B18A20F5400E2B304 /* Sources */ = { 394 | isa = PBXSourcesBuildPhase; 395 | buildActionMask = 2147483647; 396 | files = ( 397 | DBE8C3A318A20F5400E2B304 /* ColorAppDelegate.m in Sources */, 398 | DB9AE0D21A6E68C700E29EFF /* UIView+AnimationExtensions.m in Sources */, 399 | DB9AE0DB1A6E94BE00E29EFF /* ColorSingleColorCell.m in Sources */, 400 | DBE8C39F18A20F5400E2B304 /* main.m in Sources */, 401 | DBE8C3A918A20F5400E2B304 /* ColorViewController.m in Sources */, 402 | DB93B18A18A9D536005238B0 /* ColorDetectView.m in Sources */, 403 | DB93B19218AA1352005238B0 /* ColorRealTimeViewController.m in Sources */, 404 | DB9AE0D51A6E68E900E29EFF /* UIView+Tools.m in Sources */, 405 | DB8C5C611A68E72900B4B2CA /* ColorMainViewController.m in Sources */, 406 | ); 407 | runOnlyForDeploymentPostprocessing = 0; 408 | }; 409 | DBE8C3AC18A20F5400E2B304 /* Sources */ = { 410 | isa = PBXSourcesBuildPhase; 411 | buildActionMask = 2147483647; 412 | files = ( 413 | DBE8C3BE18A20F5400E2B304 /* ColorPickerTests.m in Sources */, 414 | ); 415 | runOnlyForDeploymentPostprocessing = 0; 416 | }; 417 | /* End PBXSourcesBuildPhase section */ 418 | 419 | /* Begin PBXTargetDependency section */ 420 | DBE8C3B618A20F5400E2B304 /* PBXTargetDependency */ = { 421 | isa = PBXTargetDependency; 422 | target = DBE8C38E18A20F5400E2B304 /* TouchColor */; 423 | targetProxy = DBE8C3B518A20F5400E2B304 /* PBXContainerItemProxy */; 424 | }; 425 | /* End PBXTargetDependency section */ 426 | 427 | /* Begin PBXVariantGroup section */ 428 | DBE8C39B18A20F5400E2B304 /* InfoPlist.strings */ = { 429 | isa = PBXVariantGroup; 430 | children = ( 431 | DBE8C39C18A20F5400E2B304 /* en */, 432 | ); 433 | name = InfoPlist.strings; 434 | sourceTree = ""; 435 | }; 436 | DBE8C3BA18A20F5400E2B304 /* InfoPlist.strings */ = { 437 | isa = PBXVariantGroup; 438 | children = ( 439 | DBE8C3BB18A20F5400E2B304 /* en */, 440 | ); 441 | name = InfoPlist.strings; 442 | sourceTree = ""; 443 | }; 444 | /* End PBXVariantGroup section */ 445 | 446 | /* Begin XCBuildConfiguration section */ 447 | DBE8C3BF18A20F5400E2B304 /* Debug */ = { 448 | isa = XCBuildConfiguration; 449 | buildSettings = { 450 | ALWAYS_SEARCH_USER_PATHS = NO; 451 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 452 | CLANG_CXX_LIBRARY = "libc++"; 453 | CLANG_ENABLE_MODULES = YES; 454 | CLANG_ENABLE_OBJC_ARC = YES; 455 | CLANG_WARN_BOOL_CONVERSION = YES; 456 | CLANG_WARN_CONSTANT_CONVERSION = YES; 457 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 458 | CLANG_WARN_EMPTY_BODY = YES; 459 | CLANG_WARN_ENUM_CONVERSION = YES; 460 | CLANG_WARN_INT_CONVERSION = YES; 461 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 462 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 463 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 464 | COPY_PHASE_STRIP = NO; 465 | ENABLE_TESTABILITY = YES; 466 | GCC_C_LANGUAGE_STANDARD = gnu99; 467 | GCC_DYNAMIC_NO_PIC = NO; 468 | GCC_OPTIMIZATION_LEVEL = 0; 469 | GCC_PREPROCESSOR_DEFINITIONS = ( 470 | "DEBUG=1", 471 | "$(inherited)", 472 | ); 473 | GCC_SYMBOLS_PRIVATE_EXTERN = NO; 474 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 475 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 476 | GCC_WARN_UNDECLARED_SELECTOR = YES; 477 | GCC_WARN_UNINITIALIZED_AUTOS = YES; 478 | GCC_WARN_UNUSED_FUNCTION = YES; 479 | GCC_WARN_UNUSED_VARIABLE = YES; 480 | IPHONEOS_DEPLOYMENT_TARGET = 7.0; 481 | ONLY_ACTIVE_ARCH = YES; 482 | PRODUCT_NAME = TouchColor; 483 | SDKROOT = iphoneos; 484 | }; 485 | name = Debug; 486 | }; 487 | DBE8C3C018A20F5400E2B304 /* Release */ = { 488 | isa = XCBuildConfiguration; 489 | buildSettings = { 490 | ALWAYS_SEARCH_USER_PATHS = NO; 491 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 492 | CLANG_CXX_LIBRARY = "libc++"; 493 | CLANG_ENABLE_MODULES = YES; 494 | CLANG_ENABLE_OBJC_ARC = YES; 495 | CLANG_WARN_BOOL_CONVERSION = YES; 496 | CLANG_WARN_CONSTANT_CONVERSION = YES; 497 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 498 | CLANG_WARN_EMPTY_BODY = YES; 499 | CLANG_WARN_ENUM_CONVERSION = YES; 500 | CLANG_WARN_INT_CONVERSION = YES; 501 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 502 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 503 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 504 | COPY_PHASE_STRIP = YES; 505 | ENABLE_NS_ASSERTIONS = NO; 506 | GCC_C_LANGUAGE_STANDARD = gnu99; 507 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 508 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 509 | GCC_WARN_UNDECLARED_SELECTOR = YES; 510 | GCC_WARN_UNINITIALIZED_AUTOS = YES; 511 | GCC_WARN_UNUSED_FUNCTION = YES; 512 | GCC_WARN_UNUSED_VARIABLE = YES; 513 | IPHONEOS_DEPLOYMENT_TARGET = 7.0; 514 | PRODUCT_NAME = TouchColor; 515 | SDKROOT = iphoneos; 516 | VALIDATE_PRODUCT = YES; 517 | }; 518 | name = Release; 519 | }; 520 | DBE8C3C218A20F5400E2B304 /* Debug */ = { 521 | isa = XCBuildConfiguration; 522 | baseConfigurationReference = 869745FFE178D5DA597F4B90 /* Pods.debug.xcconfig */; 523 | buildSettings = { 524 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 525 | ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage; 526 | CODE_SIGN_IDENTITY = "iPhone Developer"; 527 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 528 | GCC_PRECOMPILE_PREFIX_HEADER = YES; 529 | GCC_PREFIX_HEADER = "ColorPicker/TouchColor-Prefix.pch"; 530 | INFOPLIST_FILE = "ColorPicker/TouchColor-Info.plist"; 531 | IPHONEOS_DEPLOYMENT_TARGET = 8.0; 532 | ONLY_ACTIVE_ARCH = YES; 533 | PRODUCT_BUNDLE_IDENTIFIER = com.mango.touchColor; 534 | PRODUCT_NAME = TouchColor; 535 | PROVISIONING_PROFILE = ""; 536 | SDKROOT = iphoneos; 537 | WRAPPER_EXTENSION = app; 538 | }; 539 | name = Debug; 540 | }; 541 | DBE8C3C318A20F5400E2B304 /* Release */ = { 542 | isa = XCBuildConfiguration; 543 | baseConfigurationReference = B4FEEDA0039CCE82D5EAFCC3 /* Pods.release.xcconfig */; 544 | buildSettings = { 545 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 546 | ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage; 547 | CODE_SIGN_IDENTITY = "iPhone Developer"; 548 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 549 | GCC_PRECOMPILE_PREFIX_HEADER = YES; 550 | GCC_PREFIX_HEADER = "ColorPicker/TouchColor-Prefix.pch"; 551 | INFOPLIST_FILE = "ColorPicker/TouchColor-Info.plist"; 552 | IPHONEOS_DEPLOYMENT_TARGET = 8.0; 553 | ONLY_ACTIVE_ARCH = YES; 554 | PRODUCT_BUNDLE_IDENTIFIER = com.mango.touchColor; 555 | PRODUCT_NAME = TouchColor; 556 | PROVISIONING_PROFILE = ""; 557 | SDKROOT = iphoneos; 558 | WRAPPER_EXTENSION = app; 559 | }; 560 | name = Release; 561 | }; 562 | DBE8C3C518A20F5400E2B304 /* Debug */ = { 563 | isa = XCBuildConfiguration; 564 | buildSettings = { 565 | BUNDLE_LOADER = "$(BUILT_PRODUCTS_DIR)/ColorPicker.app/ColorPicker"; 566 | FRAMEWORK_SEARCH_PATHS = ( 567 | "$(SDKROOT)/Developer/Library/Frameworks", 568 | "$(inherited)", 569 | "$(DEVELOPER_FRAMEWORKS_DIR)", 570 | ); 571 | GCC_PRECOMPILE_PREFIX_HEADER = YES; 572 | GCC_PREFIX_HEADER = "ColorPicker/TouchColor-Prefix.pch"; 573 | GCC_PREPROCESSOR_DEFINITIONS = ( 574 | "DEBUG=1", 575 | "$(inherited)", 576 | ); 577 | INFOPLIST_FILE = "ColorPickerTests/TouchColorTests-Info.plist"; 578 | PRODUCT_BUNDLE_IDENTIFIER = "edu.${PRODUCT_NAME:rfc1034identifier}"; 579 | PRODUCT_NAME = TouchColor; 580 | TEST_HOST = "$(BUNDLE_LOADER)"; 581 | WRAPPER_EXTENSION = xctest; 582 | }; 583 | name = Debug; 584 | }; 585 | DBE8C3C618A20F5400E2B304 /* Release */ = { 586 | isa = XCBuildConfiguration; 587 | buildSettings = { 588 | BUNDLE_LOADER = "$(BUILT_PRODUCTS_DIR)/ColorPicker.app/ColorPicker"; 589 | FRAMEWORK_SEARCH_PATHS = ( 590 | "$(SDKROOT)/Developer/Library/Frameworks", 591 | "$(inherited)", 592 | "$(DEVELOPER_FRAMEWORKS_DIR)", 593 | ); 594 | GCC_PRECOMPILE_PREFIX_HEADER = YES; 595 | GCC_PREFIX_HEADER = "ColorPicker/TouchColor-Prefix.pch"; 596 | INFOPLIST_FILE = "ColorPickerTests/TouchColorTests-Info.plist"; 597 | PRODUCT_BUNDLE_IDENTIFIER = "edu.${PRODUCT_NAME:rfc1034identifier}"; 598 | PRODUCT_NAME = TouchColor; 599 | TEST_HOST = "$(BUNDLE_LOADER)"; 600 | WRAPPER_EXTENSION = xctest; 601 | }; 602 | name = Release; 603 | }; 604 | /* End XCBuildConfiguration section */ 605 | 606 | /* Begin XCConfigurationList section */ 607 | DBE8C38A18A20F5400E2B304 /* Build configuration list for PBXProject "TouchColor" */ = { 608 | isa = XCConfigurationList; 609 | buildConfigurations = ( 610 | DBE8C3BF18A20F5400E2B304 /* Debug */, 611 | DBE8C3C018A20F5400E2B304 /* Release */, 612 | ); 613 | defaultConfigurationIsVisible = 0; 614 | defaultConfigurationName = Release; 615 | }; 616 | DBE8C3C118A20F5400E2B304 /* Build configuration list for PBXNativeTarget "TouchColor" */ = { 617 | isa = XCConfigurationList; 618 | buildConfigurations = ( 619 | DBE8C3C218A20F5400E2B304 /* Debug */, 620 | DBE8C3C318A20F5400E2B304 /* Release */, 621 | ); 622 | defaultConfigurationIsVisible = 0; 623 | defaultConfigurationName = Release; 624 | }; 625 | DBE8C3C418A20F5400E2B304 /* Build configuration list for PBXNativeTarget "TouchColorTests" */ = { 626 | isa = XCConfigurationList; 627 | buildConfigurations = ( 628 | DBE8C3C518A20F5400E2B304 /* Debug */, 629 | DBE8C3C618A20F5400E2B304 /* Release */, 630 | ); 631 | defaultConfigurationIsVisible = 0; 632 | defaultConfigurationName = Release; 633 | }; 634 | /* End XCConfigurationList section */ 635 | }; 636 | rootObject = DBE8C38718A20F5400E2B304 /* Project object */; 637 | } 638 | -------------------------------------------------------------------------------- /TouchColor.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /TouchColor.xcodeproj/project.xcworkspace/xcshareddata/ColorPicker.xccheckout: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDESourceControlProjectFavoriteDictionaryKey 6 | 7 | IDESourceControlProjectIdentifier 8 | 4054796B-27B8-406D-A059-E0D3EAD63E42 9 | IDESourceControlProjectName 10 | ColorPicker 11 | IDESourceControlProjectOriginsDictionary 12 | 13 | D390D46C-0BF7-43E0-9849-2F6BA44DD4A4 14 | https://github.com/100mango/ColorPicker.git 15 | 16 | IDESourceControlProjectPath 17 | ColorPicker.xcodeproj/project.xcworkspace 18 | IDESourceControlProjectRelativeInstallPathDictionary 19 | 20 | D390D46C-0BF7-43E0-9849-2F6BA44DD4A4 21 | ../.. 22 | 23 | IDESourceControlProjectURL 24 | https://github.com/100mango/ColorPicker.git 25 | IDESourceControlProjectVersion 26 | 110 27 | IDESourceControlProjectWCCIdentifier 28 | D390D46C-0BF7-43E0-9849-2F6BA44DD4A4 29 | IDESourceControlProjectWCConfigurations 30 | 31 | 32 | IDESourceControlRepositoryExtensionIdentifierKey 33 | public.vcs.git 34 | IDESourceControlWCCIdentifierKey 35 | D390D46C-0BF7-43E0-9849-2F6BA44DD4A4 36 | IDESourceControlWCCName 37 | ColorPicker 38 | 39 | 40 | 41 | 42 | -------------------------------------------------------------------------------- /TouchColor.xcodeproj/project.xcworkspace/xcuserdata/Mango.xcuserdatad/UserInterfaceState.xcuserstate: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/100mango/ColorPicker/df48f021553437c72acf442e860527dd1cd44a29/TouchColor.xcodeproj/project.xcworkspace/xcuserdata/Mango.xcuserdatad/UserInterfaceState.xcuserstate -------------------------------------------------------------------------------- /TouchColor.xcodeproj/project.xcworkspace/xcuserdata/Mango.xcuserdatad/WorkspaceSettings.xcsettings: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | HasAskedToTakeAutomaticSnapshotBeforeSignificantChanges 6 | 7 | SnapshotAutomaticallyBeforeSignificantChanges 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /TouchColor.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 9 | 10 | 11 | --------------------------------------------------------------------------------