[
  {
    "path": ".gitignore",
    "content": "# OS X\n.DS_Store\n\n# Xcode\nbuild/\n*.pbxuser\n!default.pbxuser\n*.mode1v3\n!default.mode1v3\n*.mode2v3\n!default.mode2v3\n*.perspectivev3\n!default.perspectivev3\nxcuserdata\n*.xccheckout\nprofile\n*.moved-aside\nDerivedData\n*.hmap\n*.ipa\n\n# CocoaPods\nPods\n"
  },
  {
    "path": ".travis.yml",
    "content": "language: objective-c\nxcode_project: RSColorPicker.xcodeproj\nxcode_scheme: RSColorPicker\nxcode_sdk: iphonesimulator\nnotifications:\n  email: false\n\n"
  },
  {
    "path": "CONTRIBUTING.md",
    "content": "\n# Contributing\n\nPull requests are welcome for bug fixes or feature additions. If you contribute code, make sure you stick to the following syntax guidelines:\n\n- Indentation should be done with 4 spaces, not `\\t`.\n- For Objective-C method implementations, the opening curly brace `{` should appear on the same line as the method name: `- (void)foobar {`.\n- For Objective-C methods, there should be a space after the `-` or `+`, as in the example above.\n- For C function implementations, the `{` should appear immediately on the next line after the function name & arguments.\n- For pointers, declare variables such as `NSArray *myVar`, with the `*` touching the variable name. For Objective-C arguments, put a space before the `*`: `- (NSArray *)myMethod`.\n- For C functions that return a pointer, put a space before *and* after the `*`: `void * getBuffer()`.\n"
  },
  {
    "path": "LICENSE.md",
    "content": "[RSColorPicker](https://github.com/RSully/RSColorPicker) - Copyright (c) 2011, Ryan (RSully)\nAll rights reserved.\n\nRedistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:\n\nRedistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.\nRedistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n"
  },
  {
    "path": "README.md",
    "content": "\n# Project:\n\n[![Build Status](https://travis-ci.org/RSully/RSColorPicker.png?branch=master)](https://travis-ci.org/RSully/RSColorPicker)\n\niOS color picker that is resolution independent.\n\nInspired by [ANColorPicker](https://github.com/unixpickle/ANColorPicker).\nAlso uses [ANImageBitmapRep](https://github.com/unixpickle/ANImageBitmapRep) for easy pixel-level manipulation.\n\nAnd of course, thanks to [Wikipedia](http://en.wikipedia.org/wiki/HSL_and_HSV).\n\n## Class Files:\n\n### `RSColorPickerView`\n\nSquare (circle) color-picker that handles touch events, allows for brightness control, and allows for opacity control. Uses delegation to report color selection as-changed\n\n## Usage:\n\nSee included example project (`TestColorViewController`).\n\n### Requirements:\n\n* Accelerate.framework\n* QuartzCore.framework\n* CoreGraphics.framework\n* UIKit.framework\n* Foundation.framework\n* ANImageBitmapRep (included)\n\n## License\n\nSee [LICENSE.md](LICENSE.md). You know the drill, use at your own risk, this code is given without support, etc. And for good karma link back to this github.com page, [github.com/rsully/rscolorpicker](https://github.com/RSully/RSColorPicker)\n\n***\n\n<img alt=\"Color Picker - Default\" src=\"./Example01.png\" width=\"320\">\n<img alt=\"Color Picker - Loupe\" src=\"./Example02.png\" width=\"320\">\n<img alt=\"Color Picker - Opacity\" src=\"./Example03.png\" width=\"320\">\n<img alt=\"Color Picker - Circle\" src=\"./Example04.png\" width=\"320\">\n<img alt=\"Color Picker - Resize\" src=\"./Example05.png\" width=\"320\">\n\n## Contributing\n\nPull requests are welcome for bug fixes or feature additions. If you contribute code, make sure you stick to the [contibution guidelines](CONTRIBUTING.md).\n"
  },
  {
    "path": "RSColorPicker/ColorPickerClasses/ANImageBitmapRep/ANImageBitmapRep.h",
    "content": "//\n//  ANImageBitmapRep.h\n//  ImageManip\n//\n//  Created by Alex Nichol on 7/12/11.\n//  Copyright 2011 __MyCompanyName__. All rights reserved.\n//\n\n#import \"OSCommonImage.h\"\n#import \"BitmapScaleManipulator.h\"\n#import \"BitmapCropManipulator.h\"\n#import \"BitmapRotationManipulator.h\"\n#import \"BitmapDrawManipulator.h\"\n#import \"UIImage+ANImageBitmapRep.h\"\n\ntypedef struct {\n    CGFloat red;\n    CGFloat green;\n    CGFloat blue;\n    CGFloat alpha;\n} BMPixel;\n\nBMPixel BMPixelMake (CGFloat red, CGFloat green, CGFloat blue, CGFloat alpha);\n#if TARGET_OS_IPHONE\nUIColor * UIColorFromBMPixel (BMPixel pixel);\n#elif TARGET_OS_MAC\nNSColor * NSColorFromBMPixel (BMPixel pixel);\n#endif\n\n@interface ANImageBitmapRep : BitmapContextRep <BitmapScaleManipulator, BitmapCropManipulator, BitmapRotationManipulator, BitmapDrawManipulator, NSCopying> {\n#if __has_feature(objc_arc) == 1\n    __strong NSArray * baseClasses;\n#else\n    NSArray * baseClasses;\n#endif\n}\n\n#if __has_feature(objc_arc) == 1\n+ (ANImageBitmapRep *)imageBitmapRepWithCGSize:(CGSize)avgSize __attribute__((ns_returns_autoreleased));\n+ (ANImageBitmapRep *)imageBitmapRepWithImage:(ANImageObj *)anImage __attribute__((ns_returns_autoreleased));\n#else\n+ (ANImageBitmapRep *)imageBitmapRepWithCGSize:(CGSize)avgSize;\n+ (ANImageBitmapRep *)imageBitmapRepWithImage:(ANImageObj *)anImage;\n#endif\n\n/**\n * Reverses the RGB values of all pixels in the bitmap.  This causes\n * an \"inverted\" effect.\n */\n- (void)invertColors;\n\n/**\n * Scales the image down, then back up again.  Use this to blur an image.\n * @param quality A percentage from 0 to 1, 0 being horrible quality, 1 being\n * perfect quality.\n */\n- (void)setQuality:(CGFloat)quality;\n\n/**\n * Darken or brighten the image.\n * @param brightness A percentage from 0 to 2.  In this case, 0 is the darkest\n * and 2 is the brightest.  If this is 1, no change will be made.\n */\n- (void)setBrightness:(CGFloat)brightness;\n\n/**\n * Returns a pixel at a given location.\n * @param point The point from which a pixel will be taken.  For all points\n * in a BitmapContextRep, the x and y values start at 0 and end at\n * width - 1 and height - 1 respectively.\n * @return The pixel with values taken from the specified point.\n */\n- (BMPixel)getPixelAtPoint:(BMPoint)point;\n\n/**\n * Sets a pixel at a specific location.\n * @param pixel An RGBA pixel represented by an array of four floats.\n * Each component is one float long, and goes from 0 to 1.  \n * In this case, 0 is black and 1 is white.\n * @param point The location of the pixel to change.  For all points\n * in a BitmapContextRep, the x and y values start at 0 and end at\n * width - 1 and height - 1 respectively.\n */\n- (void)setPixel:(BMPixel)pixel atPoint:(BMPoint)point;\n\n/**\n * Creates a new UIImage or NSImage from the bitmap context.\n */\n#if __has_feature(objc_arc) == 1\n- (ANImageObj *)image __attribute__((ns_returns_autoreleased));\n#else\n- (ANImageObj *)image;\n#endif\n\n@end\n"
  },
  {
    "path": "RSColorPicker/ColorPickerClasses/ANImageBitmapRep/ANImageBitmapRep.m",
    "content": "//\n//  ANImageBitmapRep.m\n//  ImageManip\n//\n//  Created by Alex Nichol on 7/12/11.\n//  Copyright 2011 __MyCompanyName__. All rights reserved.\n//\n\n#import \"ANImageBitmapRep.h\"\n\nBMPixel BMPixelMake (CGFloat red, CGFloat green, CGFloat blue, CGFloat alpha) {\n    BMPixel pixel;\n    pixel.red = red;\n    pixel.green = green;\n    pixel.blue = blue;\n    pixel.alpha = alpha;\n    return pixel;\n}\n\n#if TARGET_OS_IPHONE\nUIColor * UIColorFromBMPixel (BMPixel pixel) {\n    return [UIColor colorWithRed:pixel.red green:pixel.green blue:pixel.blue alpha:pixel.alpha];\n}\n#elif TARGET_OS_MAC\nNSColor * NSColorFromBMPixel (BMPixel pixel) {\n    return [NSColor colorWithCalibratedRed:pixel.red green:pixel.green blue:pixel.blue alpha:pixel.alpha];\n}\n#endif\n\n@interface ANImageBitmapRep (BaseClasses)\n\n- (void)generateBaseClasses;\n\n@end\n\n@implementation ANImageBitmapRep\n\n- (void)forwardInvocation:(NSInvocation *)anInvocation {\n    if (!baseClasses) [self generateBaseClasses];\n    for (int i = 0; i < [baseClasses count]; i++) {\n        BitmapContextManipulator * manip = [baseClasses objectAtIndex:i];\n        if ([manip respondsToSelector:[anInvocation selector]]) {\n            [anInvocation invokeWithTarget:manip];\n            return;\n        }\n    }\n    [self doesNotRecognizeSelector:[anInvocation selector]];\n}\n\n#if __has_feature(objc_arc) == 1\n+ (ANImageBitmapRep *)imageBitmapRepWithCGSize:(CGSize)avgSize {\n    return [[ANImageBitmapRep alloc] initWithSize:BMPointMake(round(avgSize.width), round(avgSize.height))];\n}\n\n+ (ANImageBitmapRep *)imageBitmapRepWithImage:(ANImageObj *)anImage {\n    return [[ANImageBitmapRep alloc] initWithImage:anImage];\n}\n#else\n+ (ANImageBitmapRep *)imageBitmapRepWithCGSize:(CGSize)avgSize {\n    return [[[ANImageBitmapRep alloc] initWithSize:BMPointMake(round(avgSize.width), round(avgSize.height))] autorelease];\n}\n\n+ (ANImageBitmapRep *)imageBitmapRepWithImage:(ANImageObj *)anImage {\n    return [[[ANImageBitmapRep alloc] initWithImage:anImage] autorelease];\n}\n#endif\n\n- (void)invertColors {\n    UInt8 pixel[4];\n    BMPoint size = [self bitmapSize];\n    for (long y = 0; y < size.y; y++) {\n        for (long x = 0; x < size.x; x++) {\n            [self getRawPixel:pixel atPoint:BMPointMake(x, y)];\n            pixel[0] = 255 - pixel[0];\n            pixel[1] = 255 - pixel[1];\n            pixel[2] = 255 - pixel[2];\n            [self setRawPixel:pixel atPoint:BMPointMake(x, y)];\n        }\n    }\n}\n\n- (void)setQuality:(CGFloat)quality {\n    NSAssert(quality >= 0 && quality <= 1, @\"Quality must be between 0 and 1.\");\n    if (quality == 1.0) return;\n    CGSize cSize = CGSizeMake((CGFloat)([self bitmapSize].x) * quality, (CGFloat)([self bitmapSize].y) * quality);\n    BMPoint oldSize = [self bitmapSize];\n    [self setSize:BMPointMake(round(cSize.width), round(cSize.height))];\n    [self setSize:oldSize];\n}\n\n- (void)setBrightness:(CGFloat)brightness {\n    NSAssert(brightness >= 0 && brightness <= 2, @\"Brightness must be between 0 and 2.\");\n    BMPoint size = [self bitmapSize];\n    for (long y = 0; y < size.y; y++) {\n        for (long x = 0; x < size.x; x++) {\n            BMPoint point = BMPointMake(x, y);\n            BMPixel pixel = [self getPixelAtPoint:point];\n            pixel.red *= brightness;\n            pixel.green *= brightness;\n            pixel.blue *= brightness;\n            if (pixel.red > 1) pixel.red = 1;\n            if (pixel.green > 1) pixel.green = 1;\n            if (pixel.blue > 1) pixel.blue = 1;\n            [self setPixel:pixel atPoint:point];\n        }\n    }\n}\n\n- (BMPixel)getPixelAtPoint:(BMPoint)point {\n    UInt8 rawPixel[4];\n    [self getRawPixel:rawPixel atPoint:point];\n    BMPixel pixel;\n    pixel.alpha = (CGFloat)(rawPixel[3]) / 255.0;\n    pixel.red = ((CGFloat)(rawPixel[0]) / 255.0) / pixel.alpha;\n    pixel.green = ((CGFloat)(rawPixel[1]) / 255.0) / pixel.alpha;\n    pixel.blue = ((CGFloat)(rawPixel[2]) / 255.0) / pixel.alpha;\n    return pixel;\n}\n\n- (void)setPixel:(BMPixel)pixel atPoint:(BMPoint)point {\n    NSAssert(pixel.red >= 0 && pixel.red <= 1, @\"Pixel color must range from 0 to 1.\");\n    NSAssert(pixel.green >= 0 && pixel.green <= 1, @\"Pixel color must range from 0 to 1.\");\n    NSAssert(pixel.blue >= 0 && pixel.blue <= 1, @\"Pixel color must range from 0 to 1.\");\n    NSAssert(pixel.alpha >= 0 && pixel.alpha <= 1, @\"Pixel color must range from 0 to 1.\");\n    UInt8 rawPixel[4];\n    rawPixel[0] = round(pixel.red * 255.0 * pixel.alpha);\n    rawPixel[1] = round(pixel.green * 255.0 * pixel.alpha);\n    rawPixel[2] = round(pixel.blue * 255.0 * pixel.alpha);\n    rawPixel[3] = round(pixel.alpha * 255.0);\n    [self setRawPixel:rawPixel atPoint:point];\n}\n\n- (ANImageObj *)image {\n    return ANImageFromCGImage([self CGImage]);\n}\n\n#if __has_feature(objc_arc) != 1\n- (void)dealloc {\n    [baseClasses release];\n    [super dealloc];\n}\n#endif\n\n#pragma mark Base Classes\n\n- (void)generateBaseClasses {\n    BitmapCropManipulator * croppable = [[BitmapCropManipulator alloc] initWithContext:self];\n    BitmapScaleManipulator * scalable = [[BitmapScaleManipulator alloc] initWithContext:self];\n    BitmapRotationManipulator * rotatable = [[BitmapRotationManipulator alloc] initWithContext:self];\n    BitmapDrawManipulator * drawable = [[BitmapDrawManipulator alloc] initWithContext:self];\n    baseClasses = [[NSArray alloc] initWithObjects:croppable, scalable, rotatable, drawable, nil];\n#if __has_feature(objc_arc) != 1\n    [rotatable release];\n    [scalable release];\n    [croppable release];\n    [drawable release];\n#endif\n}\n\n#pragma mark NSCopying\n\n- (id)copyWithZone:(NSZone *)zone {\n    BMPoint size = [self bitmapSize];\n    ANImageBitmapRep * rep = [[ANImageBitmapRep allocWithZone:zone] initWithSize:size];\n    CGContextRef newContext = [rep context];\n    CGContextDrawImage(newContext, CGRectMake(0, 0, size.x, size.y), [self CGImage]);\n    [rep setNeedsUpdate:YES];\n    return rep;\n}\n\n@end\n"
  },
  {
    "path": "RSColorPicker/ColorPickerClasses/ANImageBitmapRep/BitmapContextRep.h",
    "content": "//\n//  BitmapContextRep.h\n//  ImageManip\n//\n//  Created by Alex Nichol on 7/12/11.\n//  Copyright 2011 __MyCompanyName__. All rights reserved.\n//\n\n#import \"OSCommonImage.h\"\n#import \"CGImageContainer.h\"\n#import \"CGContextCreator.h\"\n\n/**\n * A structure that defines a point in bitmap space.\n * This is similar to the CGPoint structure, but it\n * does not use floating points, making it more accurate.\n */\ntypedef struct {\n    long x;\n    long y;\n} BMPoint;\n\nBMPoint BMPointMake (long x, long y);\nBMPoint BMPointFromSize (CGSize size);\nBMPoint BMPointFromPoint (CGPoint point);\n\n/**\n * BitmapContextRep is a concrete subclass of NSObject that provides a basic\n * class for mutating image's bitmaps.  This class is very barebones,\n * and generally will not be enough for most image manipulation.\n */\n@interface BitmapContextRep : NSObject {\n    CGContextRef context;\n    CGImageRef lastImage;\n    unsigned char * bitmapData;\n    BOOL needsUpdate;\n}\n\n/**\n * Creates a bitmap context with pixels and dimensions from an image.\n * @param image The image to wrap in a bitmap context.\n */\n- (id)initWithImage:(ANImageObj *)image;\n\n/**\n * Creates a bitmap context with the information from a CGImageRef.\n * @param image The image to use for initialization. The reference will\n * not be consumed, so you will still need to CGImageRelease() this as expected.\n */\n- (id)initWithCGImage:(CGImageRef)img;\n\n/**\n * Creates a blank bitmap context with specified dimensions.\n * @param sizePoint The size to use for the new bitmap.  The x value\n * of this is used for the width, and the y value is used for height.\n */\n- (id)initWithSize:(BMPoint)sizePoint;\n\n/**\n * Returns the bitmap context underlying the image.\n */\n- (CGContextRef)context;\n\n/**\n * Replaces the current context with a new one.\n * @param aContext The new bitmap context for the image which will be retained\n * and released automatically by the BitmapContextRep.\n */\n- (void)setContext:(CGContextRef)aContext;\n\n/**\n * Returns the current size of the bitmap.\n */\n- (BMPoint)bitmapSize;\n\n/**\n * Tells the BitmapContext that a new image should be generated when\n * one is requested because the internal context has been externally\n * modified.\n * @param needsUpdate This should almost always be YES.  If this is no,\n * a new CGImageRef will not be generated when one is requested.\n */\n- (void)setNeedsUpdate:(BOOL)flag;\n\n/**\n * Returns by reference a 4-byte RGBA pixel at a certain point.\n * @param rgba A pointer to a 4-byte or more pixel buffer. \n * @param point The point from which a pixel will be read.  For all\n * points in a BitmapContextRep, the x and y values start at 0 and end\n * at width - 1 and height - 1 respectively.\n */\n- (void)getRawPixel:(UInt8 *)rgba atPoint:(BMPoint)point;\n\n/**\n * Sets a 4-byte ARGB pixel at a specified point.\n * @param rgba The pixel buffer containing at least 4 bytes.\n * @param point The point at which the pixel will be set.  For all\n * points in a BitmapContextRep, the x and y values start at 0 and end\n * at width - 1 and height - 1 respectively.\n * @discussion Since alpha is premultiplied, it is important to remember to multiply\n * the alpha as a percentage by the RGB values.  This means that a white pixel\n * with 50% alpha would become rgba(128, 128, 128, 128).\n */\n- (void)setRawPixel:(const UInt8 *)rgba atPoint:(BMPoint)point;\n\n/**\n * Returns an autoreleased CGImageRef of the current BitmapContext.\n */\n- (CGImageRef)CGImage;\n\n/**\n * Returns a mutable RGBA data array. If you modify this, you should call\n * [context setNeedsUpdate:YES] before calling [context CGImage] or similar.\n */\n- (unsigned char *)bitmapData;\n\n@end\n\n@protocol BitmapContextRep\n\n@optional\n- (CGContextRef)context;\n- (void)setContext:(CGContextRef)aContext;\n- (BMPoint)bitmapSize;\n- (void)setNeedsUpdate:(BOOL)flag;\n- (void)getRawPixel:(UInt8 *)rgba atPoint:(BMPoint)point;\n- (void)setRawPixel:(const UInt8 *)rgba atPoint:(BMPoint)point;\n- (CGImageRef)CGImage;\n\n@end\n"
  },
  {
    "path": "RSColorPicker/ColorPickerClasses/ANImageBitmapRep/BitmapContextRep.m",
    "content": "//\n//  BitmapContextRep.m\n//  ImageManip\n//\n//  Created by Alex Nichol on 7/12/11.\n//  Copyright 2011 __MyCompanyName__. All rights reserved.\n//\n\n#import \"BitmapContextRep.h\"\n\nBMPoint BMPointMake (long x, long y) {\n    BMPoint p;\n    p.x = x;\n    p.y = y;\n    return p;\n}\n\nBMPoint BMPointFromSize (CGSize size) {\n    return BMPointMake(round(size.width), round(size.height));\n}\n\nBMPoint BMPointFromPoint (CGPoint point) {\n    return BMPointMake(round(point.x), round(point.y));\n}\n\n@implementation BitmapContextRep\n\n- (id)initWithImage:(ANImageObj *)image {\n    if ((self = [super init])) {\n        CGImageRef img = CGImageFromANImage(image);\n        context = [CGContextCreator newARGBBitmapContextWithImage:img];\n        bitmapData = CGBitmapContextGetData(context);\n        lastImage = CGImageRetain(img);\n    }\n    return self;\n}\n\n- (id)initWithCGImage:(CGImageRef)img {\n    if ((self = [super init])) {\n        context = [CGContextCreator newARGBBitmapContextWithImage:img];\n        bitmapData = CGBitmapContextGetData(context);\n        lastImage = CGImageRetain(img);\n    }\n    return self;\n}\n\n- (id)initWithSize:(BMPoint)sizePoint {\n    if ((self = [super init])) {\n        if (sizePoint.x == 0 || sizePoint.y == 0) {\n#if __has_feature(objc_arc)\n            return nil;\n#else\n            [super dealloc];\n            return nil;\n#endif\n        }\n        context = [CGContextCreator newARGBBitmapContextWithSize:CGSizeMake(sizePoint.x, sizePoint.y)];\n        bitmapData = CGBitmapContextGetData(context);\n        lastImage = CGBitmapContextCreateImage(context);\n    }\n    return self;\n}\n\n- (CGContextRef)context {\n    return context;\n}\n\n- (void)setContext:(CGContextRef)aContext {\n    if (context == aContext) return;\n    // free previous.\n    CGContextRelease(context);\n    free(bitmapData);\n    // create new.\n    context = CGContextRetain(aContext);\n    bitmapData = CGBitmapContextGetData(aContext);\n    [self setNeedsUpdate:YES];\n}\n\n- (BMPoint)bitmapSize {\n    BMPoint point;\n    point.x = (long)CGBitmapContextGetWidth(context);\n    point.y = (long)CGBitmapContextGetHeight(context);\n    return point;\n}\n\n- (void)setNeedsUpdate:(BOOL)flag {\n    needsUpdate = flag;\n}\n\n- (void)getRawPixel:(UInt8 *)rgba atPoint:(BMPoint)point {\n    size_t width = CGBitmapContextGetWidth(context);\n    NSAssert(point.x >= 0 && point.x < width, @\"Point must be within bitmap.\");\n    NSAssert(point.y >= 0 && point.y < CGBitmapContextGetHeight(context), @\"Point must be within bitmap.\");\n    unsigned char * argbData = &bitmapData[((point.y * width) + point.x) * 4];\n    rgba[0] = argbData[1]; // red\n    rgba[1] = argbData[2]; // green\n    rgba[2] = argbData[3]; // blue\n    rgba[3] = argbData[0]; // alpha\n    [self setNeedsUpdate:YES];\n}\n\n- (void)setRawPixel:(const UInt8 *)rgba atPoint:(BMPoint)point {\n    size_t width = CGBitmapContextGetWidth(context);\n    NSAssert(point.x >= 0 && point.x < width, @\"Point must be within bitmap.\");\n    NSAssert(point.y >= 0 && point.y < CGBitmapContextGetHeight(context), @\"Point must be within bitmap.\");\n    unsigned char * argbData = &bitmapData[((point.y * width) + point.x) * 4];\n    argbData[1] = rgba[0]; // red\n    argbData[2] = rgba[1]; // green\n    argbData[3] = rgba[2]; // blue\n    argbData[0] = rgba[3]; // alpha\n    [self setNeedsUpdate:YES];\n}\n\n- (CGImageRef)CGImage {\n    if (needsUpdate) {\n        CGImageRelease(lastImage);\n        lastImage = CGBitmapContextCreateImage(context);\n        needsUpdate = NO;\n    }\n#if __has_feature(objc_arc) == 1\n    return (__bridge CGImageRef)CGImageReturnAutoreleased(lastImage);\n#else\n    return (CGImageRef)[[CGImageContainer imageContainerWithImage:lastImage] image];\n#endif\n}\n\n- (unsigned char *)bitmapData {\n    return bitmapData;\n}\n\n- (void)dealloc {\n    CGContextRelease(context);\n    free(bitmapData);\n    if (lastImage != NULL) {\n        CGImageRelease(lastImage);\n    }\n#if __has_feature(objc_arc) != 1\n    [super dealloc];\n#endif\n}\n\n@end\n"
  },
  {
    "path": "RSColorPicker/ColorPickerClasses/ANImageBitmapRep/Compatibility/NSImage+ANImageBitmapRep.h",
    "content": "//\n//  NSImage+ANImageBitmapRep.h\n//  ImageBitmapRep\n//\n//  Created by Alex Nichol on 10/23/11.\n//  Copyright (c) 2011 __MyCompanyName__. All rights reserved.\n//\n\n#import \"TargetConditionals.h\"\n\n#if TARGET_OS_IPHONE != 1\n\n#import <Cocoa/Cocoa.h>\n\n@class ANImageBitmapRep;\n\n@interface NSImage (ANImageBitmapRep)\n\n#if __has_feature(objc_arc) == 1\n+ (NSImage *)imageFromImageBitmapRep:(ANImageBitmapRep *)ibr __attribute__((ns_returns_autoreleased));\n- (ANImageBitmapRep *)imageBitmapRep __attribute__((ns_returns_autoreleased));\n- (NSImage *)imageByScalingToSize:(CGSize)sz __attribute__((ns_returns_autoreleased));\n- (NSImage *)imageFittingFrame:(CGSize)sz __attribute__((ns_returns_autoreleased));\n- (NSImage *)imageFillingFrame:(CGSize)sz __attribute__((ns_returns_autoreleased));\n#else\n+ (NSImage *)imageFromImageBitmapRep:(ANImageBitmapRep *)ibr;\n- (ANImageBitmapRep *)imageBitmapRep;\n- (NSImage *)imageByScalingToSize:(CGSize)sz;\n- (NSImage *)imageFittingFrame:(CGSize)sz;\n- (NSImage *)imageFillingFrame:(CGSize)sz;\n#endif\n\n@end\n\n#endif\n"
  },
  {
    "path": "RSColorPicker/ColorPickerClasses/ANImageBitmapRep/Compatibility/NSImage+ANImageBitmapRep.m",
    "content": "//\n//  NSImage+ANImageBitmapRep.m\n//  ImageBitmapRep\n//\n//  Created by Alex Nichol on 10/23/11.\n//  Copyright (c) 2011 __MyCompanyName__. All rights reserved.\n//\n\n#import \"TargetConditionals.h\"\n\n#if TARGET_OS_IPHONE != 1\n\n#import \"NSImage+ANImageBitmapRep.h\"\n#import \"ANImageBitmapRep.h\"\n\n@implementation NSImage (ANImageBitmapRep)\n\n\n+ (NSImage *)imageFromImageBitmapRep:(ANImageBitmapRep *)ibr {\n    return [ibr image];\n}\n\n- (ANImageBitmapRep *)imageBitmapRep {\n#if __has_feature(objc_arc) == 1\n    return [[ANImageBitmapRep alloc] initWithImage:self];\n#else\n    return [[[ANImageBitmapRep alloc] initWithImage:self] autorelease];\n#endif\n}\n\n- (NSImage *)imageByScalingToSize:(CGSize)sz {\n    ANImageBitmapRep * imageBitmap = [[ANImageBitmapRep alloc] initWithImage:self];\n    [imageBitmap setSize:BMPointMake(round(sz.width), round(sz.height))];\n    NSImage * scaled = [imageBitmap image];\n#if __has_feature(objc_arc) != 1\n    [imageBitmap release];\n#endif\n    return scaled;\n}\n\n- (NSImage *)imageFittingFrame:(CGSize)sz {\n    ANImageBitmapRep * imageBitmap = [[ANImageBitmapRep alloc] initWithImage:self];\n    [imageBitmap setSizeFittingFrame:BMPointMake(round(sz.width), round(sz.height))];\n    NSImage * scaled = [imageBitmap image];\n#if __has_feature(objc_arc) != 1\n    [imageBitmap release];\n#endif\n    return scaled;\n}\n\n- (NSImage *)imageFillingFrame:(CGSize)sz {\n    ANImageBitmapRep * imageBitmap = [[ANImageBitmapRep alloc] initWithImage:self];\n    [imageBitmap setSizeFillingFrame:BMPointMake(round(sz.width), round(sz.height))];\n    NSImage * scaled = [imageBitmap image];\n#if __has_feature(objc_arc) != 1\n    [imageBitmap release];\n#endif\n    return scaled;\n}\n\n@end\n\n#endif\n"
  },
  {
    "path": "RSColorPicker/ColorPickerClasses/ANImageBitmapRep/Compatibility/OSCommonImage.h",
    "content": "//\n//  OSCommonImage.h\n//  ImageBitmapRep\n//\n//  Created by Alex Nichol on 10/23/11.\n//  Copyright (c) 2011 __MyCompanyName__. All rights reserved.\n//\n\n#ifndef ImageBitmapRep_OSCommonImage_h\n#define ImageBitmapRep_OSCommonImage_h\n\n#import \"TargetConditionals.h\"\n#import \"CGImageContainer.h\"\n\n#if TARGET_OS_IPHONE\n#import <UIKit/UIKit.h>\ntypedef UIImage ANImageObj;\n#elif TARGET_OS_MAC\n#import <Cocoa/Cocoa.h>\ntypedef NSImage ANImageObj;\n#endif\n\nCGImageRef CGImageFromANImage (ANImageObj * anImageObj);\nANImageObj * ANImageFromCGImage (CGImageRef imageRef);\n\n#endif\n"
  },
  {
    "path": "RSColorPicker/ColorPickerClasses/ANImageBitmapRep/Compatibility/OSCommonImage.m",
    "content": "//\n//  OSCommonImage.c\n//  ImageBitmapRep\n//\n//  Created by Alex Nichol on 10/23/11.\n//  Copyright (c) 2011 __MyCompanyName__. All rights reserved.\n//\n\n#include \"OSCommonImage.h\"\n\nCGImageRef CGImageFromANImage (ANImageObj * anImageObj) {\n#if TARGET_OS_IPHONE\n    return [anImageObj CGImage];\n#elif TARGET_OS_MAC\n    CGImageSourceRef source;\n#if __has_feature(objc_arc) == 1\n    source = CGImageSourceCreateWithData((__bridge CFDataRef)[anImageObj TIFFRepresentation], NULL);\n#else\n    source = CGImageSourceCreateWithData((CFDataRef)[anImageObj TIFFRepresentation], NULL);\n#endif\n    CGImageRef maskRef = CGImageSourceCreateImageAtIndex(source, 0, NULL);\n    CFRelease(source);\n#if __has_feature(objc_arc) == 1\n    CGImageRef autoreleased = (__bridge CGImageRef)CGImageReturnAutoreleased(maskRef);\n    CGImageRelease(maskRef);\n    return autoreleased;\n#else\n    CGImageContainer * container = [CGImageContainer imageContainerWithImage:maskRef];\n    CGImageRelease(maskRef);\n    return [container image];\n#endif\n#endif\n}\n\nANImageObj * ANImageFromCGImage (CGImageRef imageRef) {\n#if TARGET_OS_IPHONE\n    return [UIImage imageWithCGImage:imageRef];\n#elif TARGET_OS_MAC\n    NSImage * image = [[NSImage alloc] initWithCGImage:imageRef size:NSZeroSize];\n#if __has_feature(objc_arc) == 1\n    return image;\n#else\n    return [image autorelease];\n#endif\n#endif\n}\n"
  },
  {
    "path": "RSColorPicker/ColorPickerClasses/ANImageBitmapRep/Compatibility/UIImage+ANImageBitmapRep.h",
    "content": "//\n//  UIImage+ANImageBitmapRep.h\n//  ImageBitmapRep\n//\n//  Created by Alex Nichol on 8/11/11.\n//  Copyright 2011 __MyCompanyName__. All rights reserved.\n//\n\n#import \"TargetConditionals.h\"\n\n#if TARGET_OS_IPHONE\n\n@class ANImageBitmapRep;\n\n#import <UIKit/UIKit.h>\n\n@interface UIImage (ANImageBitmapRep)\n\n#if __has_feature(objc_arc) == 1\n+ (UIImage *)imageFromImageBitmapRep:(ANImageBitmapRep *)ibr __attribute__((ns_returns_autoreleased));\n- (ANImageBitmapRep *)imageBitmapRep __attribute__((ns_returns_autoreleased));\n- (UIImage *)imageByScalingToSize:(CGSize)sz __attribute__((ns_returns_autoreleased));\n- (UIImage *)imageFittingFrame:(CGSize)sz __attribute__((ns_returns_autoreleased));\n- (UIImage *)imageFillingFrame:(CGSize)sz __attribute__((ns_returns_autoreleased));\n#else\n+ (UIImage *)imageFromImageBitmapRep:(ANImageBitmapRep *)ibr;\n- (ANImageBitmapRep *)imageBitmapRep;\n- (UIImage *)imageByScalingToSize:(CGSize)sz;\n- (UIImage *)imageFittingFrame:(CGSize)sz;\n- (UIImage *)imageFillingFrame:(CGSize)sz;\n#endif\n\n@end\n\n#endif\n"
  },
  {
    "path": "RSColorPicker/ColorPickerClasses/ANImageBitmapRep/Compatibility/UIImage+ANImageBitmapRep.m",
    "content": "//\n//  UIImage+ANImageBitmapRep.m\n//  ImageBitmapRep\n//\n//  Created by Alex Nichol on 8/11/11.\n//  Copyright 2011 __MyCompanyName__. All rights reserved.\n//\n\n#import \"TargetConditionals.h\"\n\n#if TARGET_OS_IPHONE\n\n#import \"UIImage+ANImageBitmapRep.h\"\n#import \"ANImageBitmapRep.h\"\n\n@implementation UIImage (ANImageBitmapRep)\n\n\n+ (UIImage *)imageFromImageBitmapRep:(ANImageBitmapRep *)ibr {\n    return [ibr image];\n}\n\n- (ANImageBitmapRep *)imageBitmapRep {\n#if __has_feature(objc_arc) == 1\n    return [[ANImageBitmapRep alloc] initWithImage:self];\n#else\n    return [[[ANImageBitmapRep alloc] initWithImage:self] autorelease];\n#endif\n}\n\n- (UIImage *)imageByScalingToSize:(CGSize)sz {\n    ANImageBitmapRep * imageBitmap = [[ANImageBitmapRep alloc] initWithImage:self];\n    [imageBitmap setSize:BMPointMake(round(sz.width), round(sz.height))];\n    UIImage * scaled = [imageBitmap image];\n#if __has_feature(objc_arc) != 1\n    [imageBitmap release];\n#endif\n    return scaled;\n}\n\n- (UIImage *)imageFittingFrame:(CGSize)sz {\n    ANImageBitmapRep * imageBitmap = [[ANImageBitmapRep alloc] initWithImage:self];\n    [imageBitmap setSizeFittingFrame:BMPointMake(round(sz.width), round(sz.height))];\n    UIImage * scaled = [imageBitmap image];\n#if __has_feature(objc_arc) != 1\n    [imageBitmap release];\n#endif\n    return scaled;\n}\n\n- (UIImage *)imageFillingFrame:(CGSize)sz {\n    ANImageBitmapRep * imageBitmap = [[ANImageBitmapRep alloc] initWithImage:self];\n    [imageBitmap setSizeFillingFrame:BMPointMake(round(sz.width), round(sz.height))];\n    UIImage * scaled = [imageBitmap image];\n#if __has_feature(objc_arc) != 1\n    [imageBitmap release];\n#endif\n    return scaled;\n}\n\n@end\n\n#endif\n"
  },
  {
    "path": "RSColorPicker/ColorPickerClasses/ANImageBitmapRep/CoreGraphics/CGContextCreator.h",
    "content": "//\n//  CGContextCreator.h\n//  ImageBitmapRep\n//\n//  Created by Alex Nichol on 7/4/11.\n//  Copyright 2011 __MyCompanyName__. All rights reserved.\n//\n\n#import <Foundation/Foundation.h>\n#import \"TargetConditionals.h\"\n\n#if TARGET_OS_IPHONE\n#import <CoreGraphics/CoreGraphics.h>\n#elif TARGET_OS_MAC\n#import <Quartz/Quartz.h>\n#endif\n\n/**\n * This class has several static methods for creating bitmap contexts.\n * These methods are pretty much only called when creating a new\n * ANImageBitmapRep.\n */\n@interface CGContextCreator : NSObject {\n    \n}\n\n+ (CGContextRef)newARGBBitmapContextWithSize:(CGSize)size;\n+ (CGContextRef)newARGBBitmapContextWithImage:(CGImageRef)image;\n\n@end\n"
  },
  {
    "path": "RSColorPicker/ColorPickerClasses/ANImageBitmapRep/CoreGraphics/CGContextCreator.m",
    "content": "//\n//  CGContextCreator.m\n//  ImageBitmapRep\n//\n//  Created by Alex Nichol on 7/4/11.\n//  Copyright 2011 __MyCompanyName__. All rights reserved.\n//\n\n#import \"CGContextCreator.h\"\n\n\n@implementation CGContextCreator\n\n- (id)init {\n    if ((self = [super init])) {\n        // Initialization code here.\n    }\n    \n    return self;\n}\n\n+ (CGContextRef)newARGBBitmapContextWithSize:(CGSize)size {\n    CGContextRef context = NULL;\n    CGColorSpaceRef colorSpace;\n    void * bitmapData;\n    int bitmapByteCount;\n    int bitmapBytesPerRow;\n    \n    // Get image width, height. We'll use the entire image.\n    size_t pixelsWide = round(size.width);\n    size_t pixelsHigh = round(size.height);\n    \n    bitmapBytesPerRow = (int)(pixelsWide * 4);\n    bitmapByteCount = (int)(bitmapBytesPerRow * pixelsHigh);\n    \n    // Use the generic RGB color space.\n    colorSpace = CGColorSpaceCreateDeviceRGB();\n    if (colorSpace == NULL) {\n        fprintf(stderr, \"Error allocating color space\\n\");\n        return NULL;\n    }\n    \n    // allocate\n    bitmapData = malloc(bitmapByteCount);\n    if (bitmapData == NULL) {\n        NSLog(@\"Malloc failed which is too bad.  I was hoping to use this memory.\");\n        CGColorSpaceRelease(colorSpace);\n        // even though CGContextRef technically is not a pointer,\n        // it's typedef probably is and it is a scalar anyway.\n        return NULL;\n    }\n    \n    // Create the bitmap context. We are\n    // setting up the image as an ARGB (0-255 per component)\n    // 4-byte per/pixel.\n    context = CGBitmapContextCreate (bitmapData,\n                                     pixelsWide,\n                                     pixelsHigh,\n                                     8,\n                                     bitmapBytesPerRow,\n                                     colorSpace,\n                                     (CGBitmapInfo)kCGImageAlphaPremultipliedFirst);\n    if (context == NULL) {\n        free (bitmapData);\n        NSLog(@\"Failed to create bitmap!\");\n    }\n    \n    CGContextClearRect(context, CGRectMake(0, 0, size.width, size.height));\n    CGColorSpaceRelease(colorSpace);\n    \n    return context;    \n}\n\n+ (CGContextRef)newARGBBitmapContextWithImage:(CGImageRef)image {\n    CGContextRef context = NULL;\n    CGColorSpaceRef colorSpace;\n    void * bitmapData;\n    int bitmapByteCount;\n    int bitmapBytesPerRow;\n    \n    // Get image width, height. We'll use the entire image.\n    size_t pixelsWide = CGImageGetWidth(image);\n    size_t pixelsHigh = CGImageGetHeight(image);\n    \n    bitmapBytesPerRow = (int)(pixelsWide * 4);\n    bitmapByteCount = (int)(bitmapBytesPerRow * pixelsHigh);\n    \n    // Use the generic RGB color space.\n    colorSpace = CGColorSpaceCreateDeviceRGB();\n    if (colorSpace == NULL) {\n        fprintf(stderr, \"Error allocating color space\\n\");\n        return NULL;\n    }\n    \n    // allocate\n    bitmapData = malloc(bitmapByteCount);\n    if (bitmapData == NULL) {\n        NSLog(@\"Malloc failed which is too bad.  I was hoping to use this memory.\");\n        CGColorSpaceRelease(colorSpace);\n        // even though CGContextRef technically is not a pointer,\n        // it's typedef probably is and it is a scalar anyway.\n        return NULL;\n    }\n    \n    // Create the bitmap context. We are\n    // setting up the image as an ARGB (0-255 per component)\n    // 4-byte per/pixel.\n    context = CGBitmapContextCreate (bitmapData,\n                                     pixelsWide,\n                                     pixelsHigh,\n                                     8,      // bits per component\n                                     bitmapBytesPerRow,\n                                     colorSpace,\n                                     (CGBitmapInfo)kCGImageAlphaPremultipliedFirst);\n    if (context == NULL) {\n        free (bitmapData);\n        NSLog(@\"Failed to create bitmap!\");\n    }\n    \n    // draw the image on the context.\n    // CGContextTranslateCTM(context, 0, CGImageGetHeight(image));\n    // CGContextScaleCTM(context, 1.0, -1.0);\n    CGContextClearRect(context, CGRectMake(0, 0, CGImageGetWidth(image), CGImageGetHeight(image)));\n    CGContextDrawImage(context, CGRectMake(0, 0, CGImageGetWidth(image), CGImageGetHeight(image)), image);\n    \n    CGColorSpaceRelease(colorSpace);\n    \n    return context;    \n}\n\n#if __has_feature(objc_arc) != 1\n- (void)dealloc {\n    [super dealloc];\n}\n#endif\n\n@end\n"
  },
  {
    "path": "RSColorPicker/ColorPickerClasses/ANImageBitmapRep/CoreGraphics/CGImageContainer.h",
    "content": "//\n//  CGImageContainer.h\n//  ImageBitmapRep\n//\n//  Created by Alex Nichol on 5/3/11.\n//  Copyright 2011 __MyCompanyName__. All rights reserved.\n//\n\n#import <Foundation/Foundation.h>\n#import \"TargetConditionals.h\"\n\n#if TARGET_OS_IPHONE\n#import <CoreGraphics/CoreGraphics.h>\n#elif TARGET_OS_MAC\n#import <Quartz/Quartz.h>\n#endif\n\n#if __has_feature(objc_arc) != 1\n\n@interface CGImageContainer : NSObject {\n    CGImageRef image;\n}\n\n/**\n * The image that this container encloses.\n */\n@property (readonly) CGImageRef image;\n\n/**\n * Create a new image container with an image.\n * @param anImage Will be retained and enclosed in this class.\n * This object will be released when the CGImageContainer is\n * deallocated.  This can be nil.\n * @return The new image container, or nil if anImage is nil.\n */\n- (id)initWithImage:(CGImageRef)anImage;\n\n/**\n * Create a new image container with an image.\n * @param anImage Will be retained and enclosed in this class.\n * This object will be released when the CGImageContainer is\n * deallocated.  This can be nil.\n * @return The new image container, or nil if anImage is nil.\n * The image container returned will be autoreleased.\n */\n+ (CGImageContainer *)imageContainerWithImage:(CGImageRef)anImage;\n\n@end\n\n#else\n\nid CGImageReturnAutoreleased (CGImageRef original) __attribute__((ns_returns_autoreleased));\n\n#endif\n"
  },
  {
    "path": "RSColorPicker/ColorPickerClasses/ANImageBitmapRep/CoreGraphics/CGImageContainer.m",
    "content": "//\n//  CGImageContainer.m\n//  ImageBitmapRep\n//\n//  Created by Alex Nichol on 5/3/11.\n//  Copyright 2011 __MyCompanyName__. All rights reserved.\n//\n\n#import \"CGImageContainer.h\"\n\n#if __has_feature(objc_arc) != 1\n\n@implementation CGImageContainer\n\n@synthesize image;\n\n- (id)initWithImage:(CGImageRef)anImage {\n    if ((self = [super init])) {\n        image = CGImageRetain(anImage);\n    }\n    return self;\n}\n\n+ (CGImageContainer *)imageContainerWithImage:(CGImageRef)anImage {\n    CGImageContainer * container = [(CGImageContainer *)[CGImageContainer alloc] initWithImage:anImage];\n    return [container autorelease];\n}\n\n- (void)dealloc {\n    CGImageRelease(image);\n    [super dealloc];\n}\n\n@end\n\n#else\n\n__attribute__((ns_returns_autoreleased))\nid CGImageReturnAutoreleased (CGImageRef original) {\n    // CGImageRetain(original);\n    return (__bridge id)original;\n}\n\n#endif\n"
  },
  {
    "path": "RSColorPicker/ColorPickerClasses/ANImageBitmapRep/Manipulators/BitmapContextManipulator.h",
    "content": "//\n//  BitmapContextManip.h\n//  ImageBitmapRep\n//\n//  Created by Alex Nichol on 10/14/11.\n//  Copyright 2011 __MyCompanyName__. All rights reserved.\n//\n\n#import <Foundation/Foundation.h>\n#import \"BitmapContextRep.h\"\n\n@interface BitmapContextManipulator : NSObject <BitmapContextRep> {\n#if __has_feature(objc_arc) == 1\n    __unsafe_unretained BitmapContextRep * bitmapContext;\n#else\n    BitmapContextRep * bitmapContext;\n#endif\n}\n\n#if __has_feature(objc_arc) == 1\n@property (nonatomic, assign) BitmapContextRep * bitmapContext;\n#else\n@property (nonatomic, assign) BitmapContextRep * bitmapContext;\n#endif\n\n- (id)initWithContext:(BitmapContextRep *)aContext;\n\n@end\n"
  },
  {
    "path": "RSColorPicker/ColorPickerClasses/ANImageBitmapRep/Manipulators/BitmapContextManipulator.m",
    "content": "//\n//  BitmapContextManip.m\n//  ImageBitmapRep\n//\n//  Created by Alex Nichol on 10/14/11.\n//  Copyright 2011 __MyCompanyName__. All rights reserved.\n//\n\n#import \"BitmapContextManipulator.h\"\n\n@implementation BitmapContextManipulator\n\n@synthesize bitmapContext;\n\n- (id)initWithContext:(BitmapContextRep *)aContext {\n    if ((self = [super init])) {\n        self.bitmapContext = aContext;\n    }\n    return self;\n}\n\n- (void)forwardInvocation:(NSInvocation *)anInvocation {\n    [anInvocation invokeWithTarget:bitmapContext];\n}\n\n#if __has_feature(objc_arc) != 1\n\n- (void)dealloc {\n    self.bitmapContext = nil;\n    [super dealloc];\n}\n\n#endif\n\n@end\n"
  },
  {
    "path": "RSColorPicker/ColorPickerClasses/ANImageBitmapRep/Manipulators/BitmapCropManipulator.h",
    "content": "//\n//  CroppableBitmapRep.h\n//  ImageManip\n//\n//  Created by Alex Nichol on 7/12/11.\n//  Copyright 2011 __MyCompanyName__. All rights reserved.\n//\n\n#import <Foundation/Foundation.h>\n#import \"BitmapContextManipulator.h\"\n\n@protocol BitmapCropManipulator\n\n@optional\n- (void)cropFrame:(CGRect)frame;\n- (void)cropTopFrame:(CGRect)frame;\n- (void)cropTopEllipse:(CGRect)frame;\n- (CGImageRef)croppedImageWithFrame:(CGRect)frame;\n\n@end\n\n@interface BitmapCropManipulator : BitmapContextManipulator {\n    \n}\n\n/**\n * Cuts a part of the bitmap out for a new bitmap.\n * @param frame The rectangle from which a portion of the image will\n * be cut.\n * The coordinates for this start at (0,0).\n * @discussion The coordinates for this method begin in the bottom\n * left corner.  For a coordinate system starting from the top\n * left corner, use cropTopFrame: instead.\n */\n- (void)cropFrame:(CGRect)frame;\n\n/**\n * Cuts a part of the bitmap out for a new bitmap.\n * @param frame The rectangle from which a portion of the image will\n * be cut.\n * The coordinates for this start at (0,0).\n * @discussion The coordinates for this method begin in the top\n * left corner.  For a coordinate system starting from the bottom\n * left corner, use cropFrame: instead.\n */\n- (void)cropTopFrame:(CGRect)frame;\n\n/**\n * Cuts an ellipse of the bitmap out for a new bitmap.\n * @param frame The rectangle around the ellipse to be cut. The\n * coordinates for this start at (0,0).\n * @discussion The coordinates for this method begin in the top\n * left corner.  There is no alternative.\n */\n- (void)cropTopEllipse:(CGRect)frame;\n\n/**\n * Creates a new CGImageRef by cutting out a portion of this one.\n * This takes its behavoir from cropFrame.\n * @return An autoreleased CGImageRef that has been cropped from this\n * image.\n */\n- (CGImageRef)croppedImageWithFrame:(CGRect)frame;\n\n@end\n"
  },
  {
    "path": "RSColorPicker/ColorPickerClasses/ANImageBitmapRep/Manipulators/BitmapCropManipulator.m",
    "content": "//\n//  CroppableBitmapRep.m\n//  ImageManip\n//\n//  Created by Alex Nichol on 7/12/11.\n//  Copyright 2011 __MyCompanyName__. All rights reserved.\n//\n\n#import \"BitmapCropManipulator.h\"\n\n\n@implementation BitmapCropManipulator\n\n- (void)cropFrame:(CGRect)frame {\n    BMPoint size = [bitmapContext bitmapSize];\n    // It's kind of rude to prevent them from doing something kind of cool, so let's not.\n    // NSAssert(frame.origin.x >= 0 && frame.origin.x + frame.size.width <= size.x, @\"Cropping frame must be within the bitmap.\");\n    // NSAssert(frame.origin.y >= 0 && frame.origin.y + frame.size.height <= size.y, @\"Cropping frame must be within the bitmap.\");\n    \n    CGContextRef newBitmap = [CGContextCreator newARGBBitmapContextWithSize:frame.size];\n    CGPoint offset = CGPointMake(-frame.origin.x, -frame.origin.y);\n    CGContextDrawImage(newBitmap, CGRectMake(offset.x, offset.y, size.x, size.y), [bitmapContext CGImage]);\n    [bitmapContext setContext:newBitmap];\n    CGContextRelease(newBitmap);\n}\n\n- (void)cropTopFrame:(CGRect)frame {\n    BMPoint size = [bitmapContext bitmapSize];\n    // It's kind of rude to prevent them from doing something kind of cool, so let's not.\n    // NSAssert(frame.origin.x >= 0 && frame.origin.x + frame.size.width <= size.x, @\"Cropping frame must be within the bitmap.\");\n    // NSAssert(frame.origin.y >= 0 && frame.origin.y + frame.size.height <= size.y, @\"Cropping frame must be within the bitmap.\");\n    \n    CGContextRef newBitmap = [CGContextCreator newARGBBitmapContextWithSize:frame.size];\n    CGPoint offset = CGPointMake(-frame.origin.x, -(size.y - (frame.origin.y + frame.size.height)));\n    CGContextDrawImage(newBitmap, CGRectMake(offset.x, offset.y, size.x, size.y), [bitmapContext CGImage]);\n    [bitmapContext setContext:newBitmap];\n    CGContextRelease(newBitmap);\n}\n\n- (void)cropTopEllipse:(CGRect)frame {\n    frame.origin.x = round(frame.origin.x);\n    frame.origin.y = round(frame.origin.y);\n    frame.size.width = round(frame.size.width);\n    frame.size.height = round(frame.size.height);\n    \n    BMPoint size = [bitmapContext bitmapSize];\n    // It's kind of rude to prevent them from doing something kind of cool, so let's not.\n    // NSAssert(frame.origin.x >= 0 && frame.origin.x + frame.size.width <= size.x, @\"Cropping frame must be within the bitmap.\");\n    // NSAssert(frame.origin.y >= 0 && frame.origin.y + frame.size.height <= size.y, @\"Cropping frame must be within the bitmap.\");\n    \n    CGContextRef newBitmap = [CGContextCreator newARGBBitmapContextWithSize:frame.size];\n    CGPoint offset = CGPointMake(-frame.origin.x, -(size.y - (frame.origin.y + frame.size.height)));\n    \n    CGContextSaveGState(newBitmap);\n    CGContextBeginPath(newBitmap);\n    CGContextAddEllipseInRect(newBitmap, CGRectMake(0, 0, frame.size.width, frame.size.height));\n    CGContextClip(newBitmap);\n    CGContextDrawImage(newBitmap, CGRectMake(offset.x, offset.y, size.x, size.y), [bitmapContext CGImage]);\n    CGContextRestoreGState(newBitmap);\n    \n    [bitmapContext setContext:newBitmap];\n    CGContextRelease(newBitmap);\n}\n\n- (CGImageRef)croppedImageWithFrame:(CGRect)frame {\n    BMPoint size = [bitmapContext bitmapSize];\n    // It's kind of rude to prevent them from doing something kind of cool, so let's not.\n    // NSAssert(frame.origin.x >= 0 && frame.origin.x + frame.size.width <= size.x, @\"Cropping frame must be within the bitmap.\");\n    // NSAssert(frame.origin.y >= 0 && frame.origin.y + frame.size.height <= size.y, @\"Cropping frame must be within the bitmap.\");\n    \n    CGContextRef newBitmap = [CGContextCreator newARGBBitmapContextWithSize:frame.size];\n    CGPoint offset = CGPointMake(-frame.origin.x, -frame.origin.y);\n    CGContextDrawImage(newBitmap, CGRectMake(offset.x, offset.y, size.x, size.y), [bitmapContext CGImage]);\n    CGImageRef image = CGBitmapContextCreateImage(newBitmap);\n    CGContextRelease(newBitmap);\n#if __has_feature(objc_arc) == 1\n    CGImageRef retainedAutorelease = (__bridge CGImageRef)CGImageReturnAutoreleased(image);\n    CGImageRelease(image);\n    return retainedAutorelease;\n#else\n    CGImageContainer * container = [CGImageContainer imageContainerWithImage:image];\n    CGImageRelease(image);\n    return [container image];\n#endif\n}\n\n@end\n"
  },
  {
    "path": "RSColorPicker/ColorPickerClasses/ANImageBitmapRep/Manipulators/BitmapDrawManipulator.h",
    "content": "//\n//  BitmapDrawManipulator.h\n//  FaceBlur\n//\n//  Created by Alex Nichol on 7/1/12.\n//  Copyright (c) 2012 __MyCompanyName__. All rights reserved.\n//\n\n#import <Foundation/Foundation.h>\n#import \"BitmapContextManipulator.h\"\n\n@protocol BitmapDrawManipulator\n\n@optional\n- (void)drawImage:(CGImageRef)image inRect:(CGRect)rect;\n- (void)drawEllipseInFrame:(CGRect)frame color:(CGColorRef)color;\n\n@end\n\n@interface BitmapDrawManipulator : BitmapContextManipulator\n\n/**\n * Overlays an image on the existing bitmap.\n * @param image The image to be overlayed.\n * @param rect The frame in which the image will be drawn.\n * The coordinates for this begin at the top-left hand\n * corner of the view.\n */\n- (void)drawImage:(CGImageRef)image inRect:(CGRect)rect;\n\n/**\n * Draws a colored ellipse in a given rectangle.\n * @param frame The rectangle in which to draw the ellipse\n * @param color The fill color for the ellipse.  The coordinates\n * for this begin at the top-left hand corner of the view.\n */\n- (void)drawEllipseInFrame:(CGRect)frame color:(CGColorRef)color;\n\n@end\n"
  },
  {
    "path": "RSColorPicker/ColorPickerClasses/ANImageBitmapRep/Manipulators/BitmapDrawManipulator.m",
    "content": "//\n//  BitmapDrawManipulator.m\n//  FaceBlur\n//\n//  Created by Alex Nichol on 7/1/12.\n//  Copyright (c) 2012 __MyCompanyName__. All rights reserved.\n//\n\n#import \"BitmapDrawManipulator.h\"\n\n@implementation BitmapDrawManipulator\n\n- (void)drawImage:(CGImageRef)image inRect:(CGRect)rect {\n    BMPoint size = [bitmapContext bitmapSize];\n    // It's kind of rude to prevent them from doing something kind of cool, so let's not.\n    // NSAssert(frame.origin.x >= 0 && frame.origin.x + frame.size.width <= size.x, @\"Cropping frame must be within the bitmap.\");\n    // NSAssert(frame.origin.y >= 0 && frame.origin.y + frame.size.height <= size.y, @\"Cropping frame must be within the bitmap.\");\n    \n    CGPoint offset = CGPointMake(rect.origin.x, (size.y - (rect.origin.y + rect.size.height)));\n    \n    CGContextRef context = [[self bitmapContext] context];\n    CGContextSaveGState(context);\n    CGContextDrawImage(context, CGRectMake(offset.x, offset.y, rect.size.width, rect.size.height), image);\n    CGContextRestoreGState(context);\n    [self.bitmapContext setNeedsUpdate:YES];\n}\n\n- (void)drawEllipseInFrame:(CGRect)frame color:(CGColorRef)color {\n    CGContextRef context = [[self bitmapContext] context];\n    CGContextSaveGState(context);\n    CGContextScaleCTM(context, 1, -1);\n    CGContextTranslateCTM(context, 0, -[bitmapContext bitmapSize].y);\n    CGContextSetFillColorWithColor(context, color);\n    CGContextFillEllipseInRect(context, frame);\n    CGContextRestoreGState(context);\n    [self.bitmapContext setNeedsUpdate:YES];\n}\n\n@end\n"
  },
  {
    "path": "RSColorPicker/ColorPickerClasses/ANImageBitmapRep/Manipulators/BitmapRotationManipulator.h",
    "content": "//\n//  RotatableBitmapRep.h\n//  ImageManip\n//\n//  Created by Alex Nichol on 7/12/11.\n//  Copyright 2011 __MyCompanyName__. All rights reserved.\n//\n\n#import <Foundation/Foundation.h>\n#import \"BitmapContextManipulator.h\"\n\n@protocol BitmapRotationManipulator\n\n@optional\n- (void)rotate:(CGFloat)degrees;\n- (CGImageRef)imageByRotating:(CGFloat)degrees;\n\n@end\n\n@interface BitmapRotationManipulator : BitmapContextManipulator {\n    \n}\n\n/**\n * Rotate the image bitmap around its center by a certain number of degrees.\n * @param degrees The degrees from 0 to 360.  This is not measured in radians.\n * @discussion This will resize the image if needed.\n */\n- (void)rotate:(CGFloat)degrees;\n\n/**\n * Create a new image by rotating this image bitmap around its center by a specified\n * number of degrees.\n * @param degrees The degrees (not in radians) by which the image should be rotated.\n * @discussion This will resize the image if needed.\n */\n- (CGImageRef)imageByRotating:(CGFloat)degrees;\n\n@end\n"
  },
  {
    "path": "RSColorPicker/ColorPickerClasses/ANImageBitmapRep/Manipulators/BitmapRotationManipulator.m",
    "content": "//\n//  RotatableBitmapRep.m\n//  ImageManip\n//\n//  Created by Alex Nichol on 7/12/11.\n//  Copyright 2011 __MyCompanyName__. All rights reserved.\n//\n\n#import \"BitmapRotationManipulator.h\"\n\n#define DEGTORAD(x) (x * (M_PI / 180.0f))\n\nstatic CGPoint locationForAngle (CGFloat angle, CGFloat hypotenuse) {\n    CGPoint p;\n    p.x = (CGFloat)cos((double)DEGTORAD(angle)) * hypotenuse;\n    p.y = (CGFloat)sin((double)DEGTORAD(angle)) * hypotenuse;\n    return p;\n}\n\n@implementation BitmapRotationManipulator\n\n- (void)rotate:(CGFloat)degrees {\n    if (degrees == 0) return;\n    \n    CGSize size = CGSizeMake([bitmapContext bitmapSize].x, [bitmapContext bitmapSize].y);\n    CGSize newSize = CGSizeZero;\n    \n    /* Since the corners go off to the sides, we have to use the existing hypotenuse to calculate the new size\n       for the image.  This is done using some basic trigonometry. \n     */\n    CGFloat hypotenuse;\n    hypotenuse = (CGFloat)sqrt(pow((double)size.width / 2.0, 2.0) + pow((double)size.height / 2.0, 2.0));\n    \n    CGPoint minP = CGPointMake(CGFLOAT_MAX, CGFLOAT_MAX);\n    CGPoint maxP = CGPointMake(CGFLOAT_MIN, CGFLOAT_MIN);\n    \n    /* Find the angle for the corners. */\n    float firstAngle = (float)atan2((double)size.height / 2.0, (double)size.width / 2.0);\n    float secondAngle = (float)atan2((double)size.height / 2.0, (double)size.width / -2.0);\n    float thirdAngle = (float)atan2((double)size.height / -2.0, (double)size.width / -2.0);\n    float fourthAngle = (float)atan2((double)size.height / -2.0, (double)size.width / 2.0);\n    float angles[4] = {firstAngle, secondAngle, thirdAngle, fourthAngle};\n    \n    /* Rotate the corners by the new degrees, finding out how outgoing\n       the corners will be.  This will allow us to easily calculate\n       the new size of the image.\n     */\n    for (int i = 0; i < 4; i++) {\n        // conver the angle to radians.\n        float deg = angles[i] * (float)(180.0f / M_PI);\n        CGPoint p1 = locationForAngle(deg + degrees, hypotenuse);\n        if (p1.x < minP.x) minP.x = p1.x;\n        if (p1.x > maxP.x) maxP.x = p1.x;\n        if (p1.y < minP.y) minP.y = p1.y;\n        if (p1.y > maxP.y) maxP.y = p1.y;\n    }\n    \n    newSize.width = maxP.x - minP.x;\n    newSize.height = maxP.y - minP.y;\n    \n    /* Figure out where the thing is going to go when rotated by the bottom left\n       corner.  Use that information to translate it so that it rotates from the center.\n     */\n    hypotenuse = (CGFloat)sqrt((pow(newSize.width / 2.0, 2) + pow(newSize.height / 2.0, 2)));\n    \n    CGPoint newCenter;\n    float addAngle = (float)atan2((double)newSize.height / 2, (double)newSize.width / 2) * (float)(180.0f / M_PI);\n    newCenter.x = cos((float)DEGTORAD((degrees + addAngle))) * hypotenuse;\n    newCenter.y = sin((float)DEGTORAD((degrees + addAngle))) * hypotenuse;\n    \n    CGPoint offsetCenter;\n    offsetCenter.x = (float)((float)newSize.width / 2.0f) - (float)newCenter.x;\n    offsetCenter.y = (float)((float)newSize.height / 2.0f) - (float)newCenter.y;\n    \n    CGContextRef newContext = [CGContextCreator newARGBBitmapContextWithSize:newSize];\n    CGContextSaveGState(newContext);\n    CGContextTranslateCTM(newContext, (float)round((float)offsetCenter.x), (float)round((float)offsetCenter.y));\n    \n    CGContextRotateCTM(newContext, (CGFloat)DEGTORAD(degrees));\n    CGRect drawRect;\n    drawRect.size = size;\n    drawRect.origin.x = (CGFloat)round((newSize.width / 2) - (size.width / 2));\n    drawRect.origin.y = (CGFloat)round((newSize.height / 2) - (size.height / 2));\n    \n    CGContextDrawImage(newContext, drawRect, [bitmapContext CGImage]);\n    CGContextRestoreGState(newContext);\n    [bitmapContext setContext:newContext];\n    CGContextRelease(newContext);\n}\n\n- (CGImageRef)imageByRotating:(CGFloat)degrees {\n    if (degrees == 0) return [bitmapContext CGImage];\n    \n    CGSize size = CGSizeMake([bitmapContext bitmapSize].x, [bitmapContext bitmapSize].y);\n    CGSize newSize = CGSizeZero;\n    \n    /* Since the corners go off to the sides, we have to use the existing hypotenuse to calculate the new size\n       for the image.  This is done using some basic trigonometry. \n     */\n    CGFloat hypotenuse;\n    hypotenuse = (CGFloat)sqrt(pow((double)size.width / 2.0, 2.0) + pow((double)size.height / 2.0, 2.0));\n    \n    CGPoint minP = CGPointMake(CGFLOAT_MAX, CGFLOAT_MAX);\n    CGPoint maxP = CGPointMake(CGFLOAT_MIN, CGFLOAT_MIN);\n    \n    /* Find the angle for the corners. */\n    float firstAngle = (float)atan2((double)size.height / 2.0, (double)size.width / 2.0);\n    float secondAngle = (float)atan2((double)size.height / 2.0, (double)size.width / -2.0);\n    float thirdAngle = (float)atan2((double)size.height / -2.0, (double)size.width / -2.0);\n    float fourthAngle = (float)atan2((double)size.height / -2.0, (double)size.width / 2.0);\n    float angles[4] = {firstAngle, secondAngle, thirdAngle, fourthAngle};\n    \n    /* Rotate the corners by the new degrees, finding out how outgoing\n       the corners will be.  This will allow us to easily calculate\n       the new size of the image.\n     */\n    for (int i = 0; i < 4; i++) {\n        // conver the angle to radians.\n        float deg = angles[i] * (float)(180.0f / M_PI);\n        CGPoint p1 = locationForAngle(deg + degrees, hypotenuse);\n        if (p1.x < minP.x) minP.x = p1.x;\n        if (p1.x > maxP.x) maxP.x = p1.x;\n        if (p1.y < minP.y) minP.y = p1.y;\n        if (p1.y > maxP.y) maxP.y = p1.y;\n    }\n    \n    newSize.width = ceil(maxP.x - minP.x);\n    newSize.height = ceil(maxP.y - minP.y);\n    \n    /* Figure out where the thing is going to go when rotated by the bottom left\n       corner.  Use that information to translate it so that it rotates from the center.\n     */\n    hypotenuse = (CGFloat)sqrt((pow(newSize.width / 2.0, 2) + pow(newSize.height / 2.0, 2)));\n    \n    CGPoint newCenter;\n    float addAngle = (float)atan2((double)newSize.height / 2, (double)newSize.width / 2) * (float)(180.0f / M_PI);\n    newCenter.x = cos((float)DEGTORAD((degrees + addAngle))) * hypotenuse;\n    newCenter.y = sin((float)DEGTORAD((degrees + addAngle))) * hypotenuse;\n    \n    CGPoint offsetCenter;\n    offsetCenter.x = (float)((float)newSize.width / 2.0f) - (float)newCenter.x;\n    offsetCenter.y = (float)((float)newSize.height / 2.0f) - (float)newCenter.y;\n    \n    CGContextRef newContext = [CGContextCreator newARGBBitmapContextWithSize:newSize];\n    CGContextSaveGState(newContext);\n    CGContextTranslateCTM(newContext, (float)round((float)offsetCenter.x), (float)round((float)offsetCenter.y));\n    \n    CGContextRotateCTM(newContext, (CGFloat)DEGTORAD(degrees));\n    CGRect drawRect;\n    drawRect.size = size;\n    drawRect.origin.x = (CGFloat)round((newSize.width / 2) - (size.width / 2));\n    drawRect.origin.y = (CGFloat)round((newSize.height / 2) - (size.height / 2));\n    \n    CGContextDrawImage(newContext, drawRect, [bitmapContext CGImage]);\n    CGContextRestoreGState(newContext);\n    CGImageRef image = CGBitmapContextCreateImage(newContext);\n    void * buff = CGBitmapContextGetData(newContext);\n    CGContextRelease(newContext);\n    free(buff);\n#if __has_feature(objc_arc) == 1\n    id retainedImage = CGImageReturnAutoreleased(image);\n    CGImageRelease(image);\n    return (__bridge CGImageRef)retainedImage;\n#else\n    CGImageContainer * container = [CGImageContainer imageContainerWithImage:image];\n    CGImageRelease(image);\n    return [container image];\n#endif\n}\n\n@end\n"
  },
  {
    "path": "RSColorPicker/ColorPickerClasses/ANImageBitmapRep/Manipulators/BitmapScaleManipulator.h",
    "content": "//\n//  ScalableBitmapRep.h\n//  ImageManip\n//\n//  Created by Alex Nichol on 7/12/11.\n//  Copyright 2011 __MyCompanyName__. All rights reserved.\n//\n\n#import <Foundation/Foundation.h>\n#import \"BitmapContextManipulator.h\"\n\n@protocol BitmapScaleManipulator <NSObject>\n\n@optional\n- (void)setSize:(BMPoint)aSize;\n- (void)setSizeFittingFrame:(BMPoint)aSize;\n- (void)setSizeFillingFrame:(BMPoint)aSize;\n\n@end\n\n@interface BitmapScaleManipulator : BitmapContextManipulator {\n    \n}\n\n/**\n * Stretches the bitmap context to a specified size.\n * @param aSize The new size to make the bitmap.\n * If this is the same as the current size, the bitmap\n * will not be changed.\n */\n- (void)setSize:(BMPoint)aSize;\n\n/**\n * Scales the image to fit a particular frame without stretching (bringing out of scale).\n * @param aSize The size to which the image scaled.\n * @discussion The actual image itself will most likely be smaller than the specified\n * size, leaving transparent edges to make the image fit the exact size.\n */\n- (void)setSizeFittingFrame:(BMPoint)aSize;\n\n/**\n * Scales the image to fill a particular frame without stretching.\n * This will most likely cause the left and right or top and bottom\n * edges of the image to be cut off.\n * @param aSize The size that the image will be forced to fill.\n */\n- (void)setSizeFillingFrame:(BMPoint)aSize;\n\n@end\n"
  },
  {
    "path": "RSColorPicker/ColorPickerClasses/ANImageBitmapRep/Manipulators/BitmapScaleManipulator.m",
    "content": "//\n//  ScalableBitmapRep.m\n//  ImageManip\n//\n//  Created by Alex Nichol on 7/12/11.\n//  Copyright 2011 __MyCompanyName__. All rights reserved.\n//\n\n#import \"BitmapScaleManipulator.h\"\n\n\n@implementation BitmapScaleManipulator\n\n- (void)setSize:(BMPoint)aSize {\n    CGContextRef newContext = [CGContextCreator newARGBBitmapContextWithSize:CGSizeMake(aSize.x, aSize.y)];\n    CGImageRef image = [bitmapContext CGImage];\n    CGContextDrawImage(newContext, CGRectMake(0, 0, aSize.x, aSize.y), image);\n    [bitmapContext setContext:newContext];\n    CGContextRelease(newContext);\n}\n\n- (void)setSizeFittingFrame:(BMPoint)aSize {\n    CGSize oldSize = CGSizeMake([bitmapContext bitmapSize].x, [bitmapContext bitmapSize].y);\n    CGSize newSize = CGSizeMake(aSize.x, aSize.y);\n    \n    float wratio = newSize.width / oldSize.width;\n    float hratio = newSize.height / oldSize.height;\n    float scaleRatio;\n    if (wratio < hratio) {\n        scaleRatio = wratio;\n    } else {\n        scaleRatio = hratio;\n    }\n    scaleRatio = scaleRatio;\n    \n    CGSize newContentSize = CGSizeMake(oldSize.width * scaleRatio, oldSize.height * scaleRatio);\n    CGImageRef image = [bitmapContext CGImage];\n    CGContextRef newContext = [CGContextCreator newARGBBitmapContextWithSize:CGSizeMake(aSize.x, aSize.y)];\n    CGContextDrawImage(newContext, CGRectMake(newSize.width / 2 - (newContentSize.width / 2),\n                                              newSize.height / 2 - (newContentSize.height / 2),\n                                              newContentSize.width, newContentSize.height), image);\n    [bitmapContext setContext:newContext];\n    CGContextRelease(newContext);\n}\n\n- (void)setSizeFillingFrame:(BMPoint)aSize {\n    CGSize oldSize = CGSizeMake([bitmapContext bitmapSize].x, [bitmapContext bitmapSize].y);\n    CGSize newSize = CGSizeMake(aSize.x, aSize.y);\n    \n    float wratio = newSize.width / oldSize.width;\n    float hratio = newSize.height / oldSize.height;\n    float scaleRatio;\n    if (wratio > hratio) { // only difference from -setSizeFittingFrame:\n        scaleRatio = wratio;\n    } else {\n        scaleRatio = hratio;\n    }\n    scaleRatio = scaleRatio;\n    \n    CGSize newContentSize = CGSizeMake(oldSize.width * scaleRatio, oldSize.height * scaleRatio);\n    CGImageRef image = [bitmapContext CGImage];\n    CGContextRef newContext = [CGContextCreator newARGBBitmapContextWithSize:CGSizeMake(aSize.x, aSize.y)];\n    CGContextDrawImage(newContext, CGRectMake(newSize.width / 2 - (newContentSize.width / 2),\n                                              newSize.height / 2 - (newContentSize.height / 2),\n                                              newContentSize.width, newContentSize.height), image);\n    [bitmapContext setContext:newContext];\n    CGContextRelease(newContext);\n}\n\n@end\n"
  },
  {
    "path": "RSColorPicker/ColorPickerClasses/BGRSLoupeLayer.h",
    "content": "/**  \n * BGRSLoupeLayer.h\n * Copyright (c) 2011, Benjamin Guest.\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or without \n * modification, are permitted provided that the following conditions are met:\n * \n * -Redistributions of source code must retain the above copyright\n *  notice, this list of conditions and the following disclaimer.\n * -Redistributions in binary form must reproduce the above copyright\n *  notice, this list of conditions and the following disclaimer in the \n *  documentation and/or other materials provided with the distribution.\n * -Neither the name of Benjamin Guest nor the names of its \n *  contributors may be used to endorse or promote products derived from \n *  this software without specific prior written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\"\n * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE \n * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE \n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE \n * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR \n * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF \n * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS \n * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN \n * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) \n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE \n * POSSIBILITY OF SUCH DAMAGE. \n */\n\n#import <UIKit/UIKit.h>\n#import <QuartzCore/QuartzCore.h>\n\n@class RSColorPickerView;\n\n@interface BGRSLoupeLayer : CALayer {\n    BOOL isReadyToDismiss;\n    BOOL isRunningInitialAnimation;\n}\n\n@property (nonatomic) CGPoint loupeCenter;\n@property (nonatomic, weak) RSColorPickerView *colorPicker;\n\n#pragma mark - Drawing\n- (void)drawGridInContext:(CGContextRef)ctx;\n\n#pragma mark - Animation\n- (void)appearInColorPicker:(RSColorPickerView *)aColorPicker;\n- (void)disappear;\n- (void)disappearAnimated:(BOOL)anim;\n\n@end\n"
  },
  {
    "path": "RSColorPicker/ColorPickerClasses/BGRSLoupeLayer.m",
    "content": "/**\n * BGRSLoupeLayer.m\n * Copyright (c) 2011, Benjamin Guest.\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or without\n * modification, are permitted provided that the following conditions are met:\n *\n * -Redistributions of source code must retain the above copyright\n *  notice, this list of conditions and the following disclaimer.\n * -Redistributions in binary form must reproduce the above copyright\n *  notice, this list of conditions and the following disclaimer in the\n *  documentation and/or other materials provided with the distribution.\n * -Neither the name of Benjamin Guest nor the names of its\n *  contributors may be used to endorse or promote products derived from\n *  this software without specific prior written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\"\n * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\n * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE\n * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR\n * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF\n * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS\n * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN\n * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE\n * POSSIBILITY OF SUCH DAMAGE.\n */\n\n#import \"BGRSLoupeLayer.h\"\n#import \"RSColorPickerView.h\"\n\n@interface BGRSLoupeLayer ()\n\n@property (nonatomic) struct CGPath *gridCirclePath;\n\n- (void)drawGlintInContext:(CGContextRef)ctx;\n- (UIImage *)loupeImage;\n\n@end\n\n\n@implementation BGRSLoupeLayer\n\n@synthesize loupeCenter, colorPicker;\n\nconst CGFloat LOUPE_SIZE = 85, SHADOW_SIZE = 6, RIM_THICKNESS = 3.0;\nconst int NUM_PIXELS = 5, NUM_SKIP = 15;\n\n- (id)init {\n    self = [super init];\n    if (self) {\n        CGFloat size = LOUPE_SIZE+2*SHADOW_SIZE;\n        self.bounds = CGRectMake(-size/2,-size/2,size,size);\n        self.anchorPoint = CGPointMake(0.5, 1);\n\n        UIImage *loupeImage = [self loupeImage];\n        CALayer *loupeLayer = [CALayer layer];\n        loupeLayer.bounds = self.bounds;\n        loupeLayer.position = CGPointMake(CGRectGetMidX(self.bounds), CGRectGetMidY(self.bounds));\n        loupeLayer.contents = (id)loupeImage.CGImage;\n\n        [self addSublayer:loupeLayer];\n    }\n    return self;\n}\n\n- (void)dealloc {\n    self.colorPicker = nil;\n    if (_gridCirclePath) CGPathRelease(_gridCirclePath);\n}\n\n- (struct CGPath *)gridCirclePath {\n    if (_gridCirclePath == NULL) {\n        CGMutablePathRef circlePath = CGPathCreateMutable();\n        const CGFloat radius = LOUPE_SIZE/2;\n        CGPathAddArc(circlePath, nil, 0, 0, radius-RIM_THICKNESS/2, 0, 2*M_PI, YES);\n        _gridCirclePath = circlePath;\n    }\n    return _gridCirclePath;\n}\n\n- (UIImage *)loupeImage {\n    UIGraphicsBeginImageContextWithOptions(self.bounds.size, NO, 0);\n\n    CGContextRef ctx = UIGraphicsGetCurrentContext();\n\n    CGFloat size = LOUPE_SIZE+2*SHADOW_SIZE;\n    CGContextTranslateCTM(ctx, size/2, size/2);\n\n    // Draw Shadow\n    CGContextSaveGState(ctx);     // Save before shadow\n\n    UIBezierPath *inner = [UIBezierPath bezierPathWithOvalInRect:CGRectInset(self.bounds, SHADOW_SIZE + 1, SHADOW_SIZE + 1)];\n    UIBezierPath *outer = [UIBezierPath bezierPathWithRect:self.bounds];\n    [outer appendPath:inner];\n    outer.usesEvenOddFillRule = YES;\n    [outer addClip];\n\n    CGSize shadowOffset = CGSizeMake(0,SHADOW_SIZE/2);\n    CGContextSetShadowWithColor(ctx, shadowOffset, SHADOW_SIZE/2, [UIColor blackColor].CGColor);\n    CGContextAddEllipseInRect(ctx, CGRectMake(-LOUPE_SIZE/2, -LOUPE_SIZE/2, LOUPE_SIZE, LOUPE_SIZE));\n\n    CGContextSetFillColorWithColor(ctx, [colorPicker selectionColor].CGColor);\n    CGContextFillPath(ctx);\n\n    CGContextRestoreGState(ctx);  // Restore context after shadow\n\n    // Create Cliping Area\n    CGContextSaveGState(ctx);     // Save context for cliping\n\n    CGContextAddPath(ctx, self.gridCirclePath);  // Clip gird drawing to inside of loupe\n    CGContextClip(ctx);\n\n    [self drawGlintInContext:ctx];\n\n    CGContextRestoreGState(ctx);  // Restor from clip drawing\n\n    // Stroke Rim of Loupe\n    CGContextSetLineWidth(ctx, RIM_THICKNESS);\n    CGContextSetStrokeColorWithColor(ctx, [UIColor blackColor].CGColor);\n    CGContextAddPath(ctx, self.gridCirclePath);\n    CGContextStrokePath(ctx);\n\n    // Draw center of rim loupe\n    CGContextSetLineWidth(ctx, RIM_THICKNESS-1);\n    CGContextSetStrokeColorWithColor(ctx, [UIColor whiteColor].CGColor);\n    CGContextAddPath(ctx, self.gridCirclePath);\n    CGContextStrokePath(ctx);\n\n    const CGFloat w = ceilf(LOUPE_SIZE/NUM_PIXELS);\n\n    // Draw Selection Square\n    CGFloat xyOffset = -(w+1)/2;\n    CGRect selectedRect = CGRectMake(xyOffset, xyOffset, w, w);\n    CGContextAddRect(ctx, selectedRect);\n\n    CGContextSetStrokeColorWithColor(ctx, [UIColor blackColor].CGColor);\n    CGContextSetLineWidth(ctx, 1.0);\n    CGContextStrokePath(ctx);\n\n\n    UIImage *image = UIGraphicsGetImageFromCurrentImageContext();\n    UIGraphicsEndImageContext();\n    return image;\n}\n\n- (void)drawInContext:(CGContextRef)ctx {\n    CGContextAddPath(ctx, self.gridCirclePath);  // Clip gird drawing to inside of loupe\n    CGContextClip(ctx);\n\n    // Draw Opacity Background\n    NSInteger numCols = 6;\n    CGFloat loupeLength = LOUPE_SIZE;\n    CGFloat pixelLength = loupeLength / numCols;\n\n    UIColor *colorWhite = [UIColor whiteColor];\n    UIColor *colorGray = [UIColor grayColor];\n\n    UIColor *color1;\n    UIColor *color2;\n    UIColor *pixelColor;\n    for (int j = 0; j < numCols; j++){\n        color1 = (j % 2) ? colorWhite : colorGray;\n        color2 = (j % 2) ? colorGray : colorWhite;\n\n        for (int i = 0; i  < numCols; i++){\n            CGRect pixelRect = CGRectMake((pixelLength * i) - (loupeLength / 2),\n                                          (pixelLength * j) - (loupeLength / 2),\n                                          pixelLength,\n                                          pixelLength);\n\n            pixelColor = (i % 2) ? color1 : color2;\n            CGContextSetFillColorWithColor(ctx, pixelColor.CGColor);\n            CGContextFillRect(ctx, pixelRect);\n        }\n    }\n\n    [self drawGridInContext:ctx];\n}\n\n- (void)drawGridInContext:(CGContextRef)ctx {\n    const CGFloat w = ceilf(LOUPE_SIZE/NUM_PIXELS);\n\n    CGPoint currentPoint = [colorPicker selection];\n    currentPoint.x -= NUM_PIXELS*NUM_SKIP/2;\n    currentPoint.y -= NUM_PIXELS*NUM_SKIP/2;\n    int i,j;\n\n    // Draw Pixelated Loupe\n    for (j=0; j<NUM_PIXELS; j++){\n        for (i=0; i<NUM_PIXELS; i++){\n\n            CGRect pixelRect = CGRectMake(w*i-LOUPE_SIZE/2, w*j-LOUPE_SIZE/2, w, w);\n            UIColor *pixelColor = [self.colorPicker colorAtPoint:currentPoint];\n            CGContextSetFillColorWithColor(ctx, pixelColor.CGColor);\n            CGContextFillRect(ctx, pixelRect);\n\n            currentPoint.x += NUM_SKIP;\n        }\n        currentPoint.x -= NUM_PIXELS*NUM_SKIP;\n        currentPoint.y += NUM_SKIP;\n    }\n}\n\n- (void)drawGlintInContext:(CGContextRef)ctx{\n    // Draw Top Glint\n    CGFloat radius =      LOUPE_SIZE/2;\n    CGFloat glintRadius = 1.50*LOUPE_SIZE;\n    CGFloat drop =        0.25*LOUPE_SIZE;\n    CGFloat yOff = drop + glintRadius - radius;\n\n    // Calculations\n    CGFloat glintAngle1 = acosf((yOff*yOff + glintRadius*glintRadius - radius*radius)\n                                /(2*yOff*glintRadius));\n    CGFloat glintAngle2 = asinf(glintRadius/radius * sinf(glintAngle1));\n    CGFloat glintEdgeHeight = -radius*sinf(glintAngle2-M_PI_2);\n\n    // Add bottom arc\n    CGContextAddArc(ctx, 0, yOff, glintRadius, -M_PI_2+glintAngle1, -M_PI_2-glintAngle1, YES);\n\n    // Add top arc\n    CGContextAddArc(ctx, 0, 0, radius, -M_PI_2-glintAngle2, -M_PI_2+glintAngle2, NO);\n\n    CGContextSetStrokeColorWithColor(ctx, [UIColor redColor].CGColor);\n    //CGContextStrokePath(ctx);\n    //return;\n\n    CGContextClosePath(ctx);\n    CGContextSaveGState(ctx);     // Save context for cliping\n    CGContextClip(ctx);\n\n    CGColorSpaceRef space = CGColorSpaceCreateDeviceGray();\n    NSArray *colors = @[(id)[UIColor colorWithWhite:1.0 alpha:0.65].CGColor,\n                        (id)[UIColor colorWithWhite:1.0 alpha:0.15].CGColor];\n\n    CGGradientRef myGradient = CGGradientCreateWithColors(space, (__bridge CFArrayRef)colors, NULL);\n\n    CGContextDrawLinearGradient(ctx, myGradient ,CGPointMake(0,-radius), CGPointMake(0,-glintEdgeHeight), 0);\n    CGGradientRelease(myGradient);\n    CGContextRestoreGState(ctx);\n\n\n    // Draw bottom glint\n    yOff   = 0.40*LOUPE_SIZE;\n    radius = 0.40*LOUPE_SIZE;\n    CGPoint glintCenter = CGPointMake(0, yOff);\n\n    CGContextAddArc(ctx, 0, yOff, radius, 0, M_2_PI, YES);\n    CGContextSaveGState(ctx);     // Save context for cliping\n    CGContextClip(ctx);\n\n    colors = @[(id)[UIColor colorWithWhite:1.0 alpha:0.5].CGColor,\n               (id)[UIColor colorWithWhite:1.0 alpha:0.0].CGColor];\n\n    myGradient = CGGradientCreateWithColors(space, (__bridge CFArrayRef)colors, NULL);\n\n    CGContextDrawRadialGradient(ctx, myGradient, glintCenter, 0.0, glintCenter, radius, 0.0);\n    CGGradientRelease(myGradient);\n    CGContextRestoreGState(ctx);\n\n    // Release objects\n    CGColorSpaceRelease(space);\n}\n\n#pragma mark - Animation -\n\nstatic NSString *const kAppearKey = @\"cp_l_appear\";\n\n- (void)appearInColorPicker:(RSColorPickerView*)aColorPicker{\n    if (self.colorPicker != aColorPicker) {\n        self.colorPicker = aColorPicker;\n    }\n\n    [self removeAllAnimations];\n    self.transform = CATransform3DIdentity;\n    isReadyToDismiss = NO;\n\n    // Add Layer to color picker\n    [CATransaction setDisableActions:YES];\n    [self.colorPicker.layer addSublayer:self];\n\n    // Animate Arival\n    isRunningInitialAnimation = YES;\n    CAKeyframeAnimation *springEffect = [CAKeyframeAnimation animationWithKeyPath:@\"transform.scale\"];\n    springEffect.values = @[@(0.1), @(1.4), @(0.95), @(1)];\n    springEffect.timingFunction = [CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionEaseInEaseOut];\n    springEffect.removedOnCompletion = NO;\n    springEffect.duration = 0.35f;\n    springEffect.delegate = self;\n\n    // Animate\n    [self addAnimation:springEffect forKey:kAppearKey];\n}\n\n/**\n * Disapear removes the loupe view from the color picker by shrinking it down to zero\n */\nstatic NSString *const kDisappearKey = @\"cp_l_disappear\";\n\n- (void)disappear {\n    [self disappearAnimated:YES];\n}\n\n- (void)disappearAnimated:(BOOL)anim {\n    isReadyToDismiss = YES;\n    if (isRunningInitialAnimation) return;\n\n    if (!anim) {\n        [self removeFromSuperlayer];\n        return;\n    }\n\n    self.transform = CATransform3DMakeScale(0.01, 0.01, 1);\n\n    CABasicAnimation *disapear = [CABasicAnimation animationWithKeyPath:@\"transform.scale\"];\n    disapear.fromValue = @(1);\n    disapear.duration  = 0.1f;\n    disapear.delegate  = self;\n    disapear.timingFunction = [CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionEaseInEaseOut];\n    disapear.removedOnCompletion = NO;\n    [self addAnimation:disapear forKey:kDisappearKey];\n}\n\n- (void)animationDidStop:(CAAnimation *)anim finished:(BOOL)flag {\n    if (anim == [self animationForKey:kDisappearKey]){\n        if (!flag) return;\n\n        [self removeFromSuperlayer];\n        self.transform = CATransform3DIdentity;\n    } else if (anim == [self animationForKey:kAppearKey]) {\n        isRunningInitialAnimation = NO;\n        if (isReadyToDismiss) {\n            [self disappear];\n        }\n    }\n}\n\n@end\n"
  },
  {
    "path": "RSColorPicker/ColorPickerClasses/RSColorFunctions.h",
    "content": "//\n//  RSColorFunctions.h\n//  RSColorPicker\n//\n//  Created by Ryan Sullivan on 3/12/13.\n//\n\n#import <UIKit/UIKit.h>\n#import \"ANImageBitmapRep.h\"\n\nBMPixel RSPixelFromHSV(CGFloat H, CGFloat S, CGFloat V);\nvoid RSHSVFromPixel(BMPixel pixel, CGFloat *h, CGFloat *s, CGFloat *v);\n\n// four floats will be placed into `components`\nvoid RSGetComponentsForColor(CGFloat *components, UIColor *color);\n\nUIImage * RSUIImageWithScale(UIImage *img, CGFloat scale);\n\nUIImage * RSOpacityBackgroundImage(CGFloat length, CGFloat scale, UIColor *color);\n\nUIColor * RSRandomColorOpaque(BOOL isOpaque);\n"
  },
  {
    "path": "RSColorPicker/ColorPickerClasses/RSColorFunctions.m",
    "content": "//\n//  RSColorFunctions.m\n//  RSColorPicker\n//\n//  Created by Ryan Sullivan on 3/12/13.\n//\n\n#import \"RSColorFunctions.h\"\n\nBMPixel RSPixelFromHSV(CGFloat H, CGFloat S, CGFloat V)\n{\n    if (S == 0) {\n        return BMPixelMake(V, V, V, 1.0);\n    }\n    if (H == 1) {\n        H = 0;\n    }\n\n    CGFloat var_h = H * 6.0;\n    // Verified `H` is never <0 so (int) is OK:\n    int var_i = (int)var_h;\n    CGFloat var_1 = V * (1.0 - S);\n\n    if (var_i == 0) {\n        CGFloat var_3 = V * (1.0 - S * (1.0 - (var_h - var_i)));\n        return BMPixelMake(V, var_3, var_1, 1.0);\n    } else if (var_i == 1) {\n        CGFloat var_2 = V * (1.0 - S * (var_h - var_i));\n        return BMPixelMake(var_2, V, var_1, 1.0);\n    } else if (var_i == 2) {\n        CGFloat var_3 = V * (1.0 - S * (1.0 - (var_h - var_i)));\n        return BMPixelMake(var_1, V, var_3, 1.0);\n    } else if (var_i == 3) {\n        CGFloat var_2 = V * (1.0 - S * (var_h - var_i));\n        return BMPixelMake(var_1, var_2, V, 1.0);\n    } else if (var_i == 4) {\n        CGFloat var_3 = V * (1.0 - S * (1.0 - (var_h - var_i)));\n        return BMPixelMake(var_3, var_1, V, 1.0);\n    }\n    CGFloat var_2 = V * (1.0 - S * (var_h - var_i));\n    return BMPixelMake(V, var_1, var_2, 1.0);\n}\n\n\nvoid RSHSVFromPixel(BMPixel pixel, CGFloat *h, CGFloat *s, CGFloat *v)\n{\n    UIColor *color = [UIColor colorWithRed:pixel.red green:pixel.green blue:pixel.blue alpha:1];\n    [color getHue:h saturation:s brightness:v alpha:NULL];\n}\n\nvoid RSGetComponentsForColor(CGFloat *components, UIColor *color)\n{\n    // First try to get the components the right way\n\n    if ([color getRed:&components[0] green:&components[1] blue:&components[2] alpha:&components[3]]) {\n        return;\n    } else if ([color getWhite:&components[0] alpha:&components[3]]) {\n        components[1] = components[0];\n        components[2] = components[0];\n        return;\n    }\n\n    // *Then* resort to this good old hack.\n    \n    CGColorSpaceRef rgbColorSpace = CGColorSpaceCreateDeviceRGB();\n    unsigned char resultingPixel[4] = {0};\n    CGContextRef context = CGBitmapContextCreate(&resultingPixel, 1, 1, 8, 4, rgbColorSpace, (CGBitmapInfo)kCGImageAlphaPremultipliedLast);\n    CGContextSetFillColorWithColor(context, [color CGColor]);\n    CGContextFillRect(context, CGRectMake(0, 0, 1, 1));\n    CGContextRelease(context);\n    CGColorSpaceRelease(rgbColorSpace);\n\n\n    for (int component = 0; component < 4; component++) {\n        components[component] = resultingPixel[component] / 255.0;\n    }\n\n    if (components[3] > 0)\n    {\n        components[0] /= components[3];\n        components[1] /= components[3];\n        components[2] /= components[3];\n    }\n}\n\nUIImage * RSUIImageWithScale(UIImage *img, CGFloat scale)\n{\n    return [UIImage imageWithCGImage:img.CGImage scale:scale orientation:UIImageOrientationUp];\n}\n\n/**\n * Returns image that looks like a checkered background.\n */\nUIImage * RSOpacityBackgroundImage(CGFloat length, CGFloat scale, UIColor *color) {\n    NSCAssert(scale > 0, @\"Tried to create opacity background image with scale 0\");\n    NSCAssert(length > 0, @\"Tried to create opacity background image with length 0\");\n\n    UIBezierPath *rectanglePath = [UIBezierPath bezierPathWithRect:CGRectMake(0, 0, length*0.5, length*0.5)];\n    UIBezierPath *rectangle2Path = [UIBezierPath bezierPathWithRect:CGRectMake(length*0.5, length*0.5, length*0.5, length*0.5)];\n    UIBezierPath *rectangle3Path = [UIBezierPath bezierPathWithRect:CGRectMake(0, length*0.5, length*0.5, length*0.5)];\n    UIBezierPath *rectangle4Path = [UIBezierPath bezierPathWithRect:CGRectMake(length*0.5, 0, length*0.5, length*0.5)];\n\n    UIGraphicsBeginImageContextWithOptions(CGSizeMake(length, length), NO, scale);\n\n    [color setFill];\n    [rectanglePath fill];\n    [rectangle2Path fill];\n\n    [[UIColor whiteColor] setFill];\n    [rectangle3Path fill];\n    [rectangle4Path fill];\n\n    UIImage *image = UIGraphicsGetImageFromCurrentImageContext();\n    UIGraphicsEndImageContext();\n\n    return RSUIImageWithScale(image, scale);\n}\n\nUIColor * RSRandomColorOpaque(BOOL isOpaque) {\n    /*\n     From https://gist.github.com/kylefox/1689973\n\n     ***\n\n     Distributed under The MIT License:\n     http://opensource.org/licenses/mit-license.php\n\n     Permission is hereby granted, free of charge, to any person obtaining\n     a copy of this software and associated documentation files (the\n     \"Software\"), to deal in the Software without restriction, including\n     without limitation the rights to use, copy, modify, merge, publish,\n     distribute, sublicense, and/or sell copies of the Software, and to\n     permit persons to whom the Software is furnished to do so, subject to\n     the following conditions:\n\n     The above copyright notice and this permission notice shall be\n     included in all copies or substantial portions of the Software.\n\n     THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n     EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\n     MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n     NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\n     LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\n     OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\n     WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n\n     Alpha modifications for RSColorPicker test project\n     */\n\n    CGFloat hue = ( arc4random() % 256 / 256.0 );  //  0.0 to 1.0\n    CGFloat saturation = ( arc4random() % 128 / 256.0 ) + 0.5;  //  0.5 to 1.0, away from white\n    CGFloat brightness = ( arc4random() % 128 / 256.0 ) + 0.5;  //  0.5 to 1.0, away from black\n    CGFloat alpha = 1;\n\n    if (!isOpaque) {\n        alpha = ( arc4random() % 128 / 256.0 ) + 0.5;\n    }\n\n    return [UIColor colorWithHue:hue saturation:saturation brightness:brightness alpha:alpha];\n}\n"
  },
  {
    "path": "RSColorPicker/ColorPickerClasses/RSColorPickerState.h",
    "content": "//\n//  RSColorPickerState.h\n//  RSColorPicker\n//\n//  Created by Alex Nichol on 12/16/13.\n//\n\n#import <Foundation/Foundation.h>\n#import \"RSColorFunctions.h\"\n\n/**\n * Represents the state of a color picker. This includes\n * the position on the color picker (for a square picker) that\n * is selected.\n *\n * Terms used:\n * \"size\" - the diameter of the color picker\n * \"padding\" - the amount of pixels on each side of the color picker\n *             reserved for padding\n */\n@interface RSColorPickerState : NSObject {\n    CGPoint scaledRelativePoint; // H & S\n    CGFloat brightness; // V\n    CGFloat alpha; // A\n}\n\n@property (readonly) CGFloat hue, saturation, brightness, alpha;\n\n/**\n * Creates a state with a 1.0 alpha and 1.0 brightness that would arise\n * by selecting `point` on a color picker of diameter `size` and padding `padding`.\n */\n+ (RSColorPickerState *)stateForPoint:(CGPoint)point size:(CGFloat)size padding:(CGFloat)padding;\n\n/**\n * Create a state with a given color.\n */\n- (id)initWithColor:(UIColor *)selectionColor;\n\n/**\n * Create a state given a point on the unit circle and brightness+alpha\n */\n- (id)initWithScaledRelativePoint:(CGPoint)p brightness:(CGFloat)V alpha:(CGFloat)A;\n\n/**\n * Create a state given HSVA components.\n */\n- (id)initWithHue:(CGFloat)H saturation:(CGFloat)S brightness:(CGFloat)V alpha:(CGFloat)A;\n\n- (UIColor *)color;\n\n/**\n * Returns the position of this state on a color picker of size `size` and padding `padding`.\n * Note: this point may be outside of the unit circle if a point outside the unit circle\n * was picked to generate this state.\n */\n- (CGPoint)selectionLocationWithSize:(CGFloat)size padding:(CGFloat)padding;\n\n// This class is immutable, so these are helpful!\n- (RSColorPickerState *)stateBySettingBrightness:(CGFloat)newBright;\n- (RSColorPickerState *)stateBySettingAlpha:(CGFloat)newAlpha;\n- (RSColorPickerState *)stateBySettingHue:(CGFloat)newHue;\n- (RSColorPickerState *)stateBySettingSaturation:(CGFloat)newSaturation;\n\n@end\n"
  },
  {
    "path": "RSColorPicker/ColorPickerClasses/RSColorPickerState.m",
    "content": "//\n//  RSColorPickerState.m\n//  RSColorPicker\n//\n//  Created by Alex Nichol on 12/16/13.\n//\n\n#import \"RSColorPickerState.h\"\n\nstatic CGFloat _calculateHue(CGPoint point);\nstatic CGFloat _calculateSaturation(CGPoint point);\nstatic CGPoint _calculatePoint(CGFloat hue, CGFloat saturation);\n\n@implementation RSColorPickerState\n\n@synthesize brightness, alpha;\n\n- (CGFloat)hue {\n    return _calculateHue(scaledRelativePoint);\n}\n\n- (CGFloat)saturation {\n    return _calculateSaturation(scaledRelativePoint);\n}\n\n- (UIColor *)color {\n    return [UIColor colorWithHue:self.hue saturation:self.saturation brightness:brightness alpha:alpha];\n}\n\n+ (RSColorPickerState *)stateForPoint:(CGPoint)point size:(CGFloat)size padding:(CGFloat)padding {\n    // calculate everything we need to know\n    CGPoint relativePoint = CGPointMake(point.x - (size / 2.0), (size / 2.0) - point.y);\n    CGPoint scaledRelativePoint = relativePoint;\n    scaledRelativePoint.x /= (size / 2.0) - padding;\n    scaledRelativePoint.y /= (size / 2.0) - padding;\n    return [[RSColorPickerState alloc] initWithScaledRelativePoint:scaledRelativePoint\n                                                        brightness:1 alpha:1];\n}\n\n- (id)initWithColor:(UIColor *)_selectionColor {\n    if ((self = [super init])) {\n        CGFloat rgba[4];\n        RSGetComponentsForColor(rgba, _selectionColor);\n        UIColor * selectionColor = [UIColor colorWithRed:rgba[0] green:rgba[1] blue:rgba[2] alpha:rgba[3]];\n        CGFloat hue, saturation;\n        [selectionColor getHue:&hue saturation:&saturation brightness:&brightness alpha:&alpha];\n        scaledRelativePoint = _calculatePoint(hue, saturation);\n    }\n    return self;\n}\n\n- (id)initWithScaledRelativePoint:(CGPoint)p brightness:(CGFloat)V alpha:(CGFloat)A {\n    if ((self = [super init])) {\n        scaledRelativePoint = p;\n        brightness = V;\n        alpha = A;\n    }\n    return self;\n}\n\n- (id)initWithHue:(CGFloat)H saturation:(CGFloat)S brightness:(CGFloat)V alpha:(CGFloat)A {\n    if ((self = [super init])) {\n        scaledRelativePoint = _calculatePoint(H, S);\n        brightness = V;\n        alpha = A;\n    }\n    return self;\n}\n\n- (CGPoint)selectionLocationWithSize:(CGFloat)size padding:(CGFloat)padding {\n    CGPoint unscaled = scaledRelativePoint;\n    unscaled.x *= (size / 2.0) - padding;\n    unscaled.y *= (size / 2.0) - padding;\n    return CGPointMake(unscaled.x + (size / 2.0), (size / 2.0) - unscaled.y);\n}\n\n#pragma mark - Modification\n\n- (RSColorPickerState *)stateBySettingBrightness:(CGFloat)newBright {\n    return [[RSColorPickerState alloc] initWithScaledRelativePoint:scaledRelativePoint brightness:newBright alpha:alpha];\n}\n\n- (RSColorPickerState *)stateBySettingAlpha:(CGFloat)newAlpha {\n    return [[RSColorPickerState alloc] initWithScaledRelativePoint:scaledRelativePoint brightness:brightness alpha:newAlpha];\n}\n\n- (RSColorPickerState *)stateBySettingHue:(CGFloat)newHue {\n    CGPoint newPoint = _calculatePoint(newHue, self.saturation);\n    return [[RSColorPickerState alloc] initWithScaledRelativePoint:newPoint brightness:brightness alpha:alpha];\n}\n\n- (RSColorPickerState *)stateBySettingSaturation:(CGFloat)newSaturation {\n    CGPoint newPoint = _calculatePoint(self.hue, newSaturation);\n    return [[RSColorPickerState alloc] initWithScaledRelativePoint:newPoint brightness:brightness alpha:alpha];\n}\n\n#pragma mark - Debugging\n\n- (NSString *)description {\n    NSMutableString *description = [NSMutableString stringWithFormat:@\"<%@: %p { \", NSStringFromClass([self class]), self];\n\n    [description appendFormat:@\"scaledPoint:%@ \", NSStringFromCGPoint(scaledRelativePoint)];\n    [description appendFormat:@\"brightness:%f \", brightness];\n    [description appendFormat:@\"alpha:%f\", alpha];\n\n    [description appendString:@\"} >\"];\n    return description;\n}\n\n@end\n\n#pragma mark - Helper Functions\n\nstatic CGFloat _calculateHue(CGPoint point) {\n    double angle = atan2(point.y, point.x);\n    if (angle < 0) angle += M_PI * 2;\n    return angle / (M_PI * 2);\n}\n\nstatic CGFloat _calculateSaturation(CGPoint point) {\n    CGFloat radius = sqrt(pow(point.x, 2) + pow(point.y, 2));\n    if (radius > 1) {\n        radius = 1;\n    }\n    return radius;\n}\n\nstatic CGPoint _calculatePoint(CGFloat hue, CGFloat saturation) {\n    // convert to HSV\n    CGFloat angle = hue * (2.0 * M_PI);\n    CGFloat pointX = cos(angle) * saturation;\n    CGFloat pointY = sin(angle) * saturation;\n    return CGPointMake(pointX, pointY);\n}\n"
  },
  {
    "path": "RSColorPicker/ColorPickerClasses/RSColorPickerView.h",
    "content": "//\n//  RSColorPickerView.h\n//  RSColorPicker\n//\n//  Created by Ryan Sullivan on 8/12/11.\n//\n\n#import <UIKit/UIKit.h>\n#import <QuartzCore/QuartzCore.h>\n#import <Accelerate/Accelerate.h>\n\n@class RSColorPickerView, BGRSLoupeLayer;\n\n@protocol RSColorPickerViewDelegate <NSObject>\n/**\n * Called everytime the color picker's selection/color is changed.\n * Don't do expensive operations here as it will slow down your app.\n */\n- (void)colorPickerDidChangeSelection:(RSColorPickerView *)colorPicker;\n@optional\n- (void)colorPicker:(RSColorPickerView *)colorPicker touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event;\n- (void)colorPicker:(RSColorPickerView *)colorPicker touchesEnded:(NSSet *)touches withEvent:(UIEvent *)event;\n@end\n\nIB_DESIGNABLE\n@interface RSColorPickerView : UIView\n\n/**\n * Specifies if the color picker should be drawn as a circle, or as a square.\n */\n@property (nonatomic) IBInspectable BOOL cropToCircle;\n\n/**\n * The brightness of the current selection\n */\n@property (nonatomic) CGFloat brightness;\n\n/**\n * The opacity of the current selection.\n */\n@property (nonatomic) CGFloat opacity;\n\n/**\n * The selection color.\n * This setter may modify `brightness` and `opacity` as necessary.\n */\n@property (nonatomic) UIColor * selectionColor;\n\n/**\n * The delegate\n */\n@property (nonatomic, weak) id <RSColorPickerViewDelegate> delegate;\n\n/**\n * The current point (in the color picker's bounds) of the selected color.\n */\n@property (readwrite) CGPoint selection;\n\n/**\n * The distance around the edges of the color picker that is drawn for padding.\n * Colors are cut-off before this distance so that the user can pick all colors.\n */\n@property (readonly) CGFloat paddingDistance;\n\n/**\n * Specifies if the loupe should be drawn or not.\n * Default: YES (show).\n */\n@property (nonatomic) BOOL showLoupe;\n\n/**\n * The color at a given point in the color picker's bounds.\n */\n- (UIColor *)colorAtPoint:(CGPoint)point;\n\n/**\n * Methods that create/cache data needed to create a color picker.\n * These run async (except where noted) and can help the overall UX.\n */\n\n+ (void)prepareForDiameter:(CGFloat)diameter;\n+ (void)prepareForDiameter:(CGFloat)diameter padding:(CGFloat)padding;\n+ (void)prepareForDiameter:(CGFloat)diameter scale:(CGFloat)scale;\n+ (void)prepareForDiameter:(CGFloat)diameter scale:(CGFloat)scale padding:(CGFloat)padding;\n+ (void)prepareForDiameter:(CGFloat)diameter scale:(CGFloat)scale padding:(CGFloat)padding inBackground:(BOOL)bg;\n@end\n"
  },
  {
    "path": "RSColorPicker/ColorPickerClasses/RSColorPickerView.m",
    "content": "//\n//  RSColorPickerView.m\n//  RSColorPicker\n//\n//  Created by Ryan Sullivan on 8/12/11.\n//\n\n\n#import \"ANImageBitmapRep.h\"\n\n#import \"BGRSLoupeLayer.h\"\n#import \"RSColorFunctions.h\"\n#import \"RSColorPickerState.h\"\n#import \"RSColorPickerView.h\"\n#import \"RSGenerateOperation.h\"\n#import \"RSSelectionLayer.h\"\n\n#define kSelectionViewSize 22\n\n@interface RSColorPickerView () {\n    struct {\n        unsigned int bitmapNeedsUpdate:1;\n    } _colorPickerViewFlags;\n    RSColorPickerState * state;\n}\n\n@property (nonatomic) ANImageBitmapRep *rep;\n\n/**\n * A path which represents the shape of the color picker palette,\n * padded by 1/2 the selectionViews's size.\n */\n@property (nonatomic) UIBezierPath *activeAreaShape;\n\n\n/**\n * The layer which contains just the currently selected color \n * within the -selectionLayer.\n */\n@property (nonatomic) CALayer *selectionColorLayer;\n/**\n * Layer which shows the circular selection \"target\".\n */\n@property (nonatomic) RSSelectionLayer *selectionLayer;\n\n/**\n * The layer which will ultimately contain the generated\n * palette image.\n */\n@property (nonatomic) CALayer *gradientLayer;\n\n/**\n * A black layer. As the brightness is lowered, the opacity\n * of brightnessLayer is increased and thus this view becomes more\n * visible.\n */\n@property (nonatomic) CALayer *brightnessLayer;\n\n/**\n * A checkerboard pattern indicating opacity.\n * As opacity is lowered, the alpha of this view becomes\n * closer to 1.\n */\n@property (nonatomic) CALayer *opacityLayer;\n\n/**\n * Layer that will contain the gradientLayer, brightnessLayer,\n * opacityLayer.\n */\n@property (nonatomic) CALayer *contentsLayer;\n\n\n@property (nonatomic) BGRSLoupeLayer *loupeLayer;\n\n/**\n * Gets updated to the scale of the current UIWindow.\n */\n@property (nonatomic) CGFloat scale;\n\n- (void)initRoutine;\n- (void)resizeOrRescale;\n\n// Called to generate the _rep ivar and set it.\n- (void)genBitmap;\n\n// Called to generate the bezier paths\n- (void)generateBezierPaths;\n\n// Called to update the UI for the current state.\n- (void)handleStateChanged;\n\n// Called to handle a state change (optionally disabling CA Actions for loupe).\n- (void)handleStateChangedDisableActions:(BOOL)disable;\n\n// touch handling\n- (CGPoint)validPointForTouch:(CGPoint)touchPoint;\n- (RSColorPickerState *)stateForPoint:(CGPoint)point;\n- (void)updateStateForTouchPoint:(CGPoint)point;\n\n// metrics\n- (CGFloat)paletteDiameter;\n\n@end\n\n\n@implementation RSColorPickerView\n\n#pragma mark - Object Lifecycle -\n\n- (id)initWithFrame:(CGRect)frame {\n    CGFloat square = fmin(frame.size.height, frame.size.width);\n    frame.size = CGSizeMake(square, square);\n\n    self = [super initWithFrame:frame];\n    if (self) {\n        [self initRoutine];\n    }\n    return self;\n}\n\n- (id)initWithCoder:(NSCoder *)aDecoder {\n    self = [super initWithCoder:aDecoder];\n    if (self) {\n        [self initRoutine];\n    }\n    return self;\n}\n\n- (void)initRoutine {\n\n    // Show or hide the loupe. Default: show.\n    self.showLoupe = YES;\n    self.opaque = YES;\n    self.backgroundColor = [UIColor clearColor];\n\n    _colorPickerViewFlags.bitmapNeedsUpdate = NO;\n\n    // the view used to select the colour\n    self.selectionLayer = [RSSelectionLayer layer];\n    self.selectionLayer.frame = CGRectMake(0.0, 0.0, kSelectionViewSize, kSelectionViewSize);\n    [self.selectionLayer setNeedsDisplay];\n\n    self.selectionColorLayer = [CALayer layer];\n    self.selectionColorLayer.cornerRadius = kSelectionViewSize / 2;\n    self.selectionColorLayer.frame = CGRectMake(0.0, 0.0, kSelectionViewSize, kSelectionViewSize);\n\n    self.brightnessLayer = [CALayer layer];\n    self.brightnessLayer.frame = self.bounds;\n    self.brightnessLayer.backgroundColor = [UIColor blackColor].CGColor;\n\n    self.gradientLayer = [CALayer layer];\n    self.gradientLayer.frame = self.bounds;\n\n    self.opacityLayer = [CALayer layer];\n\n    self.contentsLayer = [CALayer layer];\n    self.contentsLayer.frame = self.bounds;\n\n    [self.contentsLayer addSublayer:self.gradientLayer];\n    [self.contentsLayer addSublayer:self.brightnessLayer];\n    [self.contentsLayer addSublayer:self.selectionColorLayer];\n    [self.contentsLayer addSublayer:self.opacityLayer];\n    [self.contentsLayer addSublayer:self.selectionLayer];\n\n    [self.layer addSublayer:self.contentsLayer];\n\n    [self handleStateChangedDisableActions:NO];\n\n    self.contentsLayer.masksToBounds = YES;\n    self.cropToCircle = NO;\n    self.selectionColor = [UIColor whiteColor];\n}\n\n- (void)resizeOrRescale {\n    if (!self.window || self.frame.size.width == 0 || self.frame.size.height == 0) {\n        self.scale = 0;\n        [self.loupeLayer disappearAnimated:NO];\n        return;\n    }\n\n    self.scale = self.window.screen.scale;\n\n    [CATransaction begin];\n    [CATransaction setDisableActions:YES];\n\n    self.layer.contentsScale = self.scale;\n    self.selectionLayer.contentsScale = self.scale;\n    self.selectionColorLayer.contentsScale = self.scale;\n    self.brightnessLayer.contentsScale = self.scale;\n    self.gradientLayer.contentsScale = self.scale;\n    self.opacityLayer.contentsScale = 1.0;//self.scale;\n    self.loupeLayer.contentsScale = self.scale;\n    self.contentsLayer.contentsScale = self.scale;\n\n    _colorPickerViewFlags.bitmapNeedsUpdate = YES;\n    self.contentsLayer.frame    = self.bounds;\n    self.gradientLayer.frame    = self.bounds;\n    self.brightnessLayer.frame  = self.bounds;\n    self.opacityLayer.frame     = self.bounds;\n\n    self.opacityLayer.backgroundColor = [[UIColor colorWithPatternImage:RSOpacityBackgroundImage(20, self.scale, [UIColor colorWithWhite:0.5 alpha:1.0])] CGColor];\n\n    [self genBitmap];\n    [self generateBezierPaths];\n    [self handleStateChanged];\n\n    [CATransaction commit];\n}\n\n- (void)didMoveToWindow {\n    [self resizeOrRescale];\n}\n\n- (void)setFrame:(CGRect)frame {\n    NSAssert(frame.size.width == frame.size.height, @\"RSColorPickerView must be square.\");\n    [super setFrame:frame];\n    [self resizeOrRescale];\n}\n\n#pragma mark - Business -\n\n- (void)genBitmap {\n    if (!_colorPickerViewFlags.bitmapNeedsUpdate) return;\n\n    self.rep = [self.class bitmapForDiameter:self.gradientLayer.bounds.size.width scale:self.scale padding:self.paddingDistance shouldCache:YES];\n    _colorPickerViewFlags.bitmapNeedsUpdate = NO;\n    self.gradientLayer.contents = (id)[RSUIImageWithScale(self.rep.image, self.scale) CGImage];\n}\n\n- (void)generateBezierPaths {\n    [CATransaction begin];\n    [CATransaction setDisableActions:YES];\n\n    CGRect activeAreaFrame = CGRectInset(self.bounds, self.paddingDistance, self.paddingDistance);\n    if (self.cropToCircle) {\n        self.contentsLayer.cornerRadius = self.paletteDiameter / 2.0;\n        self.activeAreaShape = [UIBezierPath bezierPathWithOvalInRect:activeAreaFrame];\n    } else {\n        self.contentsLayer.cornerRadius = 0.0;\n        self.activeAreaShape = [UIBezierPath bezierPathWithRect:activeAreaFrame];\n    }\n\n    [CATransaction commit];\n}\n\n#pragma mark - Getters -\n\n- (UIColor *)colorAtPoint:(CGPoint)point {\n    return [self stateForPoint:point].color;\n}\n\n- (CGFloat)brightness {\n    return state.brightness;\n}\n\n- (CGFloat)opacity {\n    return state.alpha;\n}\n\n- (UIColor *)selectionColor {\n    return state.color;\n}\n\n- (CGPoint)selection {\n    return [state selectionLocationWithSize:self.paletteDiameter padding:self.paddingDistance];\n}\n\n#pragma mark - Setters -\n\n- (void)setSelection:(CGPoint)selection {\n    [self updateStateForTouchPoint:selection];\n}\n\n- (void)setBrightness:(CGFloat)bright {\n    state = [state stateBySettingBrightness:bright];\n    [self handleStateChanged];\n}\n\n- (void)setOpacity:(CGFloat)opacity {\n    state = [state stateBySettingAlpha:opacity];\n    [self handleStateChanged];\n}\n\n- (void)setCropToCircle:(BOOL)circle {\n    _cropToCircle = circle;\n\n    [self generateBezierPaths];\n    if (circle) {\n        // there's a chance the selection was outside the bounds\n        CGPoint point = [self validPointForTouch:[state selectionLocationWithSize:self.paletteDiameter\n                                                                          padding:self.paddingDistance]];\n        [self updateStateForTouchPoint:point];\n    } else {\n        [self handleStateChanged];\n    }\n}\n\n- (void)setSelectionColor:(UIColor *)selectionColor {\n    state = [[RSColorPickerState alloc] initWithColor:selectionColor];\n    [self handleStateChanged];\n}\n\n#pragma mark - Selection Updates -\n\n- (void)handleStateChanged {\n    [self handleStateChangedDisableActions:YES];\n}\n\n- (void)handleStateChangedDisableActions:(BOOL)disable {\n    [CATransaction begin];\n    [CATransaction setDisableActions: disable];\n\n    // update positions\n    CGPoint selectionLocation = [state selectionLocationWithSize:self.paletteDiameter padding:self.paddingDistance];\n    self.selectionLayer.position      = selectionLocation;\n    self.selectionColorLayer.position = selectionLocation;\n    self.loupeLayer.position          = selectionLocation;\n\n    // Make loupeLayer sharp on screen\n    CGRect loupeFrame     = self.loupeLayer.frame;\n    loupeFrame.origin     = CGPointMake(round(loupeFrame.origin.x), round(loupeFrame.origin.y));\n    self.loupeLayer.frame = loupeFrame;\n    [self.loupeLayer setNeedsDisplay];\n\n    // set colors and opacities\n    self.selectionColorLayer.backgroundColor = [[self selectionColor] CGColor];\n    self.opacityLayer.opacity    = 1 - self.opacity;\n    self.brightnessLayer.opacity = 1 - self.brightness;\n    [CATransaction commit];\n\n    // notify delegate\n    if ([self.delegate respondsToSelector:@selector(colorPickerDidChangeSelection:)]) {\n        [self.delegate colorPickerDidChangeSelection:self];\n    }\n}\n\n- (void)updateStateForTouchPoint:(CGPoint)point {\n    state = [self stateForPoint:[self validPointForTouch:point]];\n    [self handleStateChanged];\n}\n\n#pragma mark - Metrics -\n\n- (CGFloat)paddingDistance {\n    return kSelectionViewSize / 2.0;\n}\n\n- (CGFloat)paletteDiameter {\n    return self.bounds.size.width;\n}\n\n#pragma mark - Touch Events -\n\n- (CGPoint)validPointForTouch:(CGPoint)touchPoint {\n    if ([self.activeAreaShape containsPoint:touchPoint]) {\n        return touchPoint;\n    }\n\n    if (self.cropToCircle) {\n        // We compute the right point on the gradient border\n        CGPoint returnedPoint;\n\n        // TouchCircle is the circle which pass by the point 'touchPoint', of radius 'r'\n        // 'X' is the x coordinate of the touch in TouchCircle\n        CGFloat X = touchPoint.x - CGRectGetMidX(self.bounds);\n        // 'Y' is the y coordinate of the touch in TouchCircle\n        CGFloat Y = touchPoint.y - CGRectGetMidY(self.bounds);\n        CGFloat r = sqrt(pow(X, 2) + pow(Y, 2));\n\n        // alpha is the angle in radian of the touch on the unit circle\n        CGFloat alpha = acos( X / r );\n        if (touchPoint.y > CGRectGetMidX(self.bounds)) alpha = (2 * M_PI) - alpha;\n\n        // 'actual radius' is the distance between the center and the border of the gradient\n        CGFloat actualRadius = (self.paletteDiameter / 2.0) - self.paddingDistance;\n\n        returnedPoint.x = fabs(actualRadius) * cos(alpha);\n        returnedPoint.y = fabs(actualRadius) * sin(alpha);\n\n        // we offset the center of the circle, to get the coordinate from the right top left origin\n        returnedPoint.x = returnedPoint.x + CGRectGetMidX(self.bounds);\n        returnedPoint.y = CGRectGetMidY(self.bounds) - returnedPoint.y;\n        return returnedPoint;\n    } else {\n        CGPoint point = touchPoint;\n        if (point.x < self.paddingDistance) point.x = self.paddingDistance;\n        if (point.x > self.paletteDiameter - self.paddingDistance) {\n            point.x = self.paletteDiameter - self.paddingDistance;\n        }\n        if (point.y < self.paddingDistance) point.y = self.paddingDistance;\n        if (point.y > self.paletteDiameter - self.paddingDistance) {\n            point.y = self.paletteDiameter - self.paddingDistance;\n        }\n        return point;\n    }\n}\n\n- (RSColorPickerState *)stateForPoint:(CGPoint)point {\n    RSColorPickerState * newState = [RSColorPickerState stateForPoint:point\n                                                                 size:self.paletteDiameter\n                                                              padding:self.paddingDistance];\n    newState = [[newState stateBySettingAlpha:self.opacity] stateBySettingBrightness:self.brightness];\n    return newState;\n}\n\n- (void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event {\n\n    if (self.showLoupe) {\n        // Lazily load loupeLayer, if user wants to display it.\n\t\tif (!self.loupeLayer) {\n\t\t\tself.loupeLayer = [BGRSLoupeLayer layer];\n            self.loupeLayer.contentsScale = self.scale;\n\t\t}\n\t\t[self.loupeLayer appearInColorPicker:self];\n\t} else {\n        // Otherwise, byebye\n        [self.loupeLayer disappear];\n\t}\n\n    CGPoint point = [touches.anyObject locationInView:self];\n    [self updateStateForTouchPoint:point];\n\n    if ([self.delegate respondsToSelector:@selector(colorPicker:touchesBegan:withEvent:)]) {\n        [self.delegate colorPicker:self touchesBegan:touches withEvent:event];\n    }\n\n}\n\n- (void)touchesMoved:(NSSet *)touches withEvent:(UIEvent *)event {\n    CGPoint point = [[touches anyObject] locationInView:self];\n    [self updateStateForTouchPoint:point];\n}\n\n- (void)touchesEnded:(NSSet *)touches withEvent:(UIEvent *)event {\n    CGPoint point = [[touches anyObject] locationInView:self];\n    [self updateStateForTouchPoint:point];\n\n    [self.loupeLayer disappear];\n\n    if ([self.delegate respondsToSelector:@selector(colorPicker:touchesEnded:withEvent:)]) {\n        [self.delegate colorPicker:self touchesEnded:touches withEvent:event];\n    }\n}\n\n- (void)touchesCancelled:(NSSet *)touches withEvent:(UIEvent *)event {\n    [self.loupeLayer disappear];\n}\n\n#pragma mark - Class Methods -\n\nstatic NSCache *generatedBitmaps;\nstatic NSOperationQueue *generateQueue;\nstatic dispatch_queue_t backgroundQueue;\n\n+ (void)initialize {\n    generatedBitmaps = [NSCache new];\n    generateQueue = [NSOperationQueue new];\n    generateQueue.maxConcurrentOperationCount = NSOperationQueueDefaultMaxConcurrentOperationCount;\n    backgroundQueue = dispatch_queue_create(\"com.github.rsully.rscolorpicker.background\", DISPATCH_QUEUE_SERIAL);\n}\n\n#pragma mark Background Methods\n\n+ (void)prepareForDiameter:(CGFloat)diameter {\n    [self prepareForDiameter:diameter padding:kSelectionViewSize/2.0];\n}\n\n+ (void)prepareForDiameter:(CGFloat)diameter padding:(CGFloat)padding {\n    [self prepareForDiameter:diameter scale:1.0 padding:padding];\n}\n\n+ (void)prepareForDiameter:(CGFloat)diameter scale:(CGFloat)scale {\n    [self prepareForDiameter:diameter scale:scale padding:kSelectionViewSize / 2.0];\n}\n\n+ (void)prepareForDiameter:(CGFloat)diameter scale:(CGFloat)scale padding:(CGFloat)padding {\n    [self prepareForDiameter:diameter scale:scale padding:padding inBackground:YES];\n}\n\n#pragma mark Prep Method\n\n+ (void)prepareForDiameter:(CGFloat)diameter scale:(CGFloat)scale padding:(CGFloat)padding inBackground:(BOOL)bg {\n    void (*function)(dispatch_queue_t, dispatch_block_t) = bg ? dispatch_async : dispatch_sync;\n    function(backgroundQueue, ^{\n        [self bitmapForDiameter:diameter scale:scale padding:padding shouldCache:YES];\n    });\n}\n\n#pragma mark Generate Helper Method\n\n+ (ANImageBitmapRep *)bitmapForDiameter:(CGFloat)diameter scale:(CGFloat)scale padding:(CGFloat)paddingDistance shouldCache:(BOOL)cache {\n    RSGenerateOperation *repOp = nil;\n\n    // Handle the scale here so the operation can just work with pixels directly\n    paddingDistance *= scale;\n    diameter *= scale;\n\n    if (diameter <= 0) return nil;\n\n    // Unique key for this size combo\n    NSString *dictionaryCacheKey = [NSString stringWithFormat:@\"%.1f-%.1f\", diameter, paddingDistance];\n    // Check cache\n    repOp = [generatedBitmaps objectForKey:dictionaryCacheKey];\n\n    if (repOp) {\n        if (!repOp.isFinished) {\n            [repOp waitUntilFinished];\n        }\n        return repOp.bitmap;\n    }\n\n    repOp = [[RSGenerateOperation alloc] initWithDiameter:diameter andPadding:paddingDistance];\n\n    if (cache) {\n        [generatedBitmaps setObject:repOp forKey:dictionaryCacheKey cost:diameter];\n    }\n\n    [generateQueue addOperation:repOp];\n    [repOp waitUntilFinished];\n\n    return repOp.bitmap;\n}\n\n@end\n"
  },
  {
    "path": "RSColorPicker/ColorPickerClasses/RSGenerateOperation.h",
    "content": "//\n//  GenerateOperation.h\n//  RSColorPicker\n//\n//  Created by Ryan on 7/22/13.\n//\n\n#import <Foundation/Foundation.h>\n#import <Accelerate/Accelerate.h>\n\n@class ANImageBitmapRep;\n\n@interface RSGenerateOperation : NSOperation\n\n-(id)initWithDiameter:(CGFloat)diameter andPadding:(CGFloat)padding;\n\n@property (readonly) CGFloat diameter;\n@property (readonly) CGFloat padding;\n\n@property ANImageBitmapRep *bitmap;\n\n@end\n"
  },
  {
    "path": "RSColorPicker/ColorPickerClasses/RSGenerateOperation.m",
    "content": "//\n//  GenerateOperation.m\n//  RSColorPicker\n//\n//  Created by Ryan on 7/22/13.\n//\n\n#import \"RSGenerateOperation.h\"\n#import \"ANImageBitmapRep.h\"\n#import \"RSColorFunctions.h\"\n\n@implementation RSGenerateOperation\n\n- (id)initWithDiameter:(CGFloat)diameter andPadding:(CGFloat)padding {\n    if ((self = [self init])) {\n        _diameter = diameter;\n        _padding = padding;\n    }\n    return self;\n}\n\n- (void)main {\n    BMPoint repSize = BMPointMake(_diameter, _diameter);\n    \n    // Create fresh\n    ANImageBitmapRep *rep = [[ANImageBitmapRep alloc] initWithSize:repSize];\n    \n    CGFloat radius = _diameter / 2.0;\n    CGFloat relRadius = radius - _padding;\n    CGFloat relX, relY;\n\n    int i, x, y;\n    int arrSize = powf(_diameter, 2);\n    size_t arrDataSize = sizeof(float) * arrSize;\n\n    // data\n    float *preComputeX = (float *)malloc(arrDataSize);\n    float *preComputeY = (float *)malloc(arrDataSize);\n    // output\n    float *atan2Vals = (float *)malloc(arrDataSize);\n    float *distVals = (float *)malloc(arrDataSize);\n\n    i = 0;\n    for (x = 0; x < _diameter; x++) {\n        relX = x - radius;\n        for (y = 0; y < _diameter; y++) {\n            relY = radius - y;\n\n            preComputeY[i] = relY;\n            preComputeX[i] = relX;\n            i++;\n        }\n    }\n\n    // Use Accelerate.framework to compute the distance and angle of every\n    // pixel from the center of the bitmap.\n    vvatan2f(atan2Vals, preComputeY, preComputeX, &arrSize);\n    vDSP_vdist(preComputeX, 1, preComputeY, 1, distVals, 1, arrSize);\n\n    // Compution done, free these\n    free(preComputeX);\n    free(preComputeY);\n\n    i = 0;\n    for (x = 0; x < _diameter; x++) {\n        for (y = 0; y < _diameter; y++) {\n            CGFloat r_distance = fmin(distVals[i], relRadius);\n\n            CGFloat angle = atan2Vals[i];\n            if (angle < 0.0) angle = (2.0 * M_PI) + angle;\n\n            CGFloat perc_angle = angle / (2.0 * M_PI);\n            BMPixel thisPixel = RSPixelFromHSV(perc_angle, r_distance/relRadius, 1); // full brightness\n            [rep setPixel:thisPixel atPoint:BMPointMake(x, y)];\n\n            i++;\n        }\n    }\n    \n    // Bitmap generated, free these\n    free(atan2Vals);\n    free(distVals);\n    \n    self.bitmap = rep;\n}\n\n- (BOOL)isConcurrent {\n    return YES;\n}\n\n- (BOOL)isExecuting {\n    return self.bitmap == nil;\n}\n\n- (BOOL)isFinished {\n    return !self.isExecuting;\n}\n\n@end\n"
  },
  {
    "path": "RSColorPicker/ColorPickerClasses/RSSelectionLayer.h",
    "content": "//\n//  RSSelectionView.h\n//  RSColorPicker\n//\n//  Created by Ryan Sullivan on 3/12/13.\n//\n\n#import <UIKit/UIKit.h>\n\n@interface RSSelectionLayer : CALayer\n@end\n"
  },
  {
    "path": "RSColorPicker/ColorPickerClasses/RSSelectionLayer.m",
    "content": "//\n//  RSSelectionView.m\n//  RSColorPicker\n//\n//  Created by Ryan Sullivan on 3/12/13.\n//\n\n#import \"RSSelectionLayer.h\"\n\n\n@interface RSSelectionLayer ()\n\n@property (nonatomic, strong) CGColorRef outerRingColor __attribute__((NSObject));\n@property (nonatomic, strong) CGColorRef innerRingColor __attribute__((NSObject));\n\n@end\n\n@implementation RSSelectionLayer\n\n- (void)drawInContext:(CGContextRef)ctx {\n    if (!self.outerRingColor || !self.innerRingColor) {\n        self.outerRingColor = [[UIColor colorWithWhite:1 alpha:0.4] CGColor];\n        self.innerRingColor = [[UIColor colorWithWhite:0 alpha:1] CGColor];\n    }\n    CGRect rect = self.bounds;\n    \n    CGContextSetLineWidth(ctx, 3);\n    CGContextSetStrokeColorWithColor(ctx, self.outerRingColor);\n    CGContextStrokeEllipseInRect(ctx, CGRectInset(rect, 1.5, 1.5));\n    \n    CGContextSetLineWidth(ctx, 2);\n    CGContextSetStrokeColorWithColor(ctx, self.innerRingColor);\n    CGContextStrokeEllipseInRect(ctx, CGRectInset(rect, 3, 3));\n}\n\n@end\n\n"
  },
  {
    "path": "RSColorPicker/RSBrightnessSlider.h",
    "content": "//\n//  RSBrightnessSlider.h\n//  RSColorPicker\n//\n//  Created by Ryan Sullivan on 8/12/11.\n//\n\n#import <Foundation/Foundation.h>\n#import \"RSColorPickerView.h\"\n\n@interface RSBrightnessSlider : UISlider\n\n@property (nonatomic) RSColorPickerView *colorPicker;\n\n@end\n"
  },
  {
    "path": "RSColorPicker/RSBrightnessSlider.m",
    "content": "//\n//  RSBrightnessSlider.m\n//  RSColorPicker\n//\n//  Created by Ryan Sullivan on 8/12/11.\n//\n\n#import \"RSBrightnessSlider.h\"\n\n#import \"CGContextCreator.h\"\n\n/**\n * Returns Image with hourglass looking slider that looks something like:\n *\n *  6 ______ 5\n *    \\    /\n *   7 \\  / 4\n *    ->||<--- cWidth (Center Width)\n *      ||\n *   8 /  \\ 3\n *    /    \\\n *  1 ------ 2\n */\nUIImage * RSHourGlassThumbImage(CGSize size, CGFloat cWidth){\n\n    //Set Size\n    CGFloat width = size.width;\n    CGFloat height = size.height;\n\n    //Setup Context\n    CGContextRef ctx = [CGContextCreator newARGBBitmapContextWithSize:size];\n\n    //Set Colors\n    CGContextSetFillColorWithColor(ctx, [UIColor blackColor].CGColor);\n    CGContextSetStrokeColorWithColor(ctx, [UIColor whiteColor].CGColor);\n\n    //Draw Slider, See Diagram above for point numbers\n    CGFloat yDist83 = sqrtf(3)/2*width;\n    CGFloat yDist74 = height - yDist83;\n    CGPoint addLines[] = {\n        CGPointMake(0, -1),                          //Point 1\n        CGPointMake(width, -1),                      //Point 2\n        CGPointMake(width/2+cWidth/2, yDist83),      //Point 3\n        CGPointMake(width/2+cWidth/2, yDist74),      //Point 4\n        CGPointMake(width, height+1),                //Point 5\n        CGPointMake(0, height+1),                    //Point 6\n        CGPointMake(width/2-cWidth/2, yDist74),      //Point 7\n        CGPointMake(width/2-cWidth/2, yDist83)       //Point 8\n    };\n    //Fill Path\n    CGContextAddLines(ctx, addLines, sizeof(addLines)/sizeof(addLines[0]));\n    CGContextFillPath(ctx);\n\n    //Stroke Path\n    CGContextAddLines(ctx, addLines, sizeof(addLines)/sizeof(addLines[0]));\n    CGContextClosePath(ctx);\n    CGContextStrokePath(ctx);\n\n    CGImageRef cgImage = CGBitmapContextCreateImage(ctx);\n    CGContextRelease(ctx);\n\n    UIImage *image = [UIImage imageWithCGImage:cgImage];\n    CGImageRelease(cgImage);\n\n    return image;\n}\n\n/**\n * Returns image that looks like a square arrow loop, something like:\n *\n * +-----+\n * | +-+ | ------------------------\n * | | | |                       |\n * ->| |<--- loopSize.width     loopSize.height\n * | | | |                       |\n * | +-+ | ------------------------\n * +-----+\n */\nUIImage * RSArrowLoopThumbImage(CGSize size, CGSize loopSize){\n\n    //Setup Rects\n    CGRect outsideRect = CGRectMake(0, 0, size.width, size.height);\n    CGRect insideRect;\n    insideRect.size = loopSize;\n    insideRect.origin.x = (size.width - loopSize.width)/2;\n    insideRect.origin.y = (size.height - loopSize.height)/2;\n\n    //Setup Context\n    CGContextRef ctx = [CGContextCreator newARGBBitmapContextWithSize:size];\n\n    //Set Colors\n    CGContextSetFillColorWithColor(ctx, [UIColor blackColor].CGColor);\n    CGContextSetStrokeColorWithColor(ctx, [UIColor whiteColor].CGColor);\n\n    CGMutablePathRef loopPath = CGPathCreateMutable();\n    CGPathAddRect(loopPath, nil, outsideRect);\n    CGPathAddRect(loopPath, nil, insideRect);\n\n\n    //Fill Path\n    CGContextAddPath(ctx, loopPath);\n    CGContextEOFillPath(ctx);\n\n    //Stroke Path\n    CGContextAddRect(ctx, insideRect);\n    CGContextStrokePath(ctx);\n\n    CGImageRef cgImage = CGBitmapContextCreateImage(ctx);\n\n    //Memory\n    CGPathRelease(loopPath);\n    CGContextRelease(ctx);\n\n    UIImage *image = [UIImage imageWithCGImage:cgImage];\n    CGImageRelease(cgImage);\n\n    return image;\n}\n\n\n@implementation RSBrightnessSlider\n\n- (id)initWithFrame:(CGRect)frame {\n    self = [super initWithFrame:frame];\n    if (self) {\n        [self initRoutine];\n    }\n    return self;\n}\n\n- (id)initWithCoder:(NSCoder *)aDecoder {\n    self = [super initWithCoder:aDecoder];\n    if (self) {\n        [self initRoutine];\n    }\n    return self;\n}\n\n- (void)initRoutine {\n    self.minimumValue = 0.0;\n    self.maximumValue = 1.0;\n    self.continuous = YES;\n\n    self.enabled = YES;\n    self.userInteractionEnabled = YES;\n\n    [self addTarget:self action:@selector(myValueChanged:) forControlEvents:UIControlEventValueChanged];\n}\n\n- (void)myValueChanged:(id)notif {\n    [_colorPicker setBrightness:self.value];\n}\n\n- (void)drawRect:(CGRect)rect {\n    CGContextRef ctx = UIGraphicsGetCurrentContext();\n\n    CGColorSpaceRef space = CGColorSpaceCreateDeviceGray();\n    NSArray *colors = @[(id)[UIColor colorWithWhite:0 alpha:1].CGColor,\n                        (id)[UIColor colorWithWhite:1 alpha:1].CGColor];\n\n    CGGradientRef myGradient = CGGradientCreateWithColors(space, (__bridge CFArrayRef)colors, NULL);\n\n    CGContextDrawLinearGradient(ctx, myGradient, CGPointZero, CGPointMake(rect.size.width, 0), 0);\n    CGGradientRelease(myGradient);\n    CGColorSpaceRelease(space);\n}\n\n- (void)setColorPicker:(RSColorPickerView*)cp {\n    _colorPicker = cp;\n    if (!_colorPicker) { return; }\n    self.value = [_colorPicker brightness];\n}\n\n@end\n"
  },
  {
    "path": "RSColorPicker/RSColorPicker-Info.plist",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<!DOCTYPE plist PUBLIC \"-//Apple//DTD PLIST 1.0//EN\" \"http://www.apple.com/DTDs/PropertyList-1.0.dtd\">\n<plist version=\"1.0\">\n<dict>\n\t<key>CFBundleDevelopmentRegion</key>\n\t<string>en</string>\n\t<key>CFBundleDisplayName</key>\n\t<string>${PRODUCT_NAME}</string>\n\t<key>CFBundleExecutable</key>\n\t<string>${EXECUTABLE_NAME}</string>\n\t<key>CFBundleIconFile</key>\n\t<string></string>\n\t<key>CFBundleIdentifier</key>\n\t<string>me.rsullivan.apps.rscolorpicker.${PRODUCT_NAME:rfc1034identifier}</string>\n\t<key>CFBundleInfoDictionaryVersion</key>\n\t<string>6.0</string>\n\t<key>CFBundleName</key>\n\t<string>${PRODUCT_NAME}</string>\n\t<key>CFBundlePackageType</key>\n\t<string>APPL</string>\n\t<key>CFBundleShortVersionString</key>\n\t<string>1.0</string>\n\t<key>CFBundleSignature</key>\n\t<string>????</string>\n\t<key>CFBundleVersion</key>\n\t<string>1.0</string>\n\t<key>LSRequiresIPhoneOS</key>\n\t<true/>\n\t<key>UISupportedInterfaceOrientations</key>\n\t<array>\n\t\t<string>UIInterfaceOrientationPortrait</string>\n\t</array>\n</dict>\n</plist>\n"
  },
  {
    "path": "RSColorPicker/RSColorPicker-Prefix.pch",
    "content": "//\n// Prefix header for all source files of the 'RSColorPicker' target in the 'RSColorPicker' project\n//\n\n#import <Availability.h>\n\n#ifndef __IPHONE_3_0\n#warning \"This project uses features only available in iPhone SDK 3.0 and later.\"\n#endif\n\n#ifdef __OBJC__\n    #import <UIKit/UIKit.h>\n    #import <Foundation/Foundation.h>\n#endif\n"
  },
  {
    "path": "RSColorPicker/RSColorPickerAppDelegate.h",
    "content": "//\n//  RSColorPickerAppDelegate.h\n//  RSColorPicker\n//\n//  Created by Ryan Sullivan on 8/12/11.\n//\n\n#import <UIKit/UIKit.h>\n#import \"TestColorViewController.h\"\n\n@interface RSColorPickerAppDelegate : NSObject <UIApplicationDelegate>\n\n@property (nonatomic, strong) UIWindow *window;\n\n@end\n"
  },
  {
    "path": "RSColorPicker/RSColorPickerAppDelegate.m",
    "content": "//\n//  RSColorPickerAppDelegate.m\n//  RSColorPicker\n//\n//  Created by Ryan Sullivan on 8/12/11.\n//\n\n#import \"RSColorPickerAppDelegate.h\"\n#import \"RSColorPickerView.h\"\n\n@implementation RSColorPickerAppDelegate\n\n@synthesize window=_window;\n\n- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {\n    // Setup root controller as color\n    TestColorViewController *rootController = [[TestColorViewController alloc] initWithNibName:nil bundle:nil];\n\n    // Then add it to a nav controller so we can experiment with pushing\n    UINavigationController *navController = [[UINavigationController alloc] initWithRootViewController:rootController];\n\n    // Add navigation to our window\n    self.window = [[UIWindow alloc] initWithFrame:[UIScreen mainScreen].bounds];\n    self.window.rootViewController = navController;\n\n    // Show the window\n    [self.window makeKeyAndVisible];\n    return YES;\n}\n\n@end\n"
  },
  {
    "path": "RSColorPicker/RSOpacitySlider.h",
    "content": "//\n//  RSOpacitySlider.h\n//  RSColorPicker\n//\n//  Created by Jared Allen on 5/16/13.\n//  Copyright (c) 2013 Red Cactus LLC. All rights reserved.\n//\n\n#import <Foundation/Foundation.h>\n#import \"RSColorPickerView.h\"\n\n@interface RSOpacitySlider : UISlider\n\n@property (nonatomic) RSColorPickerView *colorPicker;\n\n@end\n"
  },
  {
    "path": "RSColorPicker/RSOpacitySlider.m",
    "content": "//\n//  RSOpacitySlider.m\n//  RSColorPicker\n//\n//  Created by Jared Allen on 5/16/13.\n//  Copyright (c) 2013 Red Cactus LLC. All rights reserved.\n//\n\n#import \"RSOpacitySlider.h\"\n\n#import \"RSColorFunctions.h\"\n\n@implementation RSOpacitySlider\n\n- (id)initWithFrame:(CGRect)frame {\n    self = [super initWithFrame:frame];\n    if (self) {\n        [self initRoutine];\n    }\n    return self;\n}\n\n- (id)initWithCoder:(NSCoder *)aDecoder {\n    self = [super initWithCoder:aDecoder];\n    if (self) {\n        [self initRoutine];\n    }\n    return self;\n}\n\n- (void)initRoutine {\n    self.minimumValue = 0.0;\n    self.maximumValue = 1.0;\n    self.continuous = YES;\n\n    self.enabled = YES;\n    self.userInteractionEnabled = YES;\n\n    [self addTarget:self action:@selector(myValueChanged:) forControlEvents:UIControlEventValueChanged];\n}\n\n-  (void)didMoveToWindow {\n    if (!self.window) return;\n\n    UIImage *backgroundImage = RSOpacityBackgroundImage(16.f, self.window.screen.scale, [UIColor colorWithWhite:0.5 alpha:1.0]);\n    self.backgroundColor = [UIColor colorWithPatternImage:backgroundImage];\n}\n\n- (void)myValueChanged:(id)notif {\n    _colorPicker.opacity = self.value;\n}\n\n- (void)drawRect:(CGRect)rect {\n    CGContextRef ctx = UIGraphicsGetCurrentContext();\n\n    CGColorSpaceRef space = CGColorSpaceCreateDeviceGray();\n    NSArray *colors = [[NSArray alloc] initWithObjects:\n                       (id)[UIColor colorWithWhite:0 alpha:0].CGColor,\n                       (id)[UIColor colorWithWhite:1 alpha:1].CGColor,nil];\n\n    CGGradientRef myGradient = CGGradientCreateWithColors(space, (__bridge CFArrayRef)colors, NULL);\n\n    CGContextDrawLinearGradient(ctx, myGradient, CGPointZero, CGPointMake(rect.size.width, 0), 0);\n    CGGradientRelease(myGradient);\n    CGColorSpaceRelease(space);\n}\n\n- (void)setColorPicker:(RSColorPickerView *)cp {\n    _colorPicker = cp;\n    if (!_colorPicker) { return; }\n    self.value = [_colorPicker brightness];\n}\n\n@end\n"
  },
  {
    "path": "RSColorPicker/TestColorViewController.h",
    "content": "//\n//  TestColorViewController.h\n//  RSColorPicker\n//\n//  Created by Ryan Sullivan on 7/14/13.\n//\n\n#import <UIKit/UIKit.h>\n#import \"ColorPickerClasses/RSColorPickerView.h\"\n#import \"ColorPickerClasses/RSColorFunctions.h\"\n\n@class RSBrightnessSlider;\n@class RSOpacitySlider;\n\n@interface TestColorViewController : UIViewController <RSColorPickerViewDelegate> {\n    BOOL isSmallSize;\n}\n\n@property (nonatomic) RSColorPickerView *colorPicker;\n@property (nonatomic) RSBrightnessSlider *brightnessSlider;\n@property (nonatomic) RSOpacitySlider *opacitySlider;\n@property (nonatomic) UIView *colorPatch;\n\n@property UILabel *rgbLabel;\n\n@end\n"
  },
  {
    "path": "RSColorPicker/TestColorViewController.m",
    "content": "//\n//  TestColorViewController.m\n//  RSColorPicker\n//\n//  Created by Ryan Sullivan on 7/14/13.\n//\n\n#import \"TestColorViewController.h\"\n#import \"RSBrightnessSlider.h\"\n#import \"RSOpacitySlider.h\"\n\n@implementation TestColorViewController\n\n- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil {\n    self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];\n    if (self) {\n        // Custom initialization\n    }\n    return self;\n}\n\n- (void)viewDidLoad {\n    [super viewDidLoad];\n\n    self.view.backgroundColor = RSRandomColorOpaque(YES);\n\n    self.navigationController.navigationBar.translucent = NO;\n    self.navigationItem.rightBarButtonItem = [[UIBarButtonItem alloc] initWithTitle:@\"Push\" style:UIBarButtonItemStyleBordered\n                                                                             target:self action:@selector(pushNext:)];\n\n    // View that displays color picker (needs to be square)\n    _colorPicker = [[RSColorPickerView alloc] initWithFrame:CGRectMake(20.0, 10.0, 280.0, 280.0)];\n\n    // Optionally set and force the picker to only draw a circle\n\t//    [_colorPicker setCropToCircle:YES]; // Defaults to NO (you can set BG color)\n\n    // Set the selection color - useful to present when the user had picked a color previously\n    [_colorPicker setSelectionColor:RSRandomColorOpaque(YES)];\n\n\t//    [_colorPicker setSelectionColor:[UIColor colorWithRed:1 green:0 blue:0.752941 alpha:1.000000]];\n\t//    [_colorPicker setSelection:CGPointMake(269, 269)];\n\n    // Set the delegate to receive events\n    [_colorPicker setDelegate:self];\n\n    [self.view addSubview:_colorPicker];\n\n\n    // On/off circle or square\n    UISwitch *circleSwitch = [[UISwitch alloc] initWithFrame:CGRectMake(10, 340, 0, 0)];\n    [circleSwitch setOn:_colorPicker.cropToCircle];\n    [circleSwitch addTarget:self action:@selector(circleSwitchAction:) forControlEvents:UIControlEventValueChanged];\n    [self.view addSubview:circleSwitch];\n\n    // View that controls brightness\n    _brightnessSlider = [[RSBrightnessSlider alloc] initWithFrame:CGRectMake(CGRectGetMaxX(circleSwitch.frame) + 4, 300.0, 320 - (20 + CGRectGetWidth(circleSwitch.frame)), 30.0)];\n    [_brightnessSlider setColorPicker:_colorPicker];\n    [self.view addSubview:_brightnessSlider];\n\n    // View that controls opacity\n    _opacitySlider = [[RSOpacitySlider alloc] initWithFrame:CGRectMake(CGRectGetMaxX(circleSwitch.frame) + 4, 340.0, 320 - (20 + CGRectGetWidth(circleSwitch.frame)), 30.0)];\n    [_opacitySlider setColorPicker:_colorPicker];\n    [self.view addSubview:_opacitySlider];\n\n\n    // View that shows selected color\n    _colorPatch = [[UIView alloc] initWithFrame:CGRectMake(160, 380.0, 150, 30.0)];\n    [self.view addSubview:_colorPatch];\n\n\n    // Buttons for testing\n    UIButton *selectRed = [UIButton buttonWithType:UIButtonTypeRoundedRect];\n    selectRed.frame = CGRectMake(10.0, 380.0, 30.0, 30.0);\n    [selectRed setTitle:@\"R\" forState:UIControlStateNormal];\n    [selectRed addTarget:self action:@selector(selectRed:) forControlEvents:UIControlEventTouchUpInside];\n    [self.view addSubview:selectRed];\n\n    UIButton *selectGreen = [UIButton buttonWithType:UIButtonTypeRoundedRect];\n    selectGreen.frame = CGRectMake(50.0, 380.0, 30.0, 30.0);\n    [selectGreen setTitle:@\"G\" forState:UIControlStateNormal];\n    [selectGreen addTarget:self action:@selector(selectGreen:) forControlEvents:UIControlEventTouchUpInside];\n    [self.view addSubview:selectGreen];\n\n    UIButton *selectBlue = [UIButton buttonWithType:UIButtonTypeRoundedRect];\n    selectBlue.frame = CGRectMake(90.0, 380.0, 30.0, 30.0);\n    [selectBlue setTitle:@\"B\" forState:UIControlStateNormal];\n    [selectBlue addTarget:self action:@selector(selectBlue:) forControlEvents:UIControlEventTouchUpInside];\n    [self.view addSubview:selectBlue];\n\n    UIButton *selectBlack = [UIButton buttonWithType:UIButtonTypeRoundedRect];\n    selectBlack.frame = CGRectMake(10, 420.0, 50.0, 30.0);\n    [selectBlack setTitle:@\"Black\" forState:UIControlStateNormal];\n    [selectBlack addTarget:self action:@selector(selectBlack:) forControlEvents:UIControlEventTouchUpInside];\n    [self.view addSubview:selectBlack];\n\n    UIButton *selectWhite = [UIButton buttonWithType:UIButtonTypeRoundedRect];\n    selectWhite.frame = CGRectMake(CGRectGetMaxX(selectBlack.frame) + 10, 420.0, 50.0, 30.0);\n    [selectWhite setTitle:@\"White\" forState:UIControlStateNormal];\n    [selectWhite addTarget:self action:@selector(selectWhite:) forControlEvents:UIControlEventTouchUpInside];\n    [self.view addSubview:selectWhite];\n\n    UIButton *selectPurple = [UIButton buttonWithType:UIButtonTypeRoundedRect];\n    selectPurple.frame = CGRectMake(CGRectGetMaxX(selectWhite.frame) + 10, 420.0, 50.0, 30.0);\n    [selectPurple setTitle:@\"Purple\" forState:UIControlStateNormal];\n    [selectPurple addTarget:self action:@selector(selectPurple:) forControlEvents:UIControlEventTouchUpInside];\n    [self.view addSubview:selectPurple];\n\n    UIButton *selectCyan = [UIButton buttonWithType:UIButtonTypeRoundedRect];\n    selectCyan.frame = CGRectMake(CGRectGetMaxX(selectPurple.frame) + 10, 420.0, 50.0, 30.0);\n    [selectCyan setTitle:@\"Cyan\" forState:UIControlStateNormal];\n    [selectCyan addTarget:self action:@selector(selectCyan:) forControlEvents:UIControlEventTouchUpInside];\n    [self.view addSubview:selectCyan];\n\n    UIButton *resizeButton = [UIButton buttonWithType:UIButtonTypeRoundedRect];\n    resizeButton.frame = CGRectMake(10, CGRectGetMaxY(selectCyan.frame) + 5, 50, 30);\n    [resizeButton setTitle:@\"Resize\" forState:UIControlStateNormal];\n    [resizeButton addTarget:self action:@selector(testResize:) forControlEvents:UIControlEventTouchUpInside];\n    [self.view addSubview:resizeButton];\n\n    UIButton *loupButton = [UIButton buttonWithType:UIButtonTypeRoundedRect];\n    loupButton.frame = CGRectMake(CGRectGetMaxX(resizeButton.frame) + 10, CGRectGetMinY(resizeButton.frame), 50, 30);\n    [loupButton setTitle:@\"Loup\" forState:UIControlStateNormal];\n    [loupButton addTarget:self action:@selector(testLoup:) forControlEvents:UIControlEventTouchUpInside];\n    [self.view addSubview:loupButton];\n\n    _rgbLabel = [[UILabel alloc] initWithFrame:CGRectMake(CGRectGetMaxX(loupButton.frame) + 10, CGRectGetMinY(loupButton.frame), 180, 30)];\n    _rgbLabel.text = @\"RGB\";\n    _rgbLabel.font = [UIFont systemFontOfSize:[UIFont systemFontSize]];\n    [self.view addSubview:_rgbLabel];\n}\n\n#pragma mark - RSColorPickerView delegate methods\n\n- (void)colorPickerDidChangeSelection:(RSColorPickerView *)cp {\n\n    // Get color data\n    UIColor *color = [cp selectionColor];\n\n    CGFloat r, g, b, a;\n    [[cp selectionColor] getRed:&r green:&g blue:&b alpha:&a];\n\n    // Update important UI\n    _colorPatch.backgroundColor = color;\n    _brightnessSlider.value = [cp brightness];\n    _opacitySlider.value = [cp opacity];\n\n\n    // Debug\n    NSString *colorDesc = [NSString stringWithFormat:@\"rgba: %f, %f, %f, %f\", r, g, b, a];\n    NSLog(@\"%@\", colorDesc);\n    int ir = r * 255;\n    int ig = g * 255;\n    int ib = b * 255;\n    int ia = a * 255;\n    colorDesc = [NSString stringWithFormat:@\"rgba: %d, %d, %d, %d\", ir, ig, ib, ia];\n    NSLog(@\"%@\", colorDesc);\n    _rgbLabel.text = colorDesc;\n\n    NSLog(@\"%@\", NSStringFromCGPoint(cp.selection));\n}\n\n#pragma mark - User action\n\n- (void)testResize:(id)sender {\n    if (isSmallSize) {\n        _colorPicker.frame = CGRectMake(20.0, 10.0, 280.0, 280.0);\n        isSmallSize = NO;\n    } else {\n        _colorPicker.frame = CGRectMake(40.0, 10.0, 240.0, 240.0);\n        isSmallSize = YES;\n    }\n}\n\n- (void)testLoup:(id)sender {\n    if (_colorPicker.showLoupe) {\n        _colorPicker.showLoupe = NO;\n    } else {\n        _colorPicker.showLoupe = YES;\n    }\n}\n\n- (void)selectRed:(id)sender {\n    [_colorPicker setSelectionColor:[UIColor redColor]];\n}\n- (void)selectGreen:(id)sender {\n    [_colorPicker setSelectionColor:[UIColor greenColor]];\n}\n- (void)selectBlue:(id)sender {\n    [_colorPicker setSelectionColor:[UIColor blueColor]];\n}\n- (void)selectBlack:(id)sender {\n    [_colorPicker setSelectionColor:[UIColor blackColor]];\n}\n- (void)selectWhite:(id)sender {\n    [_colorPicker setSelectionColor:[UIColor whiteColor]];\n}\n- (void)selectPurple:(id)sender {\n    [_colorPicker setSelectionColor:[UIColor purpleColor]];\n}\n- (void)selectCyan:(id)sender {\n    [_colorPicker setSelectionColor:[UIColor cyanColor]];\n}\n\n- (void)circleSwitchAction:(UISwitch *)s {\n    _colorPicker.cropToCircle = s.isOn;\n}\n\n#pragma mark - Push the stack\n\n- (void)pushNext:(id)sender {\n    TestColorViewController *colorController = [[TestColorViewController alloc] initWithNibName:nil bundle:nil];\n    [self.navigationController pushViewController:colorController animated:YES];\n}\n\n#pragma mark - Generated methods\n\n- (void)didReceiveMemoryWarning {\n    [super didReceiveMemoryWarning];\n    // Dispose of any resources that can be recreated.\n}\n\n@end\n"
  },
  {
    "path": "RSColorPicker/en.lproj/InfoPlist.strings",
    "content": "/* Localized versions of Info.plist keys */\n\n"
  },
  {
    "path": "RSColorPicker/main.m",
    "content": "//\n//  main.m\n//  RSColorPicker\n//\n//  Created by Ryan Sullivan on 8/12/11.\n//\n\n#import <UIKit/UIKit.h>\n#import \"RSColorPickerAppDelegate.h\"\n\nint main(int argc, char *argv[])\n{\n    @autoreleasepool {\n        return UIApplicationMain(argc, argv, nil, NSStringFromClass(RSColorPickerAppDelegate.class));\n    }\n}\n"
  },
  {
    "path": "RSColorPicker.podspec",
    "content": "Pod::Spec.new do |s|\n  s.name         = \"RSColorPicker\"\n  s.version      = \"0.9.2\"\n  s.summary      = \"iOS color picker view\"\n  s.description  = \"iOS color picker view with brightness control, opacity control, and delegation support.\"\n  s.homepage     = \"https://github.com/RSully/RSColorPicker\"\n  s.screenshots  = \"https://raw.github.com/RSully/RSColorPicker/v0.9.2/Example01.png\", \"https://raw.github.com/RSully/RSColorPicker/v0.9.2/Example02.png\", \"https://raw.github.com/RSully/RSColorPicker/v0.9.2/Example03.png\", \"https://raw.github.com/RSully/RSColorPicker/v0.9.2/Example04.png\", \"https://raw.github.com/RSully/RSColorPicker/v0.9.2/Example05.png\"\n  s.license      = { :type => 'BSD', :file => \"LICENSE.md\" }\n  s.author       = { \"Ryan\" => \"rsul.dev@me.com\" }\n  s.source       = { :git => \"https://github.com/RSully/RSColorPicker.git\", :tag => \"v0.9.2\" }\n  s.platform     = :ios, '6.0'\n  s.source_files = 'RSColorPicker/ColorPickerClasses/**/*.{h,m}'\n  s.frameworks   = 'QuartzCore', 'CoreGraphics', 'UIKit', 'Accelerate'\n  s.requires_arc = true\n\n  s.public_header_files = \"RSColorPicker/ColorPickerClasses/RSColorPickerView.h\"\nend\n"
  },
  {
    "path": "RSColorPicker.xcodeproj/project.pbxproj",
    "content": "// !$*UTF8*$!\n{\n\tarchiveVersion = 1;\n\tclasses = {\n\t};\n\tobjectVersion = 46;\n\tobjects = {\n\n/* Begin PBXBuildFile section */\n\t\t1FA35E6013F57B2700A6B347 /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1FA35E5F13F57B2700A6B347 /* UIKit.framework */; };\n\t\t1FA35E6213F57B2700A6B347 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1FA35E6113F57B2700A6B347 /* Foundation.framework */; };\n\t\t1FA35E6413F57B2700A6B347 /* CoreGraphics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1FA35E6313F57B2700A6B347 /* CoreGraphics.framework */; };\n\t\t1FA35E6A13F57B2800A6B347 /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 1FA35E6813F57B2800A6B347 /* InfoPlist.strings */; };\n\t\t1FA35E6D13F57B2800A6B347 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 1FA35E6C13F57B2800A6B347 /* main.m */; };\n\t\t1FA35E7013F57B2800A6B347 /* RSColorPickerAppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 1FA35E6F13F57B2800A6B347 /* RSColorPickerAppDelegate.m */; };\n\t\t1FA35E9913F5A17E00A6B347 /* QuartzCore.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1FA35E9813F5A17E00A6B347 /* QuartzCore.framework */; };\n\t\t2B12A0DF1792FF46007F2A0A /* TestColorViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 2B12A0DE1792FF46007F2A0A /* TestColorViewController.m */; };\n\t\t2B78462718D290340002F859 /* CPTestCase.m in Sources */ = {isa = PBXBuildFile; fileRef = 2B78462618D290340002F859 /* CPTestCase.m */; };\n\t\t2B78462918D298570002F859 /* CPTestCaseTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 2B78462818D298570002F859 /* CPTestCaseTests.m */; };\n\t\t2B85423116EFC8970047FFBE /* ANImageBitmapRep.m in Sources */ = {isa = PBXBuildFile; fileRef = 2B85420D16EFC8970047FFBE /* ANImageBitmapRep.m */; };\n\t\t2B85423216EFC8970047FFBE /* BitmapContextRep.m in Sources */ = {isa = PBXBuildFile; fileRef = 2B85420F16EFC8970047FFBE /* BitmapContextRep.m */; };\n\t\t2B85423316EFC8970047FFBE /* NSImage+ANImageBitmapRep.m in Sources */ = {isa = PBXBuildFile; fileRef = 2B85421216EFC8970047FFBE /* NSImage+ANImageBitmapRep.m */; };\n\t\t2B85423416EFC8970047FFBE /* OSCommonImage.m in Sources */ = {isa = PBXBuildFile; fileRef = 2B85421416EFC8970047FFBE /* OSCommonImage.m */; };\n\t\t2B85423516EFC8970047FFBE /* UIImage+ANImageBitmapRep.m in Sources */ = {isa = PBXBuildFile; fileRef = 2B85421616EFC8970047FFBE /* UIImage+ANImageBitmapRep.m */; };\n\t\t2B85423616EFC8970047FFBE /* CGContextCreator.m in Sources */ = {isa = PBXBuildFile; fileRef = 2B85421916EFC8970047FFBE /* CGContextCreator.m */; };\n\t\t2B85423716EFC8970047FFBE /* CGImageContainer.m in Sources */ = {isa = PBXBuildFile; fileRef = 2B85421B16EFC8970047FFBE /* CGImageContainer.m */; };\n\t\t2B85423816EFC8970047FFBE /* BitmapContextManipulator.m in Sources */ = {isa = PBXBuildFile; fileRef = 2B85421E16EFC8970047FFBE /* BitmapContextManipulator.m */; };\n\t\t2B85423916EFC8970047FFBE /* BitmapCropManipulator.m in Sources */ = {isa = PBXBuildFile; fileRef = 2B85422016EFC8970047FFBE /* BitmapCropManipulator.m */; };\n\t\t2B85423A16EFC8970047FFBE /* BitmapDrawManipulator.m in Sources */ = {isa = PBXBuildFile; fileRef = 2B85422216EFC8970047FFBE /* BitmapDrawManipulator.m */; };\n\t\t2B85423B16EFC8970047FFBE /* BitmapRotationManipulator.m in Sources */ = {isa = PBXBuildFile; fileRef = 2B85422416EFC8970047FFBE /* BitmapRotationManipulator.m */; };\n\t\t2B85423C16EFC8970047FFBE /* BitmapScaleManipulator.m in Sources */ = {isa = PBXBuildFile; fileRef = 2B85422616EFC8970047FFBE /* BitmapScaleManipulator.m */; };\n\t\t2B85423D16EFC8970047FFBE /* BGRSLoupeLayer.m in Sources */ = {isa = PBXBuildFile; fileRef = 2B85422816EFC8970047FFBE /* BGRSLoupeLayer.m */; };\n\t\t2B85423F16EFC8970047FFBE /* RSColorFunctions.m in Sources */ = {isa = PBXBuildFile; fileRef = 2B85422C16EFC8970047FFBE /* RSColorFunctions.m */; };\n\t\t2B85424016EFC8970047FFBE /* RSColorPickerView.m in Sources */ = {isa = PBXBuildFile; fileRef = 2B85422E16EFC8970047FFBE /* RSColorPickerView.m */; };\n\t\t2B85424116EFC8970047FFBE /* RSSelectionLayer.m in Sources */ = {isa = PBXBuildFile; fileRef = 2B85423016EFC8970047FFBE /* RSSelectionLayer.m */; };\n\t\t2B989DF318D61F760049D521 /* RSColorFunctionsTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 2B989DF218D61F760049D521 /* RSColorFunctionsTests.m */; };\n\t\t2BF47AD318D4D44600C12FA5 /* RSColorPickerViewDelegateTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 2BF47AD218D4D44600C12FA5 /* RSColorPickerViewDelegateTests.m */; };\n\t\t2BF8BFF818E9B67600E7C5BF /* RSColorPickerStateTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 2BF8BFF718E9B67600E7C5BF /* RSColorPickerStateTests.m */; };\n\t\t2BFBDBDA18D2574400DFC1E5 /* XCTest.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 2BFBDBD918D2574400DFC1E5 /* XCTest.framework */; };\n\t\t2BFBDBDB18D2574400DFC1E5 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1FA35E6113F57B2700A6B347 /* Foundation.framework */; };\n\t\t2BFBDBDC18D2574400DFC1E5 /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1FA35E5F13F57B2700A6B347 /* UIKit.framework */; };\n\t\t2BFBDBE218D2574400DFC1E5 /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 2BFBDBE018D2574400DFC1E5 /* InfoPlist.strings */; };\n\t\t2BFBDBE418D2574400DFC1E5 /* RSColorPickerViewTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 2BFBDBE318D2574400DFC1E5 /* RSColorPickerViewTests.m */; };\n\t\t930D5A8016DE4D36006C38D4 /* Default-568h@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 930D5A7F16DE4D36006C38D4 /* Default-568h@2x.png */; };\n\t\t94A10AFB1799B6A900F0BD7E /* Accelerate.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 94A10AFA1799B6A900F0BD7E /* Accelerate.framework */; };\n\t\t94A10AFF179DB67C00F0BD7E /* RSGenerateOperation.m in Sources */ = {isa = PBXBuildFile; fileRef = 94A10AFE179DB67C00F0BD7E /* RSGenerateOperation.m */; };\n\t\tFA5AA0EA185F6477000355FE /* RSBrightnessSlider.m in Sources */ = {isa = PBXBuildFile; fileRef = FA5AA0E7185F6477000355FE /* RSBrightnessSlider.m */; };\n\t\tFA5AA0EB185F6477000355FE /* RSOpacitySlider.m in Sources */ = {isa = PBXBuildFile; fileRef = FA5AA0E9185F6477000355FE /* RSOpacitySlider.m */; };\n\t\tFAFF6E4C185F84BD00412D58 /* RSColorPickerState.m in Sources */ = {isa = PBXBuildFile; fileRef = FAFF6E4B185F84BD00412D58 /* RSColorPickerState.m */; };\n/* End PBXBuildFile section */\n\n/* Begin PBXContainerItemProxy section */\n\t\t2BFBDBE618D2574400DFC1E5 /* PBXContainerItemProxy */ = {\n\t\t\tisa = PBXContainerItemProxy;\n\t\t\tcontainerPortal = 1FA35E5213F57B2700A6B347 /* Project object */;\n\t\t\tproxyType = 1;\n\t\t\tremoteGlobalIDString = 1FA35E5A13F57B2700A6B347;\n\t\t\tremoteInfo = RSColorPicker;\n\t\t};\n/* End PBXContainerItemProxy section */\n\n/* Begin PBXFileReference section */\n\t\t1FA35E5B13F57B2700A6B347 /* RSColorPicker.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = RSColorPicker.app; sourceTree = BUILT_PRODUCTS_DIR; };\n\t\t1FA35E5F13F57B2700A6B347 /* UIKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = UIKit.framework; path = System/Library/Frameworks/UIKit.framework; sourceTree = SDKROOT; };\n\t\t1FA35E6113F57B2700A6B347 /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; };\n\t\t1FA35E6313F57B2700A6B347 /* CoreGraphics.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreGraphics.framework; path = System/Library/Frameworks/CoreGraphics.framework; sourceTree = SDKROOT; };\n\t\t1FA35E6713F57B2700A6B347 /* RSColorPicker-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = \"RSColorPicker-Info.plist\"; sourceTree = \"<group>\"; };\n\t\t1FA35E6913F57B2800A6B347 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = \"<group>\"; };\n\t\t1FA35E6B13F57B2800A6B347 /* RSColorPicker-Prefix.pch */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = \"RSColorPicker-Prefix.pch\"; sourceTree = \"<group>\"; };\n\t\t1FA35E6C13F57B2800A6B347 /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = \"<group>\"; };\n\t\t1FA35E6E13F57B2800A6B347 /* RSColorPickerAppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = RSColorPickerAppDelegate.h; sourceTree = \"<group>\"; };\n\t\t1FA35E6F13F57B2800A6B347 /* RSColorPickerAppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = RSColorPickerAppDelegate.m; sourceTree = \"<group>\"; };\n\t\t1FA35E9813F5A17E00A6B347 /* QuartzCore.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = QuartzCore.framework; path = System/Library/Frameworks/QuartzCore.framework; sourceTree = SDKROOT; };\n\t\t2B12A0DD1792FF46007F2A0A /* TestColorViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TestColorViewController.h; sourceTree = \"<group>\"; };\n\t\t2B12A0DE1792FF46007F2A0A /* TestColorViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = TestColorViewController.m; sourceTree = \"<group>\"; };\n\t\t2B78462518D290340002F859 /* CPTestCase.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CPTestCase.h; sourceTree = \"<group>\"; };\n\t\t2B78462618D290340002F859 /* CPTestCase.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CPTestCase.m; sourceTree = \"<group>\"; };\n\t\t2B78462818D298570002F859 /* CPTestCaseTests.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CPTestCaseTests.m; sourceTree = \"<group>\"; };\n\t\t2B85420C16EFC8970047FFBE /* ANImageBitmapRep.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ANImageBitmapRep.h; sourceTree = \"<group>\"; };\n\t\t2B85420D16EFC8970047FFBE /* ANImageBitmapRep.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ANImageBitmapRep.m; sourceTree = \"<group>\"; };\n\t\t2B85420E16EFC8970047FFBE /* BitmapContextRep.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = BitmapContextRep.h; sourceTree = \"<group>\"; };\n\t\t2B85420F16EFC8970047FFBE /* BitmapContextRep.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = BitmapContextRep.m; sourceTree = \"<group>\"; };\n\t\t2B85421116EFC8970047FFBE /* NSImage+ANImageBitmapRep.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = \"NSImage+ANImageBitmapRep.h\"; sourceTree = \"<group>\"; };\n\t\t2B85421216EFC8970047FFBE /* NSImage+ANImageBitmapRep.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = \"NSImage+ANImageBitmapRep.m\"; sourceTree = \"<group>\"; };\n\t\t2B85421316EFC8970047FFBE /* OSCommonImage.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = OSCommonImage.h; sourceTree = \"<group>\"; };\n\t\t2B85421416EFC8970047FFBE /* OSCommonImage.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = OSCommonImage.m; sourceTree = \"<group>\"; };\n\t\t2B85421516EFC8970047FFBE /* UIImage+ANImageBitmapRep.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = \"UIImage+ANImageBitmapRep.h\"; sourceTree = \"<group>\"; };\n\t\t2B85421616EFC8970047FFBE /* UIImage+ANImageBitmapRep.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = \"UIImage+ANImageBitmapRep.m\"; sourceTree = \"<group>\"; };\n\t\t2B85421816EFC8970047FFBE /* CGContextCreator.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CGContextCreator.h; sourceTree = \"<group>\"; };\n\t\t2B85421916EFC8970047FFBE /* CGContextCreator.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CGContextCreator.m; sourceTree = \"<group>\"; };\n\t\t2B85421A16EFC8970047FFBE /* CGImageContainer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CGImageContainer.h; sourceTree = \"<group>\"; };\n\t\t2B85421B16EFC8970047FFBE /* CGImageContainer.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CGImageContainer.m; sourceTree = \"<group>\"; };\n\t\t2B85421D16EFC8970047FFBE /* BitmapContextManipulator.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = BitmapContextManipulator.h; sourceTree = \"<group>\"; };\n\t\t2B85421E16EFC8970047FFBE /* BitmapContextManipulator.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = BitmapContextManipulator.m; sourceTree = \"<group>\"; };\n\t\t2B85421F16EFC8970047FFBE /* BitmapCropManipulator.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = BitmapCropManipulator.h; sourceTree = \"<group>\"; };\n\t\t2B85422016EFC8970047FFBE /* BitmapCropManipulator.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = BitmapCropManipulator.m; sourceTree = \"<group>\"; };\n\t\t2B85422116EFC8970047FFBE /* BitmapDrawManipulator.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = BitmapDrawManipulator.h; sourceTree = \"<group>\"; };\n\t\t2B85422216EFC8970047FFBE /* BitmapDrawManipulator.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = BitmapDrawManipulator.m; sourceTree = \"<group>\"; };\n\t\t2B85422316EFC8970047FFBE /* BitmapRotationManipulator.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = BitmapRotationManipulator.h; sourceTree = \"<group>\"; };\n\t\t2B85422416EFC8970047FFBE /* BitmapRotationManipulator.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = BitmapRotationManipulator.m; sourceTree = \"<group>\"; };\n\t\t2B85422516EFC8970047FFBE /* BitmapScaleManipulator.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = BitmapScaleManipulator.h; sourceTree = \"<group>\"; };\n\t\t2B85422616EFC8970047FFBE /* BitmapScaleManipulator.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = BitmapScaleManipulator.m; sourceTree = \"<group>\"; };\n\t\t2B85422716EFC8970047FFBE /* BGRSLoupeLayer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = BGRSLoupeLayer.h; sourceTree = \"<group>\"; };\n\t\t2B85422816EFC8970047FFBE /* BGRSLoupeLayer.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = BGRSLoupeLayer.m; sourceTree = \"<group>\"; };\n\t\t2B85422B16EFC8970047FFBE /* RSColorFunctions.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RSColorFunctions.h; sourceTree = \"<group>\"; };\n\t\t2B85422C16EFC8970047FFBE /* RSColorFunctions.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RSColorFunctions.m; sourceTree = \"<group>\"; };\n\t\t2B85422D16EFC8970047FFBE /* RSColorPickerView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RSColorPickerView.h; sourceTree = \"<group>\"; };\n\t\t2B85422E16EFC8970047FFBE /* RSColorPickerView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RSColorPickerView.m; sourceTree = \"<group>\"; };\n\t\t2B85422F16EFC8970047FFBE /* RSSelectionLayer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RSSelectionLayer.h; sourceTree = \"<group>\"; };\n\t\t2B85423016EFC8970047FFBE /* RSSelectionLayer.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RSSelectionLayer.m; sourceTree = \"<group>\"; };\n\t\t2B989DF218D61F760049D521 /* RSColorFunctionsTests.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RSColorFunctionsTests.m; sourceTree = \"<group>\"; };\n\t\t2BF47AD218D4D44600C12FA5 /* RSColorPickerViewDelegateTests.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RSColorPickerViewDelegateTests.m; sourceTree = \"<group>\"; };\n\t\t2BF8BFF718E9B67600E7C5BF /* RSColorPickerStateTests.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RSColorPickerStateTests.m; sourceTree = \"<group>\"; };\n\t\t2BFBDBD818D2574400DFC1E5 /* RSColorPickerTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = RSColorPickerTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; };\n\t\t2BFBDBD918D2574400DFC1E5 /* XCTest.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = XCTest.framework; path = Library/Frameworks/XCTest.framework; sourceTree = DEVELOPER_DIR; };\n\t\t2BFBDBDF18D2574400DFC1E5 /* RSColorPickerTests-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = \"RSColorPickerTests-Info.plist\"; sourceTree = \"<group>\"; };\n\t\t2BFBDBE118D2574400DFC1E5 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = \"<group>\"; };\n\t\t2BFBDBE318D2574400DFC1E5 /* RSColorPickerViewTests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = RSColorPickerViewTests.m; sourceTree = \"<group>\"; };\n\t\t2BFBDBE518D2574400DFC1E5 /* RSColorPickerTests-Prefix.pch */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = \"RSColorPickerTests-Prefix.pch\"; sourceTree = \"<group>\"; };\n\t\t930D5A7F16DE4D36006C38D4 /* Default-568h@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = \"Default-568h@2x.png\"; sourceTree = \"<group>\"; };\n\t\t94A10AFA1799B6A900F0BD7E /* Accelerate.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Accelerate.framework; path = System/Library/Frameworks/Accelerate.framework; sourceTree = SDKROOT; };\n\t\t94A10AFD179DB67C00F0BD7E /* RSGenerateOperation.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RSGenerateOperation.h; sourceTree = \"<group>\"; };\n\t\t94A10AFE179DB67C00F0BD7E /* RSGenerateOperation.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RSGenerateOperation.m; sourceTree = \"<group>\"; };\n\t\tFA5AA0E6185F6477000355FE /* RSBrightnessSlider.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RSBrightnessSlider.h; sourceTree = \"<group>\"; };\n\t\tFA5AA0E7185F6477000355FE /* RSBrightnessSlider.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RSBrightnessSlider.m; sourceTree = \"<group>\"; };\n\t\tFA5AA0E8185F6477000355FE /* RSOpacitySlider.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RSOpacitySlider.h; sourceTree = \"<group>\"; };\n\t\tFA5AA0E9185F6477000355FE /* RSOpacitySlider.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RSOpacitySlider.m; sourceTree = \"<group>\"; };\n\t\tFAFF6E4A185F84BD00412D58 /* RSColorPickerState.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RSColorPickerState.h; sourceTree = \"<group>\"; };\n\t\tFAFF6E4B185F84BD00412D58 /* RSColorPickerState.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RSColorPickerState.m; sourceTree = \"<group>\"; };\n/* End PBXFileReference section */\n\n/* Begin PBXFrameworksBuildPhase section */\n\t\t1FA35E5813F57B2700A6B347 /* Frameworks */ = {\n\t\t\tisa = PBXFrameworksBuildPhase;\n\t\t\tbuildActionMask = 2147483647;\n\t\t\tfiles = (\n\t\t\t\t94A10AFB1799B6A900F0BD7E /* Accelerate.framework in Frameworks */,\n\t\t\t\t1FA35E9913F5A17E00A6B347 /* QuartzCore.framework in Frameworks */,\n\t\t\t\t1FA35E6013F57B2700A6B347 /* UIKit.framework in Frameworks */,\n\t\t\t\t1FA35E6213F57B2700A6B347 /* Foundation.framework in Frameworks */,\n\t\t\t\t1FA35E6413F57B2700A6B347 /* CoreGraphics.framework in Frameworks */,\n\t\t\t);\n\t\t\trunOnlyForDeploymentPostprocessing = 0;\n\t\t};\n\t\t2BFBDBD518D2574400DFC1E5 /* Frameworks */ = {\n\t\t\tisa = PBXFrameworksBuildPhase;\n\t\t\tbuildActionMask = 2147483647;\n\t\t\tfiles = (\n\t\t\t\t2BFBDBDA18D2574400DFC1E5 /* XCTest.framework in Frameworks */,\n\t\t\t\t2BFBDBDC18D2574400DFC1E5 /* UIKit.framework in Frameworks */,\n\t\t\t\t2BFBDBDB18D2574400DFC1E5 /* Foundation.framework in Frameworks */,\n\t\t\t);\n\t\t\trunOnlyForDeploymentPostprocessing = 0;\n\t\t};\n/* End PBXFrameworksBuildPhase section */\n\n/* Begin PBXGroup section */\n\t\t1FA35E5013F57B2700A6B347 = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\t930D5A7F16DE4D36006C38D4 /* Default-568h@2x.png */,\n\t\t\t\t1FA35E6513F57B2700A6B347 /* RSColorPicker */,\n\t\t\t\t2BFBDBDD18D2574400DFC1E5 /* RSColorPickerTests */,\n\t\t\t\t1FA35E5E13F57B2700A6B347 /* Frameworks */,\n\t\t\t\t1FA35E5C13F57B2700A6B347 /* Products */,\n\t\t\t);\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n\t\t1FA35E5C13F57B2700A6B347 /* Products */ = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\t1FA35E5B13F57B2700A6B347 /* RSColorPicker.app */,\n\t\t\t\t2BFBDBD818D2574400DFC1E5 /* RSColorPickerTests.xctest */,\n\t\t\t);\n\t\t\tname = Products;\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n\t\t1FA35E5E13F57B2700A6B347 /* Frameworks */ = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\t94A10AFA1799B6A900F0BD7E /* Accelerate.framework */,\n\t\t\t\t1FA35E9813F5A17E00A6B347 /* QuartzCore.framework */,\n\t\t\t\t1FA35E5F13F57B2700A6B347 /* UIKit.framework */,\n\t\t\t\t1FA35E6113F57B2700A6B347 /* Foundation.framework */,\n\t\t\t\t1FA35E6313F57B2700A6B347 /* CoreGraphics.framework */,\n\t\t\t\t2BFBDBD918D2574400DFC1E5 /* XCTest.framework */,\n\t\t\t);\n\t\t\tname = Frameworks;\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n\t\t1FA35E6513F57B2700A6B347 /* RSColorPicker */ = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\t1FA35E6E13F57B2800A6B347 /* RSColorPickerAppDelegate.h */,\n\t\t\t\t1FA35E6F13F57B2800A6B347 /* RSColorPickerAppDelegate.m */,\n\t\t\t\t2B12A0DD1792FF46007F2A0A /* TestColorViewController.h */,\n\t\t\t\t2B12A0DE1792FF46007F2A0A /* TestColorViewController.m */,\n\t\t\t\tFA5AA0E6185F6477000355FE /* RSBrightnessSlider.h */,\n\t\t\t\tFA5AA0E7185F6477000355FE /* RSBrightnessSlider.m */,\n\t\t\t\tFA5AA0E8185F6477000355FE /* RSOpacitySlider.h */,\n\t\t\t\tFA5AA0E9185F6477000355FE /* RSOpacitySlider.m */,\n\t\t\t\t2B85420A16EFC8970047FFBE /* ColorPickerClasses */,\n\t\t\t\t1FA35E6613F57B2700A6B347 /* Supporting Files */,\n\t\t\t);\n\t\t\tpath = RSColorPicker;\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n\t\t1FA35E6613F57B2700A6B347 /* Supporting Files */ = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\t1FA35E6713F57B2700A6B347 /* RSColorPicker-Info.plist */,\n\t\t\t\t1FA35E6813F57B2800A6B347 /* InfoPlist.strings */,\n\t\t\t\t1FA35E6B13F57B2800A6B347 /* RSColorPicker-Prefix.pch */,\n\t\t\t\t1FA35E6C13F57B2800A6B347 /* main.m */,\n\t\t\t);\n\t\t\tname = \"Supporting Files\";\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n\t\t2B85420A16EFC8970047FFBE /* ColorPickerClasses */ = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\t2B85420B16EFC8970047FFBE /* ANImageBitmapRep */,\n\t\t\t\t2B85422716EFC8970047FFBE /* BGRSLoupeLayer.h */,\n\t\t\t\t2B85422816EFC8970047FFBE /* BGRSLoupeLayer.m */,\n\t\t\t\t2B85422D16EFC8970047FFBE /* RSColorPickerView.h */,\n\t\t\t\t2B85422E16EFC8970047FFBE /* RSColorPickerView.m */,\n\t\t\t\t94A10AFC179DB66400F0BD7E /* Generation */,\n\t\t\t\t2B85422F16EFC8970047FFBE /* RSSelectionLayer.h */,\n\t\t\t\t2B85423016EFC8970047FFBE /* RSSelectionLayer.m */,\n\t\t\t\t2B85422B16EFC8970047FFBE /* RSColorFunctions.h */,\n\t\t\t\t2B85422C16EFC8970047FFBE /* RSColorFunctions.m */,\n\t\t\t\tFAFF6E4A185F84BD00412D58 /* RSColorPickerState.h */,\n\t\t\t\tFAFF6E4B185F84BD00412D58 /* RSColorPickerState.m */,\n\t\t\t);\n\t\t\tpath = ColorPickerClasses;\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n\t\t2B85420B16EFC8970047FFBE /* ANImageBitmapRep */ = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\t2B85420C16EFC8970047FFBE /* ANImageBitmapRep.h */,\n\t\t\t\t2B85420D16EFC8970047FFBE /* ANImageBitmapRep.m */,\n\t\t\t\t2B85420E16EFC8970047FFBE /* BitmapContextRep.h */,\n\t\t\t\t2B85420F16EFC8970047FFBE /* BitmapContextRep.m */,\n\t\t\t\t2B85421016EFC8970047FFBE /* Compatibility */,\n\t\t\t\t2B85421716EFC8970047FFBE /* CoreGraphics */,\n\t\t\t\t2B85421C16EFC8970047FFBE /* Manipulators */,\n\t\t\t);\n\t\t\tpath = ANImageBitmapRep;\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n\t\t2B85421016EFC8970047FFBE /* Compatibility */ = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\t2B85421116EFC8970047FFBE /* NSImage+ANImageBitmapRep.h */,\n\t\t\t\t2B85421216EFC8970047FFBE /* NSImage+ANImageBitmapRep.m */,\n\t\t\t\t2B85421316EFC8970047FFBE /* OSCommonImage.h */,\n\t\t\t\t2B85421416EFC8970047FFBE /* OSCommonImage.m */,\n\t\t\t\t2B85421516EFC8970047FFBE /* UIImage+ANImageBitmapRep.h */,\n\t\t\t\t2B85421616EFC8970047FFBE /* UIImage+ANImageBitmapRep.m */,\n\t\t\t);\n\t\t\tpath = Compatibility;\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n\t\t2B85421716EFC8970047FFBE /* CoreGraphics */ = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\t2B85421816EFC8970047FFBE /* CGContextCreator.h */,\n\t\t\t\t2B85421916EFC8970047FFBE /* CGContextCreator.m */,\n\t\t\t\t2B85421A16EFC8970047FFBE /* CGImageContainer.h */,\n\t\t\t\t2B85421B16EFC8970047FFBE /* CGImageContainer.m */,\n\t\t\t);\n\t\t\tpath = CoreGraphics;\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n\t\t2B85421C16EFC8970047FFBE /* Manipulators */ = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\t2B85421D16EFC8970047FFBE /* BitmapContextManipulator.h */,\n\t\t\t\t2B85421E16EFC8970047FFBE /* BitmapContextManipulator.m */,\n\t\t\t\t2B85421F16EFC8970047FFBE /* BitmapCropManipulator.h */,\n\t\t\t\t2B85422016EFC8970047FFBE /* BitmapCropManipulator.m */,\n\t\t\t\t2B85422116EFC8970047FFBE /* BitmapDrawManipulator.h */,\n\t\t\t\t2B85422216EFC8970047FFBE /* BitmapDrawManipulator.m */,\n\t\t\t\t2B85422316EFC8970047FFBE /* BitmapRotationManipulator.h */,\n\t\t\t\t2B85422416EFC8970047FFBE /* BitmapRotationManipulator.m */,\n\t\t\t\t2B85422516EFC8970047FFBE /* BitmapScaleManipulator.h */,\n\t\t\t\t2B85422616EFC8970047FFBE /* BitmapScaleManipulator.m */,\n\t\t\t);\n\t\t\tpath = Manipulators;\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n\t\t2BFBDBDD18D2574400DFC1E5 /* RSColorPickerTests */ = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\t2BF8BFF718E9B67600E7C5BF /* RSColorPickerStateTests.m */,\n\t\t\t\t2B989DF218D61F760049D521 /* RSColorFunctionsTests.m */,\n\t\t\t\t2BF47AD218D4D44600C12FA5 /* RSColorPickerViewDelegateTests.m */,\n\t\t\t\t2B78462818D298570002F859 /* CPTestCaseTests.m */,\n\t\t\t\t2BFBDBE318D2574400DFC1E5 /* RSColorPickerViewTests.m */,\n\t\t\t\t2BFBDBDE18D2574400DFC1E5 /* Supporting Files */,\n\t\t\t\t2B78462518D290340002F859 /* CPTestCase.h */,\n\t\t\t\t2B78462618D290340002F859 /* CPTestCase.m */,\n\t\t\t);\n\t\t\tpath = RSColorPickerTests;\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n\t\t2BFBDBDE18D2574400DFC1E5 /* Supporting Files */ = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\t2BFBDBDF18D2574400DFC1E5 /* RSColorPickerTests-Info.plist */,\n\t\t\t\t2BFBDBE018D2574400DFC1E5 /* InfoPlist.strings */,\n\t\t\t\t2BFBDBE518D2574400DFC1E5 /* RSColorPickerTests-Prefix.pch */,\n\t\t\t);\n\t\t\tname = \"Supporting Files\";\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n\t\t94A10AFC179DB66400F0BD7E /* Generation */ = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\t94A10AFD179DB67C00F0BD7E /* RSGenerateOperation.h */,\n\t\t\t\t94A10AFE179DB67C00F0BD7E /* RSGenerateOperation.m */,\n\t\t\t);\n\t\t\tname = Generation;\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n/* End PBXGroup section */\n\n/* Begin PBXNativeTarget section */\n\t\t1FA35E5A13F57B2700A6B347 /* RSColorPicker */ = {\n\t\t\tisa = PBXNativeTarget;\n\t\t\tbuildConfigurationList = 1FA35E7613F57B2800A6B347 /* Build configuration list for PBXNativeTarget \"RSColorPicker\" */;\n\t\t\tbuildPhases = (\n\t\t\t\t1FA35E5713F57B2700A6B347 /* Sources */,\n\t\t\t\t1FA35E5813F57B2700A6B347 /* Frameworks */,\n\t\t\t\t1FA35E5913F57B2700A6B347 /* Resources */,\n\t\t\t);\n\t\t\tbuildRules = (\n\t\t\t);\n\t\t\tdependencies = (\n\t\t\t);\n\t\t\tname = RSColorPicker;\n\t\t\tproductName = RSColorPicker;\n\t\t\tproductReference = 1FA35E5B13F57B2700A6B347 /* RSColorPicker.app */;\n\t\t\tproductType = \"com.apple.product-type.application\";\n\t\t};\n\t\t2BFBDBD718D2574400DFC1E5 /* RSColorPickerTests */ = {\n\t\t\tisa = PBXNativeTarget;\n\t\t\tbuildConfigurationList = 2BFBDBEA18D2574400DFC1E5 /* Build configuration list for PBXNativeTarget \"RSColorPickerTests\" */;\n\t\t\tbuildPhases = (\n\t\t\t\t2BFBDBD418D2574400DFC1E5 /* Sources */,\n\t\t\t\t2BFBDBD518D2574400DFC1E5 /* Frameworks */,\n\t\t\t\t2BFBDBD618D2574400DFC1E5 /* Resources */,\n\t\t\t);\n\t\t\tbuildRules = (\n\t\t\t);\n\t\t\tdependencies = (\n\t\t\t\t2BFBDBE718D2574400DFC1E5 /* PBXTargetDependency */,\n\t\t\t);\n\t\t\tname = RSColorPickerTests;\n\t\t\tproductName = RSColorPickerTests;\n\t\t\tproductReference = 2BFBDBD818D2574400DFC1E5 /* RSColorPickerTests.xctest */;\n\t\t\tproductType = \"com.apple.product-type.bundle.unit-test\";\n\t\t};\n/* End PBXNativeTarget section */\n\n/* Begin PBXProject section */\n\t\t1FA35E5213F57B2700A6B347 /* Project object */ = {\n\t\t\tisa = PBXProject;\n\t\t\tattributes = {\n\t\t\t\tCLASSPREFIX = RSCP;\n\t\t\t\tLastUpgradeCheck = 0500;\n\t\t\t\tORGANIZATIONNAME = \"\";\n\t\t\t\tTargetAttributes = {\n\t\t\t\t\t1FA35E5A13F57B2700A6B347 = {\n\t\t\t\t\t\tDevelopmentTeam = A5KAV3AMGE;\n\t\t\t\t\t};\n\t\t\t\t\t2BFBDBD718D2574400DFC1E5 = {\n\t\t\t\t\t\tTestTargetID = 1FA35E5A13F57B2700A6B347;\n\t\t\t\t\t};\n\t\t\t\t};\n\t\t\t};\n\t\t\tbuildConfigurationList = 1FA35E5513F57B2700A6B347 /* Build configuration list for PBXProject \"RSColorPicker\" */;\n\t\t\tcompatibilityVersion = \"Xcode 3.2\";\n\t\t\tdevelopmentRegion = English;\n\t\t\thasScannedForEncodings = 0;\n\t\t\tknownRegions = (\n\t\t\t\ten,\n\t\t\t);\n\t\t\tmainGroup = 1FA35E5013F57B2700A6B347;\n\t\t\tproductRefGroup = 1FA35E5C13F57B2700A6B347 /* Products */;\n\t\t\tprojectDirPath = \"\";\n\t\t\tprojectRoot = \"\";\n\t\t\ttargets = (\n\t\t\t\t1FA35E5A13F57B2700A6B347 /* RSColorPicker */,\n\t\t\t\t2BFBDBD718D2574400DFC1E5 /* RSColorPickerTests */,\n\t\t\t);\n\t\t};\n/* End PBXProject section */\n\n/* Begin PBXResourcesBuildPhase section */\n\t\t1FA35E5913F57B2700A6B347 /* Resources */ = {\n\t\t\tisa = PBXResourcesBuildPhase;\n\t\t\tbuildActionMask = 2147483647;\n\t\t\tfiles = (\n\t\t\t\t1FA35E6A13F57B2800A6B347 /* InfoPlist.strings in Resources */,\n\t\t\t\t930D5A8016DE4D36006C38D4 /* Default-568h@2x.png in Resources */,\n\t\t\t);\n\t\t\trunOnlyForDeploymentPostprocessing = 0;\n\t\t};\n\t\t2BFBDBD618D2574400DFC1E5 /* Resources */ = {\n\t\t\tisa = PBXResourcesBuildPhase;\n\t\t\tbuildActionMask = 2147483647;\n\t\t\tfiles = (\n\t\t\t\t2BFBDBE218D2574400DFC1E5 /* InfoPlist.strings in Resources */,\n\t\t\t);\n\t\t\trunOnlyForDeploymentPostprocessing = 0;\n\t\t};\n/* End PBXResourcesBuildPhase section */\n\n/* Begin PBXSourcesBuildPhase section */\n\t\t1FA35E5713F57B2700A6B347 /* Sources */ = {\n\t\t\tisa = PBXSourcesBuildPhase;\n\t\t\tbuildActionMask = 2147483647;\n\t\t\tfiles = (\n\t\t\t\t1FA35E6D13F57B2800A6B347 /* main.m in Sources */,\n\t\t\t\t1FA35E7013F57B2800A6B347 /* RSColorPickerAppDelegate.m in Sources */,\n\t\t\t\t2B85423116EFC8970047FFBE /* ANImageBitmapRep.m in Sources */,\n\t\t\t\t2B85423216EFC8970047FFBE /* BitmapContextRep.m in Sources */,\n\t\t\t\t2B85423316EFC8970047FFBE /* NSImage+ANImageBitmapRep.m in Sources */,\n\t\t\t\tFA5AA0EA185F6477000355FE /* RSBrightnessSlider.m in Sources */,\n\t\t\t\t2B85423416EFC8970047FFBE /* OSCommonImage.m in Sources */,\n\t\t\t\t2B85423516EFC8970047FFBE /* UIImage+ANImageBitmapRep.m in Sources */,\n\t\t\t\t2B85423616EFC8970047FFBE /* CGContextCreator.m in Sources */,\n\t\t\t\t2B85423716EFC8970047FFBE /* CGImageContainer.m in Sources */,\n\t\t\t\t2B85423816EFC8970047FFBE /* BitmapContextManipulator.m in Sources */,\n\t\t\t\tFA5AA0EB185F6477000355FE /* RSOpacitySlider.m in Sources */,\n\t\t\t\t2B85423916EFC8970047FFBE /* BitmapCropManipulator.m in Sources */,\n\t\t\t\t2B85423A16EFC8970047FFBE /* BitmapDrawManipulator.m in Sources */,\n\t\t\t\t2B85423B16EFC8970047FFBE /* BitmapRotationManipulator.m in Sources */,\n\t\t\t\tFAFF6E4C185F84BD00412D58 /* RSColorPickerState.m in Sources */,\n\t\t\t\t2B85423C16EFC8970047FFBE /* BitmapScaleManipulator.m in Sources */,\n\t\t\t\t2B85423D16EFC8970047FFBE /* BGRSLoupeLayer.m in Sources */,\n\t\t\t\t2B85423F16EFC8970047FFBE /* RSColorFunctions.m in Sources */,\n\t\t\t\t2B85424016EFC8970047FFBE /* RSColorPickerView.m in Sources */,\n\t\t\t\t2B85424116EFC8970047FFBE /* RSSelectionLayer.m in Sources */,\n\t\t\t\t2B12A0DF1792FF46007F2A0A /* TestColorViewController.m in Sources */,\n\t\t\t\t94A10AFF179DB67C00F0BD7E /* RSGenerateOperation.m in Sources */,\n\t\t\t);\n\t\t\trunOnlyForDeploymentPostprocessing = 0;\n\t\t};\n\t\t2BFBDBD418D2574400DFC1E5 /* Sources */ = {\n\t\t\tisa = PBXSourcesBuildPhase;\n\t\t\tbuildActionMask = 2147483647;\n\t\t\tfiles = (\n\t\t\t\t2BF47AD318D4D44600C12FA5 /* RSColorPickerViewDelegateTests.m in Sources */,\n\t\t\t\t2B78462718D290340002F859 /* CPTestCase.m in Sources */,\n\t\t\t\t2BF8BFF818E9B67600E7C5BF /* RSColorPickerStateTests.m in Sources */,\n\t\t\t\t2BFBDBE418D2574400DFC1E5 /* RSColorPickerViewTests.m in Sources */,\n\t\t\t\t2B989DF318D61F760049D521 /* RSColorFunctionsTests.m in Sources */,\n\t\t\t\t2B78462918D298570002F859 /* CPTestCaseTests.m in Sources */,\n\t\t\t);\n\t\t\trunOnlyForDeploymentPostprocessing = 0;\n\t\t};\n/* End PBXSourcesBuildPhase section */\n\n/* Begin PBXTargetDependency section */\n\t\t2BFBDBE718D2574400DFC1E5 /* PBXTargetDependency */ = {\n\t\t\tisa = PBXTargetDependency;\n\t\t\ttarget = 1FA35E5A13F57B2700A6B347 /* RSColorPicker */;\n\t\t\ttargetProxy = 2BFBDBE618D2574400DFC1E5 /* PBXContainerItemProxy */;\n\t\t};\n/* End PBXTargetDependency section */\n\n/* Begin PBXVariantGroup section */\n\t\t1FA35E6813F57B2800A6B347 /* InfoPlist.strings */ = {\n\t\t\tisa = PBXVariantGroup;\n\t\t\tchildren = (\n\t\t\t\t1FA35E6913F57B2800A6B347 /* en */,\n\t\t\t);\n\t\t\tname = InfoPlist.strings;\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n\t\t2BFBDBE018D2574400DFC1E5 /* InfoPlist.strings */ = {\n\t\t\tisa = PBXVariantGroup;\n\t\t\tchildren = (\n\t\t\t\t2BFBDBE118D2574400DFC1E5 /* en */,\n\t\t\t);\n\t\t\tname = InfoPlist.strings;\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n/* End PBXVariantGroup section */\n\n/* Begin XCBuildConfiguration section */\n\t\t1FA35E7413F57B2800A6B347 /* Debug */ = {\n\t\t\tisa = XCBuildConfiguration;\n\t\t\tbuildSettings = {\n\t\t\t\t\"CODE_SIGN_IDENTITY[sdk=iphoneos*]\" = \"iPhone Developer\";\n\t\t\t\tGCC_C_LANGUAGE_STANDARD = gnu99;\n\t\t\t\tGCC_OPTIMIZATION_LEVEL = 0;\n\t\t\t\tGCC_PREPROCESSOR_DEFINITIONS = DEBUG;\n\t\t\t\tGCC_SYMBOLS_PRIVATE_EXTERN = NO;\n\t\t\t\tGCC_VERSION = com.apple.compilers.llvmgcc42;\n\t\t\t\tGCC_WARN_ABOUT_RETURN_TYPE = YES;\n\t\t\t\tGCC_WARN_UNUSED_VARIABLE = YES;\n\t\t\t\tIPHONEOS_DEPLOYMENT_TARGET = 4.3;\n\t\t\t\tONLY_ACTIVE_ARCH = YES;\n\t\t\t\tSDKROOT = iphoneos;\n\t\t\t};\n\t\t\tname = Debug;\n\t\t};\n\t\t1FA35E7513F57B2800A6B347 /* Release */ = {\n\t\t\tisa = XCBuildConfiguration;\n\t\t\tbuildSettings = {\n\t\t\t\t\"CODE_SIGN_IDENTITY[sdk=iphoneos*]\" = \"iPhone Developer\";\n\t\t\t\tGCC_C_LANGUAGE_STANDARD = gnu99;\n\t\t\t\tGCC_VERSION = com.apple.compilers.llvmgcc42;\n\t\t\t\tGCC_WARN_ABOUT_RETURN_TYPE = YES;\n\t\t\t\tGCC_WARN_UNUSED_VARIABLE = YES;\n\t\t\t\tIPHONEOS_DEPLOYMENT_TARGET = 4.3;\n\t\t\t\tOTHER_CFLAGS = \"-DNS_BLOCK_ASSERTIONS=1\";\n\t\t\t\tSDKROOT = iphoneos;\n\t\t\t};\n\t\t\tname = Release;\n\t\t};\n\t\t1FA35E7713F57B2800A6B347 /* Debug */ = {\n\t\t\tisa = XCBuildConfiguration;\n\t\t\tbuildSettings = {\n\t\t\t\tALWAYS_SEARCH_USER_PATHS = NO;\n\t\t\t\tCLANG_ENABLE_OBJC_ARC = YES;\n\t\t\t\tCODE_SIGN_IDENTITY = \"iPhone Developer\";\n\t\t\t\t\"CODE_SIGN_IDENTITY[sdk=iphoneos*]\" = \"iPhone Developer\";\n\t\t\t\tCOPY_PHASE_STRIP = NO;\n\t\t\t\tFRAMEWORK_SEARCH_PATHS = (\n\t\t\t\t\t\"$(inherited)\",\n\t\t\t\t\t\"$(DEVELOPER_FRAMEWORKS_DIR)\",\n\t\t\t\t);\n\t\t\t\tGCC_DYNAMIC_NO_PIC = NO;\n\t\t\t\tGCC_PRECOMPILE_PREFIX_HEADER = YES;\n\t\t\t\tGCC_PREFIX_HEADER = \"RSColorPicker/RSColorPicker-Prefix.pch\";\n\t\t\t\tGCC_VERSION = com.apple.compilers.llvm.clang.1_0;\n\t\t\t\tINFOPLIST_FILE = \"RSColorPicker/RSColorPicker-Info.plist\";\n\t\t\t\tIPHONEOS_DEPLOYMENT_TARGET = 6.0;\n\t\t\t\tPRODUCT_NAME = \"$(TARGET_NAME)\";\n\t\t\t\tPROVISIONING_PROFILE = \"\";\n\t\t\t\tWRAPPER_EXTENSION = app;\n\t\t\t};\n\t\t\tname = Debug;\n\t\t};\n\t\t1FA35E7813F57B2800A6B347 /* Release */ = {\n\t\t\tisa = XCBuildConfiguration;\n\t\t\tbuildSettings = {\n\t\t\t\tALWAYS_SEARCH_USER_PATHS = NO;\n\t\t\t\tCLANG_ENABLE_OBJC_ARC = YES;\n\t\t\t\tCODE_SIGN_IDENTITY = \"iPhone Developer\";\n\t\t\t\t\"CODE_SIGN_IDENTITY[sdk=iphoneos*]\" = \"iPhone Developer\";\n\t\t\t\tCOPY_PHASE_STRIP = YES;\n\t\t\t\tFRAMEWORK_SEARCH_PATHS = (\n\t\t\t\t\t\"$(inherited)\",\n\t\t\t\t\t\"$(DEVELOPER_FRAMEWORKS_DIR)\",\n\t\t\t\t);\n\t\t\t\tGCC_PRECOMPILE_PREFIX_HEADER = YES;\n\t\t\t\tGCC_PREFIX_HEADER = \"RSColorPicker/RSColorPicker-Prefix.pch\";\n\t\t\t\tGCC_VERSION = com.apple.compilers.llvm.clang.1_0;\n\t\t\t\tINFOPLIST_FILE = \"RSColorPicker/RSColorPicker-Info.plist\";\n\t\t\t\tIPHONEOS_DEPLOYMENT_TARGET = 6.0;\n\t\t\t\tPRODUCT_NAME = \"$(TARGET_NAME)\";\n\t\t\t\tPROVISIONING_PROFILE = \"\";\n\t\t\t\tVALIDATE_PRODUCT = YES;\n\t\t\t\tWRAPPER_EXTENSION = app;\n\t\t\t};\n\t\t\tname = Release;\n\t\t};\n\t\t2BFBDBE818D2574400DFC1E5 /* Debug */ = {\n\t\t\tisa = XCBuildConfiguration;\n\t\t\tbuildSettings = {\n\t\t\t\tALWAYS_SEARCH_USER_PATHS = NO;\n\t\t\t\tBUNDLE_LOADER = \"$(BUILT_PRODUCTS_DIR)/RSColorPicker.app/RSColorPicker\";\n\t\t\t\tCLANG_CXX_LANGUAGE_STANDARD = \"gnu++0x\";\n\t\t\t\tCLANG_CXX_LIBRARY = \"libc++\";\n\t\t\t\tCLANG_ENABLE_MODULES = YES;\n\t\t\t\tCLANG_ENABLE_OBJC_ARC = YES;\n\t\t\t\tCLANG_WARN_BOOL_CONVERSION = YES;\n\t\t\t\tCLANG_WARN_CONSTANT_CONVERSION = YES;\n\t\t\t\tCLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;\n\t\t\t\tCLANG_WARN_EMPTY_BODY = YES;\n\t\t\t\tCLANG_WARN_ENUM_CONVERSION = YES;\n\t\t\t\tCLANG_WARN_INT_CONVERSION = YES;\n\t\t\t\tCLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;\n\t\t\t\tCLANG_WARN__DUPLICATE_METHOD_MATCH = YES;\n\t\t\t\tCOPY_PHASE_STRIP = NO;\n\t\t\t\tFRAMEWORK_SEARCH_PATHS = (\n\t\t\t\t\t\"$(SDKROOT)/Developer/Library/Frameworks\",\n\t\t\t\t\t\"$(inherited)\",\n\t\t\t\t\t\"$(DEVELOPER_FRAMEWORKS_DIR)\",\n\t\t\t\t);\n\t\t\t\tGCC_DYNAMIC_NO_PIC = NO;\n\t\t\t\tGCC_PRECOMPILE_PREFIX_HEADER = YES;\n\t\t\t\tGCC_PREFIX_HEADER = \"RSColorPickerTests/RSColorPickerTests-Prefix.pch\";\n\t\t\t\tGCC_PREPROCESSOR_DEFINITIONS = (\n\t\t\t\t\t\"DEBUG=1\",\n\t\t\t\t\t\"$(inherited)\",\n\t\t\t\t);\n\t\t\t\tGCC_VERSION = \"\";\n\t\t\t\tGCC_WARN_64_TO_32_BIT_CONVERSION = YES;\n\t\t\t\tGCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;\n\t\t\t\tGCC_WARN_UNDECLARED_SELECTOR = YES;\n\t\t\t\tGCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;\n\t\t\t\tGCC_WARN_UNUSED_FUNCTION = YES;\n\t\t\t\tINFOPLIST_FILE = \"RSColorPickerTests/RSColorPickerTests-Info.plist\";\n\t\t\t\tIPHONEOS_DEPLOYMENT_TARGET = 7.1;\n\t\t\t\tPRODUCT_NAME = \"$(TARGET_NAME)\";\n\t\t\t\tTEST_HOST = \"$(BUNDLE_LOADER)\";\n\t\t\t\tWRAPPER_EXTENSION = xctest;\n\t\t\t};\n\t\t\tname = Debug;\n\t\t};\n\t\t2BFBDBE918D2574400DFC1E5 /* Release */ = {\n\t\t\tisa = XCBuildConfiguration;\n\t\t\tbuildSettings = {\n\t\t\t\tALWAYS_SEARCH_USER_PATHS = NO;\n\t\t\t\tBUNDLE_LOADER = \"$(BUILT_PRODUCTS_DIR)/RSColorPicker.app/RSColorPicker\";\n\t\t\t\tCLANG_CXX_LANGUAGE_STANDARD = \"gnu++0x\";\n\t\t\t\tCLANG_CXX_LIBRARY = \"libc++\";\n\t\t\t\tCLANG_ENABLE_MODULES = YES;\n\t\t\t\tCLANG_ENABLE_OBJC_ARC = YES;\n\t\t\t\tCLANG_WARN_BOOL_CONVERSION = YES;\n\t\t\t\tCLANG_WARN_CONSTANT_CONVERSION = YES;\n\t\t\t\tCLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;\n\t\t\t\tCLANG_WARN_EMPTY_BODY = YES;\n\t\t\t\tCLANG_WARN_ENUM_CONVERSION = YES;\n\t\t\t\tCLANG_WARN_INT_CONVERSION = YES;\n\t\t\t\tCLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;\n\t\t\t\tCLANG_WARN__DUPLICATE_METHOD_MATCH = YES;\n\t\t\t\tCOPY_PHASE_STRIP = YES;\n\t\t\t\tENABLE_NS_ASSERTIONS = NO;\n\t\t\t\tFRAMEWORK_SEARCH_PATHS = (\n\t\t\t\t\t\"$(SDKROOT)/Developer/Library/Frameworks\",\n\t\t\t\t\t\"$(inherited)\",\n\t\t\t\t\t\"$(DEVELOPER_FRAMEWORKS_DIR)\",\n\t\t\t\t);\n\t\t\t\tGCC_PRECOMPILE_PREFIX_HEADER = YES;\n\t\t\t\tGCC_PREFIX_HEADER = \"RSColorPickerTests/RSColorPickerTests-Prefix.pch\";\n\t\t\t\tGCC_VERSION = \"\";\n\t\t\t\tGCC_WARN_64_TO_32_BIT_CONVERSION = YES;\n\t\t\t\tGCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;\n\t\t\t\tGCC_WARN_UNDECLARED_SELECTOR = YES;\n\t\t\t\tGCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;\n\t\t\t\tGCC_WARN_UNUSED_FUNCTION = YES;\n\t\t\t\tINFOPLIST_FILE = \"RSColorPickerTests/RSColorPickerTests-Info.plist\";\n\t\t\t\tIPHONEOS_DEPLOYMENT_TARGET = 7.1;\n\t\t\t\tPRODUCT_NAME = \"$(TARGET_NAME)\";\n\t\t\t\tTEST_HOST = \"$(BUNDLE_LOADER)\";\n\t\t\t\tVALIDATE_PRODUCT = YES;\n\t\t\t\tWRAPPER_EXTENSION = xctest;\n\t\t\t};\n\t\t\tname = Release;\n\t\t};\n/* End XCBuildConfiguration section */\n\n/* Begin XCConfigurationList section */\n\t\t1FA35E5513F57B2700A6B347 /* Build configuration list for PBXProject \"RSColorPicker\" */ = {\n\t\t\tisa = XCConfigurationList;\n\t\t\tbuildConfigurations = (\n\t\t\t\t1FA35E7413F57B2800A6B347 /* Debug */,\n\t\t\t\t1FA35E7513F57B2800A6B347 /* Release */,\n\t\t\t);\n\t\t\tdefaultConfigurationIsVisible = 0;\n\t\t\tdefaultConfigurationName = Release;\n\t\t};\n\t\t1FA35E7613F57B2800A6B347 /* Build configuration list for PBXNativeTarget \"RSColorPicker\" */ = {\n\t\t\tisa = XCConfigurationList;\n\t\t\tbuildConfigurations = (\n\t\t\t\t1FA35E7713F57B2800A6B347 /* Debug */,\n\t\t\t\t1FA35E7813F57B2800A6B347 /* Release */,\n\t\t\t);\n\t\t\tdefaultConfigurationIsVisible = 0;\n\t\t\tdefaultConfigurationName = Release;\n\t\t};\n\t\t2BFBDBEA18D2574400DFC1E5 /* Build configuration list for PBXNativeTarget \"RSColorPickerTests\" */ = {\n\t\t\tisa = XCConfigurationList;\n\t\t\tbuildConfigurations = (\n\t\t\t\t2BFBDBE818D2574400DFC1E5 /* Debug */,\n\t\t\t\t2BFBDBE918D2574400DFC1E5 /* Release */,\n\t\t\t);\n\t\t\tdefaultConfigurationIsVisible = 0;\n\t\t\tdefaultConfigurationName = Release;\n\t\t};\n/* End XCConfigurationList section */\n\t};\n\trootObject = 1FA35E5213F57B2700A6B347 /* Project object */;\n}\n"
  },
  {
    "path": "RSColorPicker.xcodeproj/project.xcworkspace/contents.xcworkspacedata",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<Workspace\n   version = \"1.0\">\n   <FileRef\n      location = \"self:RSColorPicker.xcodeproj\">\n   </FileRef>\n</Workspace>\n"
  },
  {
    "path": "RSColorPicker.xcodeproj/xcshareddata/xcschemes/RSColorPicker.xcscheme",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<Scheme\n   LastUpgradeVersion = \"0500\"\n   version = \"1.3\">\n   <BuildAction\n      parallelizeBuildables = \"YES\"\n      buildImplicitDependencies = \"YES\">\n      <BuildActionEntries>\n         <BuildActionEntry\n            buildForTesting = \"YES\"\n            buildForRunning = \"YES\"\n            buildForProfiling = \"YES\"\n            buildForArchiving = \"YES\"\n            buildForAnalyzing = \"YES\">\n            <BuildableReference\n               BuildableIdentifier = \"primary\"\n               BlueprintIdentifier = \"1FA35E5A13F57B2700A6B347\"\n               BuildableName = \"RSColorPicker.app\"\n               BlueprintName = \"RSColorPicker\"\n               ReferencedContainer = \"container:RSColorPicker.xcodeproj\">\n            </BuildableReference>\n         </BuildActionEntry>\n      </BuildActionEntries>\n   </BuildAction>\n   <TestAction\n      selectedDebuggerIdentifier = \"Xcode.DebuggerFoundation.Debugger.LLDB\"\n      selectedLauncherIdentifier = \"Xcode.DebuggerFoundation.Launcher.LLDB\"\n      shouldUseLaunchSchemeArgsEnv = \"YES\"\n      buildConfiguration = \"Debug\">\n      <Testables>\n         <TestableReference\n            skipped = \"NO\">\n            <BuildableReference\n               BuildableIdentifier = \"primary\"\n               BlueprintIdentifier = \"2BFBDBD718D2574400DFC1E5\"\n               BuildableName = \"RSColorPickerTests.xctest\"\n               BlueprintName = \"RSColorPickerTests\"\n               ReferencedContainer = \"container:RSColorPicker.xcodeproj\">\n            </BuildableReference>\n         </TestableReference>\n      </Testables>\n      <MacroExpansion>\n         <BuildableReference\n            BuildableIdentifier = \"primary\"\n            BlueprintIdentifier = \"1FA35E5A13F57B2700A6B347\"\n            BuildableName = \"RSColorPicker.app\"\n            BlueprintName = \"RSColorPicker\"\n            ReferencedContainer = \"container:RSColorPicker.xcodeproj\">\n         </BuildableReference>\n      </MacroExpansion>\n   </TestAction>\n   <LaunchAction\n      selectedDebuggerIdentifier = \"Xcode.DebuggerFoundation.Debugger.LLDB\"\n      selectedLauncherIdentifier = \"Xcode.DebuggerFoundation.Launcher.LLDB\"\n      launchStyle = \"0\"\n      useCustomWorkingDirectory = \"NO\"\n      buildConfiguration = \"Debug\"\n      ignoresPersistentStateOnLaunch = \"NO\"\n      debugDocumentVersioning = \"YES\"\n      allowLocationSimulation = \"YES\">\n      <BuildableProductRunnable>\n         <BuildableReference\n            BuildableIdentifier = \"primary\"\n            BlueprintIdentifier = \"1FA35E5A13F57B2700A6B347\"\n            BuildableName = \"RSColorPicker.app\"\n            BlueprintName = \"RSColorPicker\"\n            ReferencedContainer = \"container:RSColorPicker.xcodeproj\">\n         </BuildableReference>\n      </BuildableProductRunnable>\n      <AdditionalOptions>\n      </AdditionalOptions>\n   </LaunchAction>\n   <ProfileAction\n      shouldUseLaunchSchemeArgsEnv = \"YES\"\n      savedToolIdentifier = \"\"\n      useCustomWorkingDirectory = \"NO\"\n      buildConfiguration = \"Release\"\n      debugDocumentVersioning = \"YES\">\n      <BuildableProductRunnable>\n         <BuildableReference\n            BuildableIdentifier = \"primary\"\n            BlueprintIdentifier = \"1FA35E5A13F57B2700A6B347\"\n            BuildableName = \"RSColorPicker.app\"\n            BlueprintName = \"RSColorPicker\"\n            ReferencedContainer = \"container:RSColorPicker.xcodeproj\">\n         </BuildableReference>\n      </BuildableProductRunnable>\n   </ProfileAction>\n   <AnalyzeAction\n      buildConfiguration = \"Debug\">\n   </AnalyzeAction>\n   <ArchiveAction\n      buildConfiguration = \"Release\"\n      revealArchiveInOrganizer = \"YES\">\n   </ArchiveAction>\n</Scheme>\n"
  },
  {
    "path": "RSColorPickerTests/CPTestCase.h",
    "content": "//\n//  CPTestCase.h\n//  RSColorPicker\n//\n//  Created by Ryan Sullivan on 3/13/14.\n//\n//\n\n#import <XCTest/XCTest.h>\n\n#define kColorComponentAccuracy (1.0/255.0)\n\n@interface CPTestCase : XCTestCase\n\n- (void)assertColor:(UIColor *)colorA equalsColor:(UIColor *)colorB;\n- (void)assertColor:(UIColor *)colorA notEqualsColor:(UIColor *)colorB;\n\n@end\n"
  },
  {
    "path": "RSColorPickerTests/CPTestCase.m",
    "content": "//\n//  CPTestCase.m\n//  RSColorPicker\n//\n//  Created by Ryan Sullivan on 3/13/14.\n//\n//\n\n#import \"CPTestCase.h\"\n#import \"RSColorFunctions.h\"\n\n\n@implementation CPTestCase\n\n#pragma mark - Component helpers\n\n- (void)assertColor:(UIColor *)colorA equalsColor:(UIColor *)colorB\n{\n    CGFloat rgbaA[4];\n    CGFloat rgbaB[4];\n\n    RSGetComponentsForColor(rgbaA, colorA);\n    RSGetComponentsForColor(rgbaB, colorB);\n\n    XCTAssertEqualWithAccuracy(rgbaA[0], rgbaB[0], kColorComponentAccuracy);\n    XCTAssertEqualWithAccuracy(rgbaA[1], rgbaB[1], kColorComponentAccuracy);\n    XCTAssertEqualWithAccuracy(rgbaA[2], rgbaB[2], kColorComponentAccuracy);\n    XCTAssertEqualWithAccuracy(rgbaA[3], rgbaB[3], kColorComponentAccuracy);\n\n    // Check it manually too\n    // Might as well keep this code around if we're maintaining the one below\n    XCTAssert(\n        (fabs(rgbaA[0] - rgbaB[0]) < kColorComponentAccuracy) &&\n        (fabs(rgbaA[1] - rgbaB[1]) < kColorComponentAccuracy) &&\n        (fabs(rgbaA[2] - rgbaB[2]) < kColorComponentAccuracy) &&\n        (fabs(rgbaA[3] - rgbaB[3]) < kColorComponentAccuracy),\n        @\"Color %@ does not equal color %@, but they should be equal\", colorA, colorB\n    );\n}\n- (void)assertColor:(UIColor *)colorA notEqualsColor:(UIColor *)colorB\n{\n    CGFloat rgbaA[4];\n    CGFloat rgbaB[4];\n\n    RSGetComponentsForColor(rgbaA, colorA);\n    RSGetComponentsForColor(rgbaB, colorB);\n\n    XCTAssert(\n        (fabs(rgbaA[0] - rgbaB[0]) > kColorComponentAccuracy) ||\n        (fabs(rgbaA[1] - rgbaB[1]) > kColorComponentAccuracy) ||\n        (fabs(rgbaA[2] - rgbaB[2]) > kColorComponentAccuracy) ||\n        (fabs(rgbaA[3] - rgbaB[3]) > kColorComponentAccuracy),\n        @\"Color %@ is too similar to %@, but they should not be equal\", colorA, colorB\n    );\n}\n\n@end\n"
  },
  {
    "path": "RSColorPickerTests/CPTestCaseTests.m",
    "content": "//\n//  CPTestCaseTests.m\n//  RSColorPicker\n//\n//  Created by Ryan Sullivan on 3/13/14.\n//\n//\n\n#import <XCTest/XCTest.h>\n\n@interface CPTestCaseTests : CPTestCase\n\n@end\n\n@implementation CPTestCaseTests\n\n- (void)testAssertColorEqualsColor\n{\n    UIColor *redA = [UIColor redColor];\n    UIColor *redB = [UIColor colorWithRed:1.0 green:0.0 blue:0.0 alpha:1.0];\n\n    [self assertColor:redA equalsColor:redB];\n}\n\n- (void)testAssertColorNotEqualsColor\n{\n    UIColor *red = [UIColor redColor];\n    UIColor *green = [UIColor greenColor];\n\n    [self assertColor:red notEqualsColor:green];\n}\n\n@end\n"
  },
  {
    "path": "RSColorPickerTests/RSColorFunctionsTests.m",
    "content": "//\n//  RSColorFunctionsTests.m\n//  RSColorPicker\n//\n//  Created by Ryan Sullivan on 3/16/14.\n//\n//\n\n#import <XCTest/XCTest.h>\n#import \"RSColorFunctions.h\"\n\n@interface RSColorFunctionsTests : CPTestCase\n\n@end\n\n@implementation RSColorFunctionsTests\n\n- (void)setUp\n{\n    [super setUp];\n    // Put setup code here. This method is called before the invocation of each test method in the class.\n}\n\n- (void)tearDown\n{\n    // Put teardown code here. This method is called after the invocation of each test method in the class.\n    [super tearDown];\n}\n\n\n- (void)testPixelFromHSV {\n    UIColor *actual, *expected;\n\n    // Inefficient, but should be OK:\n\n    for (CGFloat h = 0; h < 1; h += 0.05)\n    {\n        for (CGFloat s = 0; s < 1; s += 0.05)\n        {\n            for (CGFloat v = 0; v < 0; v += 0.05)\n            {\n                actual = UIColorFromBMPixel(RSPixelFromHSV(h, s, v));\n                expected = [UIColor colorWithHue:h saturation:s brightness:v alpha:1.0];\n                [self assertColor:actual equalsColor:expected];\n            }\n        }\n    }\n}\n\n- (void)testHSVFromPixel {\n    // Not really needed yet, since we're using Apple's implementation\n\n    BMPixel pixel = BMPixelMake(0, 0, 0, 1.0);\n    CGFloat h, s, v;\n\n    RSHSVFromPixel(pixel, &h, &s, &v);\n\n    UIColor *color1 = [UIColor colorWithRed:0 green:0 blue:0 alpha:1.0];\n    UIColor *color2 = [UIColor colorWithHue:h saturation:s brightness:v alpha:1.0];\n    [self assertColor:color1 equalsColor:color2];\n}\n\n- (void)testComponentsForColor_rgb {\n    UIColor *color = [UIColor colorWithRed:0.1 green:0.2 blue:0.3 alpha:0.4];\n    UIColor *testColor;\n\n    CGFloat components[4];\n    RSGetComponentsForColor(components, color);\n\n    testColor = [UIColor colorWithRed:components[0] green:components[1] blue:components[2] alpha:components[3]];\n    [self assertColor:color equalsColor:testColor];\n}\n- (void)testComponentsForColor_gray {\n    UIColor *color = [UIColor colorWithWhite:0.1 alpha:0.2];\n    UIColor *testColor;\n\n    CGFloat components[4];\n    RSGetComponentsForColor(components, color);\n\n    testColor = [UIColor colorWithRed:0.1 green:0.1 blue:0.1 alpha:0.2];\n    [self assertColor:color equalsColor:testColor];\n\n    testColor = [UIColor colorWithRed:components[0] green:components[1] blue:components[2] alpha:components[3]];\n    [self assertColor:color equalsColor:testColor];\n}\n- (void)testComponentsForColor_hsv {\n    UIColor *color = [UIColor colorWithHue:0 saturation:1.0 brightness:1.0 alpha:0.4];\n    UIColor *testColor;\n\n    CGFloat components[4];\n    RSGetComponentsForColor(components, color);\n\n    testColor = [UIColor colorWithRed:1.0 green:0 blue:0 alpha:0.4];\n    [self assertColor:color equalsColor:testColor];\n\n    testColor = [UIColor colorWithRed:components[0] green:components[1] blue:components[2] alpha:components[3]];\n    [self assertColor:color equalsColor:testColor];\n}\n- (void)testComponentsForColor_cmyk {\n    // All of this just to get a CMYK color\n    UIColor * (^colorFromCMYK)(CGFloat C, CGFloat M, CGFloat Y, CGFloat K, CGFloat A) = ^UIColor*(CGFloat C, CGFloat M, CGFloat Y, CGFloat K, CGFloat A){\n        CGColorSpaceRef cmykColorSpace = CGColorSpaceCreateDeviceCMYK();\n        CGFloat colors[5] = {C, M, Y, K, A}; // CMYK+Alpha\n        CGColorRef cgColor = CGColorCreate(cmykColorSpace, colors);\n        UIColor *color = [UIColor colorWithCGColor:cgColor];\n        CGColorRelease(cgColor);\n        CGColorSpaceRelease(cmykColorSpace);\n        return color;\n    };\n\n\n    UIColor *color;\n    UIColor *testColor;\n    CGFloat components[4];\n\n\n    // Test all 1 (black + black)\n    color = colorFromCMYK(1, 1, 1, 1, 0.5);\n    RSGetComponentsForColor(components, color);\n\n    testColor = [UIColor colorWithWhite:0 alpha:0.5];\n    [self assertColor:color equalsColor:testColor];\n\n    testColor = [UIColor colorWithRed:0 green:0 blue:0 alpha:0.5];\n    [self assertColor:color equalsColor:testColor];\n\n\n    // Test all 0 with 1 (black)\n    color = colorFromCMYK(0, 0, 0, 1, 0.5);\n    RSGetComponentsForColor(components, color);\n\n    testColor = [UIColor colorWithWhite:0 alpha:0.5];\n    [self assertColor:color equalsColor:testColor];\n\n    testColor = [UIColor colorWithRed:0 green:0 blue:0 alpha:0.5];\n    [self assertColor:color equalsColor:testColor];\n\n\n    // Test all 0 (white)\n    color = colorFromCMYK(0, 0, 0, 0, 0.5);\n    RSGetComponentsForColor(components, color);\n\n    testColor = [UIColor colorWithWhite:1 alpha:0.5];\n    [self assertColor:color equalsColor:testColor];\n\n    testColor = [UIColor colorWithRed:1 green:1 blue:1 alpha:0.5];\n    [self assertColor:color equalsColor:testColor];\n}\n\n- (void)testImageWithScale {\n\n}\n\n- (void)testOpacityBackgroundImage {\n\n}\n\n- (void)testRandomColor {\n    CGFloat components[4];\n\n    UIColor *color = RSRandomColorOpaque(YES);\n\n    RSGetComponentsForColor(components, color);\n    XCTAssertEqualWithAccuracy(components[3], 1.0, kColorComponentAccuracy);\n}\n\n@end\n"
  },
  {
    "path": "RSColorPickerTests/RSColorPickerStateTests.m",
    "content": "//\n//  RSColorPickerStateTests.m\n//  RSColorPicker\n//\n//  Created by Ryan Sullivan on 3/31/14.\n//\n//\n\n#import <XCTest/XCTest.h>\n#import \"RSColorPickerState.h\"\n#import \"RSColorFunctions.h\"\n\n@interface RSColorPickerStateTests : CPTestCase\n\n@end\n\n@implementation RSColorPickerStateTests\n\n- (void)setUp\n{\n    [super setUp];\n    // Put setup code here. This method is called before the invocation of each test method in the class.\n}\n\n- (void)tearDown\n{\n    // Put teardown code here. This method is called after the invocation of each test method in the class.\n    [super tearDown];\n}\n\n\n\n- (void)testHue_initWithColor {\n    for (int i = 0; i < 5; i++)\n    {\n        UIColor *expectedColor = RSRandomColorOpaque(i % 2 == 0);\n        RSColorPickerState *state = [[RSColorPickerState alloc] initWithColor:expectedColor];\n\n        CGFloat h, s, v, a;\n        [expectedColor getHue:NULL saturation:&s brightness:&v alpha:&a];\n        h = state.hue;\n\n        UIColor *actualColor = [UIColor colorWithHue:h saturation:s brightness:v alpha:a];\n\n        [self assertColor:actualColor equalsColor:expectedColor];\n    }\n}\n\n\n- (void)testSaturation_initWithColor {\n    for (int i = 0; i < 5; i++)\n    {\n        UIColor *expectedColor = RSRandomColorOpaque(i % 2 == 0);\n        RSColorPickerState *state = [[RSColorPickerState alloc] initWithColor:expectedColor];\n\n        CGFloat h, s, v, a;\n        [expectedColor getHue:&h saturation:NULL brightness:&v alpha:&a];\n        s = state.saturation;\n\n        UIColor *actualColor = [UIColor colorWithHue:h saturation:s brightness:v alpha:a];\n\n        [self assertColor:actualColor equalsColor:expectedColor];\n    }\n}\n\n\n- (void)testColor_initWithColor {\n    for (int i = 0; i < 5; i++)\n    {\n        UIColor *expectedColor = RSRandomColorOpaque(i % 2 == 0);\n        RSColorPickerState *state = [[RSColorPickerState alloc] initWithColor:expectedColor];\n\n        [self assertColor:state.color equalsColor:expectedColor];\n    }\n}\n\n- (void)testColor_initWithScaledRelativePoint {\n    // Scaled relative point is *relative*, so 0,0 is the center, which should be white\n\n    RSColorPickerState *state = [[RSColorPickerState alloc] initWithScaledRelativePoint:CGPointMake(0, 0)\n                                                                             brightness:1.0 alpha:1.0];\n    UIColor *expectedColor = [UIColor whiteColor];\n    [self assertColor:expectedColor equalsColor:state.color];\n}\n\n- (void)testColor_stateForPointSizePadding {\n    // Regardless of padding, 100,100 is the center point of a 200px circle, which is white\n    // Assumed that default is 100% brightness and 100% alpha\n\n    RSColorPickerState *state = [RSColorPickerState stateForPoint:CGPointMake(100, 100) size:200 padding:0];\n    UIColor *expectedColor = [UIColor whiteColor];\n    [self assertColor:expectedColor equalsColor:state.color];\n}\n\n- (void)testColor_initWithHueSaturationBrightnessAlpha {\n    RSColorPickerState *state = [[RSColorPickerState alloc] initWithHue:0 saturation:0 brightness:1.0 alpha:1.0];\n    UIColor *expectedColor = [UIColor whiteColor];\n    [self assertColor:expectedColor equalsColor:state.color];\n}\n\n\n\n- (void)testSelectionLocationWithSizePadding {\n    UIColor *expectedColor;\n    RSColorPickerState *state;\n    CGPoint expectedPoint, actualPoint;\n\n\n    NSArray *centerTests = @[[UIColor blackColor], [UIColor whiteColor], [UIColor colorWithWhite:0.5 alpha:1.0]];\n    for (expectedColor in centerTests)\n    {\n        state = [[RSColorPickerState alloc] initWithColor:expectedColor];\n\n        expectedPoint = CGPointMake(100, 100);\n        actualPoint = [state selectionLocationWithSize:200.0 padding:20.0];\n\n        XCTAssertEqual(expectedPoint.x, actualPoint.x);\n        XCTAssertEqual(expectedPoint.y, actualPoint.y);\n    }\n}\n\n@end\n"
  },
  {
    "path": "RSColorPickerTests/RSColorPickerTests-Info.plist",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<!DOCTYPE plist PUBLIC \"-//Apple//DTD PLIST 1.0//EN\" \"http://www.apple.com/DTDs/PropertyList-1.0.dtd\">\n<plist version=\"1.0\">\n<dict>\n\t<key>CFBundleDevelopmentRegion</key>\n\t<string>en</string>\n\t<key>CFBundleExecutable</key>\n\t<string>${EXECUTABLE_NAME}</string>\n\t<key>CFBundleIdentifier</key>\n\t<string>me.rsullivan.tests.rscolorpicker.${PRODUCT_NAME:rfc1034identifier}</string>\n\t<key>CFBundleInfoDictionaryVersion</key>\n\t<string>6.0</string>\n\t<key>CFBundlePackageType</key>\n\t<string>BNDL</string>\n\t<key>CFBundleShortVersionString</key>\n\t<string>1.0</string>\n\t<key>CFBundleSignature</key>\n\t<string>????</string>\n\t<key>CFBundleVersion</key>\n\t<string>1</string>\n</dict>\n</plist>\n"
  },
  {
    "path": "RSColorPickerTests/RSColorPickerTests-Prefix.pch",
    "content": "//\n//  Prefix header\n//\n//  The contents of this file are implicitly included at the beginning of every source file.\n//\n\n#ifdef __OBJC__\n    #import <UIKit/UIKit.h>\n    #import <Foundation/Foundation.h>\n    #import <XCTest/XCTest.h>\n    #import \"CPTestCase.h\"\n#endif\n"
  },
  {
    "path": "RSColorPickerTests/RSColorPickerViewDelegateTests.m",
    "content": "//\n//  RSColorPickerViewDelegateTests.m\n//  RSColorPicker\n//\n//  Created by Ryan Sullivan on 3/15/14.\n//\n//\n\n#import <XCTest/XCTest.h>\n\n#import \"RSColorPickerView.h\"\n#import \"RSColorFunctions.h\"\n\n@interface RSColorPickerViewDelegateTests : CPTestCase <RSColorPickerViewDelegate>\n\n@property (nonatomic) RSColorPickerView * colorPicker;\n@property (nonatomic) int delegateDidChangeSelectionCalledCount;\n\n@end\n\n@implementation RSColorPickerViewDelegateTests\n\n- (void)setUp\n{\n    [super setUp];\n\n    // Reset counter\n    self.delegateDidChangeSelectionCalledCount = 0;\n\n    self.colorPicker = [[RSColorPickerView alloc] initWithFrame:CGRectMake(0.0, 0.0, 200.0, 200.0)];\n    self.colorPicker.selectionColor = RSRandomColorOpaque(NO);\n    // Make sure we set delegate last so counters don't get messed up by init\n    self.colorPicker.delegate = self;\n}\n\n- (void)tearDown\n{\n    // Put teardown code here. This method is called after the invocation of each test method in the class.\n    [super tearDown];\n}\n\n\n- (void)testDelegateDidChangeSelection_selectionColor\n{\n    self.colorPicker.selectionColor = RSRandomColorOpaque(NO);\n    XCTAssertEqual(self.delegateDidChangeSelectionCalledCount, 1);\n}\n- (void)testDelegateDidChangeSelection_selection\n{\n    self.colorPicker.selection = CGPointMake(100.0, 100.0);\n    XCTAssertEqual(self.delegateDidChangeSelectionCalledCount, 1);\n}\n\n\n#pragma mark - RSColorPickerView Delegates\n\n- (void)colorPickerDidChangeSelection:(RSColorPickerView *)cp\n{\n    self.delegateDidChangeSelectionCalledCount++;\n    NSLog(@\"Got RSColorPickerViewDelegate selection change callback\");\n}\n- (void)colorPicker:(RSColorPickerView *)colorPicker touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event\n{\n    XCTFail(@\"Got -touchesBegan from running tests\");\n}\n- (void)colorPicker:(RSColorPickerView *)colorPicker touchesEnded:(NSSet *)touches withEvent:(UIEvent *)event\n{\n    XCTFail(@\"Got -touchesEnded from running tests\");\n}\n\n@end\n\n"
  },
  {
    "path": "RSColorPickerTests/RSColorPickerViewTests.m",
    "content": "//\n//  RSColorPickerTests.m\n//  RSColorPickerTests\n//\n//  Created by Ryan Sullivan on 3/13/14.\n//\n//\n\n#import <XCTest/XCTest.h>\n\n#import \"RSColorPickerView.h\"\n#import \"RSColorFunctions.h\"\n#import \"RSColorPickerState.h\"\n\n\n@interface RSColorPickerViewTests : CPTestCase <RSColorPickerViewDelegate>\n\n@property (nonatomic) RSColorPickerView * colorPicker;\n\n@end\n\n\n@implementation RSColorPickerViewTests\n\n- (void)setUp\n{\n    [super setUp];\n\n    self.colorPicker = [[RSColorPickerView alloc] initWithFrame:CGRectMake(0.0, 0.0, 200.0, 200.0)];\n    self.colorPicker.selectionColor = RSRandomColorOpaque(NO);\n    self.colorPicker.delegate = self;\n}\n\n- (void)tearDown\n{\n    // Put teardown code here. This method is called after the invocation of each test method in the class.\n    [super tearDown];\n}\n\n\n- (void)testSetSelectionColor_multiple\n{\n    UIColor *newSelection = RSRandomColorOpaque(NO);\n\n    self.colorPicker.selectionColor = newSelection;\n    UIColor *setA = self.colorPicker.selectionColor;\n\n    self.colorPicker.selectionColor = newSelection;\n    UIColor *setB = self.colorPicker.selectionColor;\n\n    [self assertColor:newSelection equalsColor:setA];\n    [self assertColor:newSelection equalsColor:setB];\n\n    XCTAssertEqualObjects(setA, setB);\n}\n\n- (void)testSetSelectionColor_random\n{\n    UIColor *newSelection = RSRandomColorOpaque(NO);\n    UIColor *oldSelection = self.colorPicker.selectionColor;\n\n    self.colorPicker.selectionColor = newSelection;\n\n    UIColor *currentSelection = self.colorPicker.selectionColor;\n\n    [self assertColor:currentSelection notEqualsColor:oldSelection];\n    [self assertColor:currentSelection equalsColor:newSelection];\n}\n\n- (void)testSetSelectionColor_self\n{\n    UIColor *currentColor = self.colorPicker.selectionColor;\n\n    // Re-set it\n    self.colorPicker.selectionColor = currentColor;\n\n    UIColor *newCurrentColor = self.colorPicker.selectionColor;\n\n    [self assertColor:currentColor equalsColor:newCurrentColor];\n    XCTAssertEqualObjects(currentColor, newCurrentColor);\n}\n\n\n- (void)testSetCropToCircle\n{\n    self.colorPicker.cropToCircle = YES;\n    XCTAssertTrue(self.colorPicker.cropToCircle);\n\n    self.colorPicker.cropToCircle = NO;\n    XCTAssertFalse(self.colorPicker.cropToCircle);\n}\n\n\n- (void)testSetSelection_pointByColor\n{\n    // Requirements\n    CGFloat size = self.colorPicker.bounds.size.height;\n    CGFloat padding = self.colorPicker.paddingDistance;\n\n    // Fetch current state/selection\n    CGPoint oldSelection = self.colorPicker.selection;\n\n    // Get new state/selection\n    UIColor *newColor = RSRandomColorOpaque(NO);\n    RSColorPickerState *newState = [[RSColorPickerState alloc] initWithColor:newColor];\n    CGPoint newSelection = [newState selectionLocationWithSize:size padding:padding];\n\n    // Actually set it\n    self.colorPicker.selection = newSelection;\n\n    // Test selection equals\n    CGPoint newSelectionTest = self.colorPicker.selection;\n\n    // Test new point\n    XCTAssertEqual(newSelectionTest.x, newSelection.x);\n    XCTAssertEqual(newSelectionTest.y, newSelection.y);\n    // Test point not old\n    XCTAssertNotEqual(newSelectionTest.x, oldSelection.x);\n    XCTAssertNotEqual(newSelectionTest.y, oldSelection.y);\n}\n- (void)testSetSelection_pointByPoint\n{\n    // Fetch current state/selection\n    CGPoint oldSelection = self.colorPicker.selection;\n\n    // Get new state/selection\n    CGPoint newSelection = CGPointMake(100.0, 100.0);\n\n    // Actually set it\n    self.colorPicker.selection = newSelection;\n\n    // Test selection equals\n    CGPoint newSelectionTest = self.colorPicker.selection;\n\n    // Test new point\n    XCTAssertEqual(newSelectionTest.x, newSelection.x);\n    XCTAssertEqual(newSelectionTest.y, newSelection.y);\n    // Test point not old\n    XCTAssertNotEqual(newSelectionTest.x, oldSelection.x);\n    XCTAssertNotEqual(newSelectionTest.y, oldSelection.y);\n}\n- (void)testSetSelection_colorByColor\n{\n    // Requirements\n    CGFloat size = self.colorPicker.bounds.size.height;\n    CGFloat padding = self.colorPicker.paddingDistance;\n\n    // Fetch current state/selection\n    CGPoint oldSelection = self.colorPicker.selection;\n    RSColorPickerState *oldState = [RSColorPickerState stateForPoint:oldSelection size:size padding:padding];\n    UIColor *oldColor = oldState.color;\n\n    // Get new state/selection\n    UIColor *newColor = RSRandomColorOpaque(NO);\n    RSColorPickerState *newState = [[RSColorPickerState alloc] initWithColor:newColor];\n    CGPoint newSelection = [newState selectionLocationWithSize:size padding:padding];\n\n    // Actually set it\n    self.colorPicker.selection = newSelection;\n    // ... along with the brightness and alpha\n    CGFloat newColorH, newColorS, newColorV;\n    CGFloat newColorComponents[4];\n    RSGetComponentsForColor(newColorComponents, newColor);\n    RSHSVFromPixel(BMPixelMake(newColorComponents[0], newColorComponents[1], newColorComponents[2], newColorComponents[3]), &newColorH, &newColorS, &newColorV);\n    self.colorPicker.brightness = newColorV;\n    self.colorPicker.opacity = newColorComponents[3];\n\n    // Test selection equals\n    UIColor *newSelectionColorTest = self.colorPicker.selectionColor;\n\n    // Test new color equals\n    [self assertColor:newSelectionColorTest equalsColor:newColor];\n    // Test new color not old\n    [self assertColor:newSelectionColorTest notEqualsColor:oldColor];\n}\n- (void)testSetSelection_colorByPoint\n{\n    // Requirements\n    CGFloat size = self.colorPicker.bounds.size.height;\n    CGFloat padding = self.colorPicker.paddingDistance;\n\n    // Fetch current state/selection\n    CGPoint oldSelection = self.colorPicker.selection;\n    RSColorPickerState *oldState = [RSColorPickerState stateForPoint:oldSelection size:size padding:padding];\n    UIColor *oldColor = oldState.color;\n\n    // Get new state/selection\n    CGPoint newSelection = CGPointMake(100.0, 100.0);\n    RSColorPickerState *newState = [RSColorPickerState stateForPoint:newSelection size:size padding:padding];\n    UIColor *newColor = newState.color;\n\n    // Actually set it\n    self.colorPicker.selection = newSelection;\n    // ... along with the brightness and alpha\n    CGFloat newColorH, newColorS, newColorV;\n    CGFloat newColorComponents[4];\n    RSGetComponentsForColor(newColorComponents, newColor);\n    RSHSVFromPixel(BMPixelMake(newColorComponents[0], newColorComponents[1], newColorComponents[2], newColorComponents[3]), &newColorH, &newColorS, &newColorV);\n    self.colorPicker.brightness = newColorV;\n    self.colorPicker.opacity = newColorComponents[3];\n\n    // Test selection equals\n    UIColor *newSelectionColorTest = self.colorPicker.selectionColor;\n\n    // Test new color equals\n    [self assertColor:newSelectionColorTest equalsColor:newColor];\n    // Test new color not old\n    [self assertColor:newSelectionColorTest notEqualsColor:oldColor];\n}\n\n- (void)testSetShowLoupe\n{\n    self.colorPicker.showLoupe = YES;\n    XCTAssertTrue(self.colorPicker.showLoupe);\n    self.colorPicker.showLoupe = NO;\n    XCTAssertFalse(self.colorPicker.showLoupe);\n}\n\n- (void)testColorAtPoint\n{\n    CGPoint centerPoint = CGPointMake(100, 100);\n    CGPoint rightPoint = CGPointMake(200, 100);\n\n    self.colorPicker.opacity = 1.0;\n\n    self.colorPicker.brightness = 0.0;\n    [self assertColor:[UIColor blackColor] equalsColor:[self.colorPicker colorAtPoint:centerPoint]];\n\n    self.colorPicker.brightness = 1.0;\n    [self assertColor:[UIColor whiteColor] equalsColor:[self.colorPicker colorAtPoint:centerPoint]];\n    [self assertColor:[UIColor redColor] equalsColor:[self.colorPicker colorAtPoint:rightPoint]];\n}\n\n// TODO: test prepare methods\n\n#pragma mark - RSColorPickerView Delegates\n\n- (void)colorPickerDidChangeSelection:(RSColorPickerView *)cp\n{\n    NSLog(@\"Got RSColorPickerViewDelegate selection change callback\");\n}\n- (void)colorPicker:(RSColorPickerView *)colorPicker touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event\n{\n    XCTFail(@\"Got -touchesBegan from running tests\");\n}\n- (void)colorPicker:(RSColorPickerView *)colorPicker touchesEnded:(NSSet *)touches withEvent:(UIEvent *)event\n{\n    XCTFail(@\"Got -touchesEnded from running tests\");\n}\n\n\n@end\n"
  },
  {
    "path": "RSColorPickerTests/en.lproj/InfoPlist.strings",
    "content": "/* Localized versions of Info.plist keys */\n\n"
  }
]