├── WhatTheColor ├── Screenshot │ └── WhatTheColor.png ├── Assets.xcassets │ ├── first.imageset │ │ ├── first.pdf │ │ └── Contents.json │ ├── second.imageset │ │ ├── second.pdf │ │ └── Contents.json │ └── AppIcon.appiconset │ │ └── Contents.json ├── SecondViewController.swift ├── Info.plist ├── Base.lproj │ ├── LaunchScreen.storyboard │ └── Main.storyboard ├── AppDelegate.swift └── FirstViewController.swift ├── WaddaColor.xcodeproj ├── project.xcworkspace │ └── contents.xcworkspacedata ├── xcuserdata │ └── johan.xcuserdatad │ │ └── xcschemes │ │ ├── xcschememanagement.plist │ │ └── WaddaColor.xcscheme └── project.pbxproj ├── .gitignore ├── WaddaColor ├── WaddaColor.h ├── Info.plist ├── WaddaColor.swift ├── ColorModels.swift └── ColorNames.swift ├── WaddaColorTests ├── Info.plist └── WaddaColorTests.swift ├── README.md └── LICENSE /WhatTheColor/Screenshot/WhatTheColor.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/js/WaddaColor/master/WhatTheColor/Screenshot/WhatTheColor.png -------------------------------------------------------------------------------- /WhatTheColor/Assets.xcassets/first.imageset/first.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/js/WaddaColor/master/WhatTheColor/Assets.xcassets/first.imageset/first.pdf -------------------------------------------------------------------------------- /WhatTheColor/Assets.xcassets/second.imageset/second.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/js/WaddaColor/master/WhatTheColor/Assets.xcassets/second.imageset/second.pdf -------------------------------------------------------------------------------- /WaddaColor.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /WhatTheColor/Assets.xcassets/first.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "first.pdf" 6 | } 7 | ], 8 | "info" : { 9 | "version" : 1, 10 | "author" : "xcode" 11 | } 12 | } -------------------------------------------------------------------------------- /WhatTheColor/Assets.xcassets/second.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "second.pdf" 6 | } 7 | ], 8 | "info" : { 9 | "version" : 1, 10 | "author" : "xcode" 11 | } 12 | } -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # xcode noise 2 | build/* 3 | dist/* 4 | *.pbxuser 5 | *.mode1v3 6 | *.mode2v3 7 | *.perspectivev3 8 | *.moved-aside 9 | 10 | # osx noise 11 | .DS_Store 12 | profile 13 | 14 | #xcode4 cruft 15 | *.xcodeproj/project.xcworkspace/* 16 | *.xcodeproj/xcuserdata/* 17 | -------------------------------------------------------------------------------- /WaddaColor/WaddaColor.h: -------------------------------------------------------------------------------- 1 | // 2 | // WaddaColor.h 3 | // WaddaColor 4 | // 5 | // Created by Johan Sørensen on 23/02/16. 6 | // Copyright © 2016 Johan Sørensen. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | //! Project version number for WaddaColor. 12 | FOUNDATION_EXPORT double WaddaColorVersionNumber; 13 | 14 | //! Project version string for WaddaColor. 15 | FOUNDATION_EXPORT const unsigned char WaddaColorVersionString[]; 16 | 17 | // In this header, you should import all the public headers of your framework using statements like #import 18 | 19 | 20 | -------------------------------------------------------------------------------- /WhatTheColor/SecondViewController.swift: -------------------------------------------------------------------------------- 1 | // 2 | // SecondViewController.swift 3 | // WhatTheColor 4 | // 5 | // Created by Johan Sørensen on 24/02/16. 6 | // Copyright © 2016 Johan Sørensen. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | 11 | class SecondViewController: UIViewController { 12 | 13 | override func viewDidLoad() { 14 | super.viewDidLoad() 15 | // Do any additional setup after loading the view, typically from a nib. 16 | } 17 | 18 | override func didReceiveMemoryWarning() { 19 | super.didReceiveMemoryWarning() 20 | // Dispose of any resources that can be recreated. 21 | } 22 | 23 | 24 | } 25 | 26 | -------------------------------------------------------------------------------- /WhatTheColor/Assets.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "iphone", 5 | "size" : "29x29", 6 | "scale" : "2x" 7 | }, 8 | { 9 | "idiom" : "iphone", 10 | "size" : "29x29", 11 | "scale" : "3x" 12 | }, 13 | { 14 | "idiom" : "iphone", 15 | "size" : "40x40", 16 | "scale" : "2x" 17 | }, 18 | { 19 | "idiom" : "iphone", 20 | "size" : "40x40", 21 | "scale" : "3x" 22 | }, 23 | { 24 | "idiom" : "iphone", 25 | "size" : "60x60", 26 | "scale" : "2x" 27 | }, 28 | { 29 | "idiom" : "iphone", 30 | "size" : "60x60", 31 | "scale" : "3x" 32 | } 33 | ], 34 | "info" : { 35 | "version" : 1, 36 | "author" : "xcode" 37 | } 38 | } -------------------------------------------------------------------------------- /WaddaColorTests/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | BNDL 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | 1 23 | 24 | 25 | -------------------------------------------------------------------------------- /WaddaColor/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | FMWK 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | $(CURRENT_PROJECT_VERSION) 23 | NSPrincipalClass 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /WaddaColor.xcodeproj/xcuserdata/johan.xcuserdatad/xcschemes/xcschememanagement.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | SchemeUserState 6 | 7 | WaddaColor.xcscheme 8 | 9 | orderHint 10 | 0 11 | 12 | WhatTheColor.xcscheme 13 | 14 | orderHint 15 | 1 16 | 17 | 18 | SuppressBuildableAutocreation 19 | 20 | 04E381B51C7CF76B0050A0DB 21 | 22 | primary 23 | 24 | 25 | 04E381BF1C7CF76B0050A0DB 26 | 27 | primary 28 | 29 | 30 | 04E381DB1C7E4B560050A0DB 31 | 32 | primary 33 | 34 | 35 | 36 | 37 | 38 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # WaddaColor 2 | 3 | Swift library for a naming a color, based on a closest match to the colors in 4 | Ingrid Sundbergs [Color Thesaurus](http://ingridsundberg.com/2014/02/04/the-color-thesaurus/). 5 | 6 | Just give it any color and it will return the name of that color, and what a color it is. 7 | 8 | ## Usage 9 | 10 | Via the UIColor extention: 11 | 12 | UIColor.blackColor().name // Black 13 | 14 | or via a `WaddaColor` instance: 15 | 16 | let wadda = WaddaColor(color: UIColor.orange()) 17 | let match = wadda.closestMatch() 18 | return match.name // Tangerine 19 | 20 | ## Example app 21 | 22 | The Xcode project contains a sample app target called WhatTheColor 23 | 24 | ![screenshot](WhatTheColor/Screenshot/WhatTheColor.png) 25 | 26 | ## Author 27 | 28 | WaddaColor was made by [Johan Sørensen](http://johansorensen.com) 29 | 30 | ## Credits 31 | 32 | Ingrid Sundberg named all the colors in her [Color Thesaurus](http://ingridsundberg.com/2014/02/04/the-color-thesaurus/) post. Amazing. 33 | 34 | ## License 35 | 36 | MIT, see LICENSE 37 | 38 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (C) 2016 Johan Sørensen 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining 4 | a copy of this software and associated documentation files (the 5 | "Software"), to deal in the Software without restriction, including 6 | without limitation the rights to use, copy, modify, merge, publish, 7 | distribute, sublicense, and/or sell copies of the Software, and to 8 | permit persons to whom the Software is furnished to do so, subject to 9 | the following conditions: 10 | 11 | The above copyright notice and this permission notice shall be 12 | included in all copies or substantial portions of the Software. 13 | 14 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 15 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 16 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 17 | NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE 18 | LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 19 | OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION 20 | WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -------------------------------------------------------------------------------- /WhatTheColor/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | APPL 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | 1 23 | LSRequiresIPhoneOS 24 | 25 | UILaunchStoryboardName 26 | LaunchScreen 27 | UIMainStoryboardFile 28 | Main 29 | UIRequiredDeviceCapabilities 30 | 31 | armv7 32 | 33 | UIStatusBarTintParameters 34 | 35 | UINavigationBar 36 | 37 | Style 38 | UIBarStyleDefault 39 | Translucent 40 | 41 | 42 | 43 | UISupportedInterfaceOrientations 44 | 45 | UIInterfaceOrientationPortrait 46 | UIInterfaceOrientationLandscapeLeft 47 | UIInterfaceOrientationLandscapeRight 48 | 49 | 50 | 51 | -------------------------------------------------------------------------------- /WhatTheColor/Base.lproj/LaunchScreen.storyboard: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | -------------------------------------------------------------------------------- /WhatTheColor/AppDelegate.swift: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.swift 3 | // WhatTheColor 4 | // 5 | // Created by Johan Sørensen on 24/02/16. 6 | // Copyright © 2016 Johan Sørensen. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | 11 | @UIApplicationMain 12 | class AppDelegate: UIResponder, UIApplicationDelegate { 13 | 14 | var window: UIWindow? 15 | 16 | 17 | func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool { 18 | // Override point for customization after application launch. 19 | return true 20 | } 21 | 22 | func applicationWillResignActive(application: UIApplication) { 23 | // Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state. 24 | // Use this method to pause ongoing tasks, disable timers, and throttle down OpenGL ES frame rates. Games should use this method to pause the game. 25 | } 26 | 27 | func applicationDidEnterBackground(application: UIApplication) { 28 | // Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later. 29 | // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits. 30 | } 31 | 32 | func applicationWillEnterForeground(application: UIApplication) { 33 | // Called as part of the transition from the background to the inactive state; here you can undo many of the changes made on entering the background. 34 | } 35 | 36 | func applicationDidBecomeActive(application: UIApplication) { 37 | // Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface. 38 | } 39 | 40 | func applicationWillTerminate(application: UIApplication) { 41 | // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:. 42 | } 43 | 44 | 45 | } 46 | 47 | -------------------------------------------------------------------------------- /WhatTheColor/FirstViewController.swift: -------------------------------------------------------------------------------- 1 | // 2 | // FirstViewController.swift 3 | // WhatTheColor 4 | // 5 | // Created by Johan Sørensen on 24/02/16. 6 | // Copyright © 2016 Johan Sørensen. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | import WaddaColor 11 | 12 | class FirstViewController: UIViewController { 13 | @IBOutlet weak var tableView: UITableView! 14 | let colors: [(name: String, rgba: RGBA)] = ColorThesaurusNames().map({ (name: $0, rgba: $1) }).sort({ $0.name < $1.name }) 15 | 16 | override func viewDidLoad() { 17 | super.viewDidLoad() 18 | tableView.separatorStyle = .None 19 | } 20 | } 21 | 22 | extension FirstViewController: UITableViewDataSource, UITableViewDelegate { 23 | func tableView(tableView: UITableView, numberOfRowsInSection section: Int) -> Int { 24 | return colors.count 25 | } 26 | 27 | func tableView(tableView: UITableView, cellForRowAtIndexPath indexPath: NSIndexPath) -> UITableViewCell { 28 | let cell = tableView.dequeueReusableCellWithIdentifier(ColorTableViewCell.identifier, forIndexPath: indexPath) as! ColorTableViewCell 29 | let colorTuple = colors[indexPath.row] 30 | let color = WaddaColor(values: colorTuple.rgba) 31 | cell.colorView.backgroundColor = color.color 32 | cell.colorLabel.text = colorTuple.name 33 | 34 | cell.contrastingColorView.backgroundColor = color.contrastingColor().color 35 | cell.complementaryColorView.backgroundColor = color.complementaryColor().color 36 | 37 | 38 | return cell 39 | } 40 | 41 | func tableView(tableView: UITableView, didSelectRowAtIndexPath indexPath: NSIndexPath) { 42 | tableView.deselectRowAtIndexPath(indexPath, animated: false) 43 | } 44 | 45 | func tableView(tableView: UITableView, shouldHighlightRowAtIndexPath indexPath: NSIndexPath) -> Bool { 46 | return false 47 | } 48 | } 49 | 50 | class ColorTableViewCell: UITableViewCell { 51 | static let identifier = "ColorTableViewCell" 52 | 53 | @IBOutlet weak var colorView: UIView! 54 | @IBOutlet weak var colorLabel: UILabel! 55 | @IBOutlet weak var complementaryColorView: UIView! 56 | @IBOutlet weak var contrastingColorView: UIView! 57 | 58 | override func awakeFromNib() { 59 | super.awakeFromNib() 60 | 61 | [colorView, complementaryColorView, contrastingColorView].forEach { view in 62 | view.layer.cornerRadius = view.bounds.width / 2 63 | } 64 | } 65 | } 66 | -------------------------------------------------------------------------------- /WaddaColor/WaddaColor.swift: -------------------------------------------------------------------------------- 1 | // 2 | // WaddaColor.swift 3 | // WaddaColor 4 | // 5 | // Created by Johan Sørensen on 23/02/16. 6 | // Copyright © 2016 Johan Sørensen. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | 11 | public extension UIColor { 12 | var name: String { 13 | let wadda = WaddaColor(color: self) 14 | let match = wadda.closestMatch() 15 | return match.name 16 | } 17 | } 18 | 19 | public struct ColorMatch { 20 | let name: String 21 | let values: RGBA 22 | let distance: ColorDistance 23 | } 24 | 25 | public struct WaddaColor: Equatable, CustomStringConvertible { 26 | public let values: RGBA 27 | public let colorNames = ColorThesaurusNames() 28 | 29 | public init(color: UIColor) { 30 | var red: CGFloat = 0 31 | var green: CGFloat = 0 32 | var blue: CGFloat = 0 33 | var alpha: CGFloat = 0 34 | color.getRed(&red, green: &green, blue: &blue, alpha: &alpha) 35 | self.init(r: Double(red), g: Double(green), b: Double(blue), a: Double(alpha)) 36 | } 37 | 38 | public init(r: Double, g: Double, b: Double, a: Double) { 39 | self.init(values: RGBA(r, g, b, a)) 40 | } 41 | 42 | public init(values: RGBA) { 43 | self.values = values 44 | } 45 | 46 | public var color: UIColor { 47 | return values.color 48 | } 49 | 50 | public func closestMatch() -> ColorMatch { 51 | if let perfectMatch = colorNames.filter({ k, v in v == self.values }).first { 52 | return ColorMatch(name: perfectMatch.0, values: perfectMatch.1, distance: 1.0) 53 | } 54 | 55 | // TODO: binary search based on lightness and/or saturation? 56 | 57 | let matches: [ColorMatch] = colorNames.map({ name, color in 58 | return ColorMatch(name: name, values: color, distance: color.distanceTo(self.values)) 59 | }) 60 | let sortedMatches = matches.sort({ $0.distance < $1.distance }) 61 | 62 | return sortedMatches.first! 63 | } 64 | 65 | // Returns the luma value (0.0-1.0) 66 | public var luminance: CGFloat { 67 | // http://en.wikipedia.org/wiki/Luma_(video) Y = 0.2126 R + 0.7152 G + 0.0722 B 68 | return 0.2126 * CGFloat(values.r) + 0.7152 * CGFloat(values.g) + 0.0722 * CGFloat(values.b) 69 | } 70 | 71 | public func contrastingColor() -> WaddaColor { 72 | if luminance > 0.6 { 73 | return WaddaColor(r: 0, g: 0, b: 0, a: 1.0) 74 | } else { 75 | return WaddaColor(r: 1, g: 1, b: 1, a: 1.0) 76 | } 77 | } 78 | 79 | public func complementaryColor() -> WaddaColor { 80 | if luminance < 0.1 || luminance > 0.9 { 81 | return contrastingColor() 82 | } 83 | 84 | var hue: CGFloat = 0 85 | var saturation: CGFloat = 0 86 | var brightness: CGFloat = 0 87 | var alpha: CGFloat = 0 88 | values.color.getHue(&hue, saturation: &saturation, brightness: &brightness, alpha: &alpha) 89 | 90 | let harmonicHue = abs(((hue*360.0) + (180.0/360.0)) % 360.0) 91 | 92 | let color = UIColor(hue: harmonicHue, saturation: saturation, brightness: brightness, alpha: alpha) 93 | return WaddaColor(color: color) 94 | } 95 | 96 | public var description: String { 97 | return "" 98 | } 99 | } 100 | 101 | public func ==(lhs: WaddaColor, rhs: WaddaColor) -> Bool { 102 | return lhs.values == rhs.values 103 | } 104 | -------------------------------------------------------------------------------- /WaddaColor.xcodeproj/xcuserdata/johan.xcuserdatad/xcschemes/WaddaColor.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 24 | 25 | 30 | 31 | 33 | 39 | 40 | 41 | 42 | 43 | 49 | 50 | 51 | 52 | 53 | 54 | 64 | 65 | 71 | 72 | 73 | 74 | 75 | 76 | 82 | 83 | 89 | 90 | 91 | 92 | 94 | 95 | 98 | 99 | 100 | -------------------------------------------------------------------------------- /WaddaColorTests/WaddaColorTests.swift: -------------------------------------------------------------------------------- 1 | // 2 | // WaddaColorTests.swift 3 | // WaddaColorTests 4 | // 5 | // Created by Johan Sørensen on 23/02/16. 6 | // Copyright © 2016 Johan Sørensen. All rights reserved. 7 | // 8 | 9 | import XCTest 10 | @testable import WaddaColor 11 | 12 | class WaddaColorTests: XCTestCase { 13 | 14 | func testRGBEquality() { 15 | let a = RGBA(12/255, 13/255, 14/255, 0.5) 16 | let b = RGBA(12/255, 13/255, 14/255, 0.5) 17 | XCTAssertTrue(a == b) 18 | } 19 | 20 | func testIsItBlackOrWhite() { 21 | XCTAssertEqual(UIColor.blackColor().name, "Black") 22 | XCTAssertEqual(UIColor.whiteColor().name, "Daisy") 23 | } 24 | 25 | func testBlackish() { 26 | let wadda = WaddaColor(color: UIColor(white: 0.01, alpha: 1.0)) 27 | let blackish = wadda.closestMatch() 28 | XCTAssertEqual(blackish.name, "Jade") 29 | XCTAssertEqualWithAccuracy(blackish.distance, 0.669, accuracy: 0.001) 30 | } 31 | 32 | func testWhiteish() { 33 | let wadda = WaddaColor(color: UIColor(white: 0.99, alpha: 1.0)) 34 | let whitish = wadda.closestMatch() 35 | XCTAssertEqual(whitish.name, "Daisy") 36 | XCTAssertEqualWithAccuracy(whitish.distance, 0.880, accuracy: 0.001) 37 | } 38 | 39 | func testRGBtoXYZ() { 40 | let xyz = XYZ(rgb: RGBA(0.5, 0.5, 0.5, 1.0)) 41 | XCTAssertEqualWithAccuracy(xyz.x, 20.345, accuracy: 0.001) 42 | XCTAssertEqualWithAccuracy(xyz.y, 21.404, accuracy: 0.001) 43 | XCTAssertEqualWithAccuracy(xyz.z, 23.309, accuracy: 0.001) 44 | } 45 | 46 | func testXYZtoLAB() { 47 | let xyz = XYZ(rgb: RGBA(0.5, 0.5, 0.5, 1.0)) 48 | let lab = LAB(xyz: xyz) 49 | XCTAssertEqualWithAccuracy(lab.l, 53.389, accuracy: 0.001) 50 | XCTAssertEqualWithAccuracy(lab.a, 0.003, accuracy: 0.001) 51 | XCTAssertEqualWithAccuracy(lab.b, -0.006, accuracy: 0.001) 52 | } 53 | 54 | func testRGBtoHSL() { 55 | let rgb = RGBA(128/255, 54/255, 43/255, 1.0) 56 | let hsl = HSL(rgb: rgb) 57 | XCTAssertEqualWithAccuracy(hsl.hue, 7.765, accuracy: 0.001) 58 | XCTAssertEqualWithAccuracy(hsl.saturation, 49.708, accuracy: 0.001) 59 | XCTAssertEqualWithAccuracy(hsl.lightness, 33.529, accuracy: 0.001) 60 | 61 | let redHSL = HSL(rgb: RGBA(1, 0, 0, 1)) 62 | XCTAssertEqual(redHSL.hue, 0) 63 | XCTAssertEqual(redHSL.saturation, 100) 64 | XCTAssertEqual(redHSL.lightness, 50) 65 | } 66 | 67 | func testHSLisDarkOrLight() { 68 | let dark = HSL(rgb: RGBA(33/255, 33/255, 33/255, 1.0)) 69 | XCTAssertTrue(dark.isDark()) 70 | XCTAssertFalse(dark.isLight()) 71 | 72 | let light = HSL(rgb: RGBA(243/255, 243/255, 243/255, 1.0)) 73 | XCTAssertTrue(light.isLight()) 74 | XCTAssertFalse(light.isDark()) 75 | } 76 | 77 | func testDistance() { 78 | let black = RGBA(0, 0, 0, 1.0) 79 | let almostWhite = RGBA(0.99, 0.99, 0.99, 1.0) 80 | let gray = RGBA(0.5, 0.5, 0.5, 1.0) 81 | let white = RGBA(1, 1, 1, 1.0) 82 | 83 | XCTAssertEqualWithAccuracy(black.distanceTo(white), 100.000, accuracy: 0.001) 84 | XCTAssertEqualWithAccuracy(black.distanceTo(gray), 53.389, accuracy: 0.001) 85 | XCTAssertEqualWithAccuracy(black.distanceTo(almostWhite), 99.1195, accuracy: 0.0001) 86 | XCTAssertEqual(black.distanceTo(black), 0.0) 87 | } 88 | 89 | func testLuminance() { 90 | let black = WaddaColor(r: 0, g: 0, b: 0, a: 1.0) 91 | let almostWhite = WaddaColor(r: 0.99, g: 0.99, b: 0.99, a: 1.0) 92 | let almostWhite2 = WaddaColor(r: 0.85, g: 0.85, b: 0.85, a: 1.0) 93 | let gray = WaddaColor(r: 0.5, g: 0.5, b: 0.5, a: 1.0) 94 | let white = WaddaColor(r: 1, g: 1, b: 1, a: 1.0) 95 | 96 | XCTAssertEqual(black.luminance, 0.0) 97 | XCTAssertEqual(almostWhite.luminance, 0.99) 98 | XCTAssertEqual(almostWhite2.luminance, 0.850) 99 | XCTAssertEqual(gray.luminance, 0.5) 100 | XCTAssertEqual(white.luminance, 1.0) 101 | } 102 | 103 | func testContrastingColor() { 104 | let black = WaddaColor(r: 0, g: 0, b: 0, a: 1.0) 105 | let gray = WaddaColor(r: 0.5, g: 0.5, b: 0.5, a: 1.0) 106 | let white = WaddaColor(r: 1, g: 1, b: 1, a: 1.0) 107 | let almostWhite = WaddaColor(r: 0.9, g: 0.9, b: 0.9, a: 1.0) 108 | 109 | XCTAssertEqual(black.contrastingColor().values, white.values) 110 | XCTAssertEqual(white.contrastingColor().values, black.values) 111 | XCTAssertEqual(gray.contrastingColor().values, white.values) 112 | XCTAssertEqual(almostWhite.contrastingColor().values, black.values) 113 | } 114 | 115 | func testComplementaryColor() { 116 | let red = WaddaColor(color: UIColor.redColor()) 117 | let complementary = WaddaColor(r: 0.0, g: 1.0, b: 1.0, a: 1.0) 118 | XCTAssertEqual(red.complementaryColor().values, complementary.values) 119 | 120 | let black = WaddaColor(color: UIColor.blackColor()) 121 | let complementaryBlack = WaddaColor(r: 1.0, g: 1.0, b: 1.0, a: 1.0) 122 | XCTAssertEqual(black.complementaryColor().values, complementaryBlack.values) 123 | 124 | let white = WaddaColor(color: UIColor.whiteColor()) 125 | let complementarywhite = WaddaColor(r: 0.0, g: 0.0, b: 0.0, a: 1.0) 126 | XCTAssertEqual(white.complementaryColor().values, complementarywhite.values) 127 | } 128 | } 129 | -------------------------------------------------------------------------------- /WaddaColor/ColorModels.swift: -------------------------------------------------------------------------------- 1 | // 2 | // Colorspaces.swift 3 | // WaddaColor 4 | // 5 | // Created by Johan Sørensen on 23/02/16. 6 | // Copyright © 2016 Johan Sørensen. All rights reserved. 7 | // 8 | 9 | import Foundation 10 | 11 | public typealias ColorDistance = Double 12 | 13 | private func clampedPrecondition(val: Double) { 14 | precondition(val >= 0.0 && val <= 1.0, "value (\(val) must be betweem 0.0 and 1.0)") 15 | } 16 | 17 | public struct RGBA: Equatable, CustomStringConvertible { 18 | public let r: Double // 0.0-1.0 19 | public let g: Double 20 | public let b: Double 21 | public let a: Double // 0.0-1.0 22 | 23 | // Initialize structure respresenting RGBA, where r, g, b, a should be between 0.0 and 1.0 24 | public init(_ r: Double, _ g: Double, _ b: Double, _ a: Double) { 25 | clampedPrecondition(r) 26 | clampedPrecondition(g) 27 | clampedPrecondition(b) 28 | clampedPrecondition(a) 29 | 30 | self.r = r 31 | self.g = g 32 | self.b = b 33 | self.a = a 34 | } 35 | 36 | public var color: UIColor { 37 | return UIColor(red: CGFloat(r), green: CGFloat(g), blue: CGFloat(b), alpha: CGFloat(a)) 38 | } 39 | 40 | // Returns a value between 0.0 and 100.0, where 100.0 is a perfect match 41 | public func distanceTo(other: RGBA) -> ColorDistance { 42 | let xyz1 = XYZ(rgb: self) 43 | let xyz2 = XYZ(rgb: other) 44 | let lab1 = LAB(xyz: xyz1) 45 | let lab2 = LAB(xyz: xyz2) 46 | return lab1.distance(lab2) 47 | } 48 | 49 | public var description: String { 50 | return "" 51 | } 52 | } 53 | 54 | public func ==(lhs: RGBA, rhs: RGBA) -> Bool { 55 | return lhs.r == rhs.r && lhs.g == rhs.g && lhs.b == rhs.b && lhs.a == rhs.a 56 | } 57 | 58 | public struct HSL: CustomStringConvertible { 59 | public let hue: Double //0-360 60 | public let saturation: Double // 0-100 61 | public let lightness: Double // 0-100 62 | 63 | public init(rgb: RGBA) { 64 | let maximum = max(rgb.r, max(rgb.g, rgb.b)) 65 | let minimum = min(rgb.r, min(rgb.g, rgb.b)) 66 | var h = 0.0 67 | var s = 0.0 68 | let l = (maximum + minimum) / 2.0; 69 | 70 | let delta = maximum - minimum 71 | if delta != 0 { 72 | if l > 0.5 { 73 | s = delta / (2.0 - maximum - minimum) 74 | } else { 75 | s = delta / (maximum + minimum) 76 | } 77 | if maximum == rgb.r { 78 | h = (rgb.g - rgb.b) / delta + (rgb.g < rgb.b ? 6.0 : 0) 79 | } else if maximum == rgb.g { 80 | h = (rgb.b - rgb.r) / delta + 2.0 81 | } else if maximum == rgb.b { 82 | h = (rgb.r - rgb.g) / delta + 4.0 83 | } 84 | h /= 6.0; 85 | h *= 3.6; 86 | } 87 | self.hue = h * 100.0 88 | self.saturation = s * 100.0 89 | self.lightness = l * 100.0 90 | } 91 | 92 | public func isLight(cutoff: Double = 50) -> Bool { 93 | return lightness >= cutoff 94 | } 95 | 96 | public func isDark(cutoff: Double = 50) -> Bool { 97 | return lightness <= cutoff 98 | } 99 | 100 | public var description: String { 101 | return "" 102 | } 103 | } 104 | 105 | public struct XYZ: CustomStringConvertible { 106 | public let x: Double 107 | public let y: Double 108 | public let z: Double 109 | 110 | public init(rgb: RGBA) { 111 | var red = rgb.r 112 | var green = rgb.g 113 | var blue = rgb.b 114 | 115 | if red > 0.04045 { 116 | red = (red + 0.055) / 1.055 117 | red = pow(red, 2.4) 118 | } else { 119 | red = red / 12.92 120 | } 121 | 122 | if green > 0.04045 { 123 | green = (green + 0.055) / 1.055; 124 | green = pow(green, 2.4); 125 | } else { 126 | green = green / 12.92; 127 | } 128 | 129 | if blue > 0.04045 { 130 | blue = (blue + 0.055) / 1.055; 131 | blue = pow(blue, 2.4); 132 | } else { 133 | blue = blue / 12.92; 134 | } 135 | 136 | red *= 100.0 137 | green *= 100.0 138 | blue *= 100.0 139 | 140 | self.x = red * 0.4124 + green * 0.3576 + blue * 0.1805 141 | self.y = red * 0.2126 + green * 0.7152 + blue * 0.0722 142 | self.z = red * 0.0193 + green * 0.1192 + blue * 0.9505 143 | } 144 | 145 | public var description: String { 146 | return "" 147 | } 148 | } 149 | 150 | 151 | public struct LAB: CustomStringConvertible { 152 | public let l: Double 153 | public let a: Double 154 | public let b: Double 155 | 156 | // init(l: Double, a: Double, b: Double) { 157 | // self.l = l 158 | // self.a = a 159 | // self.b = b 160 | // } 161 | 162 | public init(xyz: XYZ) { 163 | var x = xyz.x / 95.047 164 | var y = xyz.y / 100.0 165 | var z = xyz.z / 108.883 166 | 167 | if x > 0.008856 { 168 | x = pow(x, 1.0/3.0) 169 | } else { 170 | x = 7.787 * x + 16.0 / 116.0 171 | } 172 | 173 | if y > 0.008856 { 174 | y = pow(y, 1.0/3.0) 175 | } else { 176 | y = (7.787 * y) + (16.0 / 116.0) 177 | } 178 | 179 | if z > 0.008856 { 180 | z = pow(z, 1.0/3.0) 181 | } else { 182 | z = 7.787 * z + 16.0 / 116.0 183 | } 184 | 185 | self.l = 116.0 * y - 16.0 186 | self.a = 500.0 * (x - y) 187 | self.b = 200.0 * (y - z) 188 | } 189 | 190 | // CIE1994 distance 191 | public func distance(other: LAB) -> Double { 192 | let k1 = 0.045 193 | let k2 = 0.015 194 | 195 | let C1 = sqrt(a * a + b * b) 196 | let C2 = sqrt(other.a * other.a + other.b * other.b) 197 | 198 | let deltaA = a - other.a 199 | let deltaB = b - other.b 200 | let deltaC = C1 - C2 201 | let deltaH2 = deltaA * deltaA + deltaB * deltaB - deltaC * deltaC 202 | let deltaH = (deltaH2 > 0.0) ? sqrt(deltaH2) : 0.0; 203 | let deltaL = l - other.l; 204 | 205 | let sC = 1.0 + k1 * C1 206 | let sH = 1.0 + k2 * C1 207 | 208 | let vL = deltaL / 1.0 209 | let vC = deltaC / (1.0 * sC) 210 | let vH = deltaH / (1.0 * sH) 211 | 212 | let deltaE = sqrt(vL * vL + vC * vC + vH * vH) 213 | return deltaE 214 | } 215 | 216 | public var description: String { 217 | return "" 218 | } 219 | } 220 | -------------------------------------------------------------------------------- /WhatTheColor/Base.lproj/Main.storyboard: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 27 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 54 | 55 | 56 | 57 | 58 | 64 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | 110 | 111 | 112 | 113 | 114 | 115 | 116 | 117 | 118 | 119 | 120 | 121 | 122 | 123 | 130 | 136 | 137 | 138 | 139 | 140 | 141 | 142 | 143 | 144 | 145 | 146 | 147 | 148 | 149 | 150 | 151 | 152 | 153 | 154 | 155 | 156 | 157 | 158 | 159 | 160 | 161 | 162 | 163 | 164 | 165 | 166 | 167 | 168 | 169 | 170 | 171 | 172 | 173 | 174 | 175 | 176 | -------------------------------------------------------------------------------- /WaddaColor/ColorNames.swift: -------------------------------------------------------------------------------- 1 | // 2 | // ColorNames.swift 3 | // WaddaColor 4 | // 5 | // Created by Johan Sørensen on 23/02/16. 6 | // Copyright © 2016 Johan Sørensen. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | 11 | // http://ingridsundberg.com/2014/02/04/the-color-thesaurus/ 12 | public func ColorThesaurusNames() -> [String: RGBA] { 13 | return [ 14 | // Black 15 | "Black": RGBA(0.0, 0.0, 0.0, 1.0), 16 | "Ebony": RGBA(0.0313725490196078, 0.0156862745098039, 0.00392156862745098, 1.0), 17 | "Crow": RGBA(0.0745098039215686, 0.0352941176470588, 0.0235294117647059, 1.0), 18 | "Charcoal": RGBA(0.156862745098039, 0.137254901960784, 0.113725490196078, 1.0), 19 | "Midnight": RGBA(0.0, 0.0, 0.0156862745098039, 1.0), 20 | "Ink": RGBA(0.0, 0.0, 0.0, 1.0), 21 | "Raven": RGBA(0.0156862745098039, 0.0117647058823529, 0.00392156862745098, 1.0), 22 | "Oil": RGBA(0.0196078431372549, 0.00392156862745098, 0.0, 1.0), 23 | "Grease": RGBA(0.0352941176470588, 0.0313725490196078, 0.0235294117647059, 1.0), 24 | "Onyx": RGBA(0.0117647058823529, 0.00392156862745098, 0.0235294117647059, 1.0), 25 | "Pitch": RGBA(0.00784313725490196, 0.0, 0.00392156862745098, 1.0), 26 | "Soot": RGBA(0.0823529411764706, 0.0549019607843137, 0.0235294117647059, 1.0), 27 | "Sable": RGBA(0.0117647058823529, 0.00784313725490196, 0.0, 1.0), 28 | "Jet black": RGBA(0.0, 0.0, 0.0, 1.0), 29 | "Coal": RGBA(0.0666666666666667, 0.0627450980392157, 0.0313725490196078, 1.0), 30 | "Metal": RGBA(0.0745098039215686, 0.0705882352941176, 0.0627450980392157, 1.0), 31 | "Obsidian": RGBA(0.00784313725490196, 0.0156862745098039, 0.0117647058823529, 1.0), 32 | "Jade": RGBA(0.00392156862745098, 0.0117647058823529, 0.00784313725490196, 1.0), 33 | "Spider": RGBA(0.0117647058823529, 0.00784313725490196, 0.0, 1.0), 34 | "Leather": RGBA(0.0666666666666667, 0.0274509803921569, 0.0156862745098039, 1.0), 35 | // Blue 36 | "Blue": RGBA(0.227450980392157, 0.262745098039216, 0.729411764705882, 1.0), 37 | "Slate": RGBA(0.458823529411765, 0.482352941176471, 0.529411764705882, 1.0), 38 | "Sky": RGBA(0.384313725490196, 0.772549019607843, 0.854901960784314, 1.0), 39 | "Navy": RGBA(0.0431372549019608, 0.0666666666666667, 0.443137254901961, 1.0), 40 | "Indigo": RGBA(0.156862745098039, 0.117647058823529, 0.364705882352941, 1.0), 41 | "Cobalt": RGBA(0.0745098039215686, 0.219607843137255, 0.741176470588235, 1.0), 42 | "Teal": RGBA(0.282352941176471, 0.666666666666667, 0.67843137254902, 1.0), 43 | "Ocean": RGBA(0.00392156862745098, 0.376470588235294, 0.392156862745098, 1.0), 44 | "Peacock": RGBA(0.00392156862745098, 0.176470588235294, 0.211764705882353, 1.0), 45 | "Azure": RGBA(0.0862745098039216, 0.125490196078431, 0.650980392156863, 1.0), 46 | "Cerulean": RGBA(0.0156862745098039, 0.572549019607843, 0.76078431372549, 1.0), 47 | "Lapis": RGBA(0.152941176470588, 0.196078431372549, 0.76078431372549, 1.0), 48 | "Spruce": RGBA(0.172549019607843, 0.243137254901961, 0.298039215686275, 1.0), 49 | "Stone": RGBA(0.349019607843137, 0.470588235294118, 0.552941176470588, 1.0), 50 | "Aegean": RGBA(0.117647058823529, 0.270588235294118, 0.431372549019608, 1.0), 51 | "Berry": RGBA(0.141176470588235, 0.0823529411764706, 0.43921568627451, 1.0), 52 | "Denim": RGBA(0.0823529411764706, 0.117647058823529, 0.23921568627451, 1.0), 53 | "Admiral": RGBA(0.0235294117647059, 0.0627450980392157, 0.580392156862745, 1.0), 54 | "Sapphire": RGBA(0.32156862745098, 0.698039215686274, 0.752941176470588, 1.0), 55 | "Arctic": RGBA(0.509803921568627, 0.929411764705882, 0.992156862745098, 1.0), 56 | // Brown 57 | "Brown": RGBA(0.137254901960784, 0.0901960784313725, 0.0352941176470588, 1.0), 58 | "Coffee": RGBA(0.294117647058824, 0.215686274509804, 0.109803921568627, 1.0), 59 | "Mocha": RGBA(0.235294117647059, 0.156862745098039, 0.0509803921568627, 1.0), 60 | "Peanut": RGBA(0.474509803921569, 0.36078431372549, 0.203921568627451, 1.0), 61 | "Carob": RGBA(0.211764705882353, 0.149019607843137, 0.0588235294117647, 1.0), 62 | "Hickory": RGBA(0.215686274509804, 0.113725490196078, 0.0627450980392157, 1.0), 63 | "Wood": RGBA(0.247058823529412, 0.188235294117647, 0.113725490196078, 1.0), 64 | "Pecan": RGBA(0.290196078431373, 0.145098039215686, 0.0705882352941176, 1.0), 65 | "Walnut": RGBA(0.262745098039216, 0.152941176470588, 0.0666666666666667, 1.0), 66 | "Caramel": RGBA(0.396078431372549, 0.207843137254902, 0.0588235294117647, 1.0), 67 | "Gingerbread": RGBA(0.364705882352941, 0.172549019607843, 0.0156862745098039, 1.0), 68 | "Syrup": RGBA(0.27843137254902, 0.125490196078431, 0.00392156862745098, 1.0), 69 | "Chocolate": RGBA(0.172549019607843, 0.0823529411764706, 0.0117647058823529, 1.0), 70 | "Tortilla": RGBA(0.603921568627451, 0.482352941176471, 0.309803921568627, 1.0), 71 | "Umber": RGBA(0.207843137254902, 0.137254901960784, 0.0823529411764706, 1.0), 72 | "Tawny": RGBA(0.494117647058824, 0.282352941176471, 0.109803921568627, 1.0), 73 | "Brunette": RGBA(0.227450980392157, 0.117647058823529, 0.0313725490196078, 1.0), 74 | "Cinnamon": RGBA(0.388235294117647, 0.164705882352941, 0.0509803921568627, 1.0), 75 | "Penny": RGBA(0.32156862745098, 0.16078431372549, 0.0823529411764706, 1.0), 76 | "Cedar": RGBA(0.290196078431373, 0.215686274509804, 0.156862745098039, 1.0), 77 | // Green 78 | "Green": RGBA(0.231372549019608, 0.694117647058824, 0.262745098039216, 1.0), 79 | "Chartreuse": RGBA(0.690196078431373, 0.988235294117647, 0.219607843137255, 1.0), 80 | "Juniper": RGBA(0.227450980392157, 0.325490196078431, 0.0666666666666667, 1.0), 81 | "Sage": RGBA(0.447058823529412, 0.549019607843137, 0.411764705882353, 1.0), 82 | "Lime": RGBA(0.682352941176471, 0.952941176470588, 0.352941176470588, 1.0), 83 | "Fern": RGBA(0.36078431372549, 0.737254901960784, 0.388235294117647, 1.0), 84 | "Olive": RGBA(0.596078431372549, 0.749019607843137, 0.392156862745098, 1.0), 85 | "Emerald": RGBA(0.00784313725490196, 0.537254901960784, 0.0627450980392157, 1.0), 86 | "Pear": RGBA(0.454901960784314, 0.713725490196078, 0.180392156862745, 1.0), 87 | "Moss": RGBA(0.274509803921569, 0.427450980392157, 0.117647058823529, 1.0), 88 | "Shamrock": RGBA(0.0117647058823529, 0.674509803921569, 0.0745098039215686, 1.0), 89 | "Seafoam": RGBA(0.235294117647059, 0.925490196078431, 0.592156862745098, 1.0), 90 | "Pine": RGBA(0.137254901960784, 0.309803921568627, 0.117647058823529, 1.0), 91 | "Parakeet": RGBA(0.0117647058823529, 0.752941176470588, 0.290196078431373, 1.0), 92 | "Mint": RGBA(0.596078431372549, 0.929411764705882, 0.764705882352941, 1.0), 93 | "Seaweed": RGBA(0.207843137254902, 0.290196078431373, 0.129411764705882, 1.0), 94 | "Pickle": RGBA(0.349019607843137, 0.490196078431373, 0.207843137254902, 1.0), 95 | "Pistachio": RGBA(0.698039215686274, 0.827450980392157, 0.76078431372549, 1.0), 96 | "Basil": RGBA(0.196078431372549, 0.380392156862745, 0.176470588235294, 1.0), 97 | "Crocodile": RGBA(0.376470588235294, 0.490196078431373, 0.231372549019608, 1.0), 98 | // Grey 99 | "Grey": RGBA(0.423529411764706, 0.384313725490196, 0.427450980392157, 1.0), 100 | "Shadow": RGBA(0.215686274509804, 0.215686274509804, 0.215686274509804, 1.0), 101 | "Graphite": RGBA(0.345098039215686, 0.301960784313725, 0.356862745098039, 1.0), 102 | "Iron": RGBA(0.196078431372549, 0.176470588235294, 0.192156862745098, 1.0), 103 | "Pewter": RGBA(0.415686274509804, 0.407843137254902, 0.501960784313725, 1.0), 104 | "Cloud": RGBA(0.776470588235294, 0.776470588235294, 0.815686274509804, 1.0), 105 | "Silver": RGBA(0.67843137254902, 0.67843137254902, 0.780392156862745, 1.0), 106 | "Smoke": RGBA(0.349019607843137, 0.317647058823529, 0.368627450980392, 1.0), 107 | "Anchor": RGBA(0.258823529411765, 0.258823529411765, 0.298039215686275, 1.0), 108 | "Ash": RGBA(0.333333333333333, 0.298039215686275, 0.301960784313725, 1.0), 109 | "Porpoise": RGBA(0.301960784313725, 0.298039215686275, 0.36078431372549, 1.0), 110 | "Dove": RGBA(0.486274509803922, 0.431372549019608, 0.498039215686275, 1.0), 111 | "Fog": RGBA(0.396078431372549, 0.349019607843137, 0.396078431372549, 1.0), 112 | "Flint": RGBA(0.494117647058824, 0.490196078431373, 0.611764705882353, 1.0), 113 | "Pebble": RGBA(0.2, 0.2, 0.2, 1.0), 114 | "Lead": RGBA(0.250980392156863, 0.247058823529412, 0.301960784313725, 1.0), 115 | "Coin": RGBA(0.596078431372549, 0.592156862745098, 0.662745098039216, 1.0), 116 | "Fossil": RGBA(0.470588235294118, 0.447058823529412, 0.462745098039216, 1.0), 117 | // Orange 118 | "Orange": RGBA(0.929411764705882, 0.43921568627451, 0.0784313725490196, 1.0), 119 | "Tangerine": RGBA(0.976470588235294, 0.509803921568627, 0.156862745098039, 1.0), 120 | "Marigold": RGBA(0.992156862745098, 0.682352941176471, 0.113725490196078, 1.0), 121 | "Cider": RGBA(0.709803921568627, 0.403921568627451, 0.152941176470588, 1.0), 122 | "Rust": RGBA(0.549019607843137, 0.250980392156863, 0.0156862745098039, 1.0), 123 | "Ginger": RGBA(0.737254901960784, 0.337254901960784, 0.00784313725490196, 1.0), 124 | "Tiger": RGBA(0.988235294117647, 0.419607843137255, 0.00784313725490196, 1.0), 125 | "Fire": RGBA(0.866666666666667, 0.337254901960784, 0.109803921568627, 1.0), 126 | "Bronze": RGBA(0.698039215686274, 0.337254901960784, 0.0509803921568627, 1.0), 127 | "Cantaloupe": RGBA(0.988235294117647, 0.631372549019608, 0.447058823529412, 1.0), 128 | "Apricot": RGBA(0.929411764705882, 0.509803921568627, 0.0549019607843137, 1.0), 129 | "Clay": RGBA(0.498039215686275, 0.250980392156863, 0.0431372549019608, 1.0), 130 | "Honey": RGBA(0.925490196078431, 0.592156862745098, 0.0235294117647059, 1.0), 131 | "Carrot": RGBA(0.929411764705882, 0.443137254901961, 0.0901960784313725, 1.0), 132 | "Squash": RGBA(0.788235294117647, 0.36078431372549, 0.0392156862745098, 1.0), 133 | "Spice": RGBA(0.47843137254902, 0.223529411764706, 0.0117647058823529, 1.0), 134 | "Marmalade": RGBA(0.819607843137255, 0.376470588235294, 0.00784313725490196, 1.0), 135 | "Amber": RGBA(0.537254901960784, 0.192156862745098, 0.00392156862745098, 1.0), 136 | "Sandstone": RGBA(0.83921568627451, 0.443137254901961, 0.16078431372549, 1.0), 137 | "Yam": RGBA(0.8, 0.345098039215686, 0.00392156862745098, 1.0), 138 | // Pink 139 | "Pink": RGBA(0.964705882352941, 0.603921568627451, 0.803921568627451, 1.0), 140 | "Rose": RGBA(0.988235294117647, 0.580392156862745, 0.67843137254902, 1.0), 141 | "Fushcia": RGBA(0.988235294117647, 0.274509803921569, 0.666666666666667, 1.0), 142 | "Punch": RGBA(0.945098039215686, 0.32156862745098, 0.470588235294118, 1.0), 143 | "Blush": RGBA(0.996078431372549, 0.772549019607843, 0.898039215686275, 1.0), 144 | "Watermelon": RGBA(0.996078431372549, 0.498039215686275, 0.611764705882353, 1.0), 145 | "Flamingo": RGBA(0.992156862745098, 0.643137254901961, 0.72156862745098, 1.0), 146 | "Rouge": RGBA(0.949019607843137, 0.419607843137255, 0.545098039215686, 1.0), 147 | "Salmon": RGBA(0.992156862745098, 0.670588235294118, 0.623529411764706, 1.0), 148 | "Coral": RGBA(0.996078431372549, 0.490196078431373, 0.407843137254902, 1.0), 149 | "Peach": RGBA(0.984313725490196, 0.580392156862745, 0.513725490196078, 1.0), 150 | "Strawberry": RGBA(0.988235294117647, 0.298039215686275, 0.305882352941176, 1.0), 151 | "Rosewood": RGBA(0.627450980392157, 0.258823529411765, 0.258823529411765, 1.0), 152 | "Lemonade": RGBA(0.984313725490196, 0.733333333333333, 0.796078431372549, 1.0), 153 | "Taffy": RGBA(0.980392156862745, 0.525490196078431, 0.772549019607843, 1.0), 154 | "Bubblegum": RGBA(0.992156862745098, 0.36078431372549, 0.658823529411765, 1.0), 155 | "Ballet slipper": RGBA(0.964705882352941, 0.603921568627451, 0.749019607843137, 1.0), 156 | "Crepe": RGBA(0.949019607843137, 0.72156862745098, 0.776470588235294, 1.0), 157 | "Magenta": RGBA(0.882352941176471, 0.0823529411764706, 0.517647058823529, 1.0), 158 | "Hot pink": RGBA(1.0, 0.0862745098039216, 0.584313725490196, 1.0), 159 | // Purple 160 | "Purple": RGBA(0.63921568627451, 0.172549019607843, 0.768627450980392, 1.0), 161 | "Mauve": RGBA(0.47843137254902, 0.290196078431373, 0.533333333333333, 1.0), 162 | "Violet": RGBA(0.443137254901961, 0.00392156862745098, 0.576470588235294, 1.0), 163 | "Boysenberry": RGBA(0.384313725490196, 0.0156862745098039, 0.211764705882353, 1.0), 164 | "Lavender": RGBA(0.890196078431372, 0.623529411764706, 0.964705882352941, 1.0), 165 | "Plum": RGBA(0.376470588235294, 0.101960784313725, 0.211764705882353, 1.0), 166 | "Lilac": RGBA(0.713725490196078, 0.376470588235294, 0.803921568627451, 1.0), 167 | "Grape": RGBA(0.4, 0.188235294117647, 0.27843137254902, 1.0), 168 | "Periwinkle": RGBA(0.741176470588235, 0.576470588235294, 0.827450980392157, 1.0), 169 | "Sangria": RGBA(0.301960784313725, 0.0588235294117647, 0.156862745098039, 1.0), 170 | "Eggplant": RGBA(0.192156862745098, 0.0784313725490196, 0.196078431372549, 1.0), 171 | "Jam": RGBA(0.4, 0.0156862745098039, 0.176470588235294, 1.0), 172 | "Iris": RGBA(0.596078431372549, 0.4, 0.772549019607843, 1.0), 173 | "Heather": RGBA(0.607843137254902, 0.486274509803922, 0.72156862745098, 1.0), 174 | "Amethyst": RGBA(0.643137254901961, 0.368627450980392, 0.898039215686275, 1.0), 175 | "Raisin": RGBA(0.16078431372549, 0.0352941176470588, 0.0862745098039216, 1.0), 176 | "Orchid": RGBA(0.686274509803922, 0.411764705882353, 0.933333333333333, 1.0), 177 | "Mulberry": RGBA(0.298039215686275, 0.00392156862745098, 0.125490196078431, 1.0), 178 | "Wine": RGBA(0.172549019607843, 0.0196078431372549, 0.101960784313725, 1.0), 179 | // Red 180 | "Red": RGBA(0.815686274509804, 0.192156862745098, 0.176470588235294, 1.0), 181 | "Cherry": RGBA(0.6, 0.0588235294117647, 0.00784313725490196, 1.0), 182 | "Merlot": RGBA(0.329411764705882, 0.12156862745098, 0.105882352941176, 1.0), 183 | "Garnet": RGBA(0.376470588235294, 0.0431372549019608, 0.0156862745098039, 1.0), 184 | "Crimson": RGBA(0.72156862745098, 0.0588235294117647, 0.0392156862745098, 1.0), 185 | "Ruby": RGBA(0.564705882352941, 0.0235294117647059, 0.0117647058823529, 1.0), 186 | "Scarlet": RGBA(0.568627450980392, 0.0509803921568627, 0.0352941176470588, 1.0), 187 | "Brick": RGBA(0.494117647058824, 0.156862745098039, 0.0666666666666667, 1.0), 188 | "Apple": RGBA(0.662745098039216, 0.105882352941176, 0.0509803921568627, 1.0), 189 | "Mahogany": RGBA(0.258823529411765, 0.0509803921568627, 0.0352941176470588, 1.0), 190 | "Blood": RGBA(0.443137254901961, 0.0470588235294118, 0.0156862745098039, 1.0), 191 | "Currant": RGBA(0.403921568627451, 0.0470588235294118, 0.0274509803921569, 1.0), 192 | "Candy": RGBA(0.823529411764706, 0.0823529411764706, 0.00784313725490196, 1.0), 193 | "Lipstick": RGBA(0.611764705882353, 0.0627450980392157, 0.0117647058823529, 1.0), 194 | // Tan 195 | "Tan": RGBA(0.901960784313726, 0.858823529411765, 0.67843137254902, 1.0), 196 | "Beige": RGBA(0.925490196078431, 0.866666666666667, 0.603921568627451, 1.0), 197 | "Macaroon": RGBA(0.972549019607843, 0.87843137254902, 0.462745098039216, 1.0), 198 | "Hazel wood": RGBA(0.788235294117647, 0.733333333333333, 0.556862745098039, 1.0), 199 | "Granola": RGBA(0.83921568627451, 0.717647058823529, 0.352941176470588, 1.0), 200 | "Oat": RGBA(0.870588235294118, 0.788235294117647, 0.541176470588235, 1.0), 201 | "Egg nog": RGBA(0.980392156862745, 0.886274509803922, 0.603921568627451, 1.0), 202 | "Fawn": RGBA(0.780392156862745, 0.662745098039216, 0.317647058823529, 1.0), 203 | "Sugar cookie": RGBA(0.952941176470588, 0.92156862745098, 0.67843137254902, 1.0), 204 | "Sand": RGBA(0.843137254901961, 0.725490196078431, 0.388235294117647, 1.0), 205 | "Sepia": RGBA(0.890196078431372, 0.717647058823529, 0.470588235294118, 1.0), 206 | "Latte": RGBA(0.874509803921569, 0.756862745098039, 0.482352941176471, 1.0), 207 | "Oyster": RGBA(0.862745098039216, 0.843137254901961, 0.627450980392157, 1.0), 208 | "Biscotti": RGBA(0.890196078431372, 0.772549019607843, 0.396078431372549, 1.0), 209 | "Parmesan": RGBA(0.992156862745098, 0.913725490196078, 0.572549019607843, 1.0), 210 | "Hazelnut": RGBA(0.741176470588235, 0.647058823529412, 0.364705882352941, 1.0), 211 | "Sandcastle": RGBA(0.854901960784314, 0.76078431372549, 0.486274509803922, 1.0), 212 | "Buttermilk": RGBA(0.992156862745098, 0.937254901960784, 0.698039215686274, 1.0), 213 | "Sand dollar": RGBA(0.925490196078431, 0.909803921568627, 0.725490196078431, 1.0), 214 | "Shortbread": RGBA(0.984313725490196, 0.905882352941176, 0.564705882352941, 1.0), 215 | // White 216 | "White": RGBA(1.0, 0.996078431372549, 0.988235294117647, 1.0), 217 | "Pearl": RGBA(0.984313725490196, 0.988235294117647, 0.968627450980392, 1.0), 218 | "Alabaster": RGBA(0.996078431372549, 0.980392156862745, 0.945098039215686, 1.0), 219 | "Snow": RGBA(0.96078431372549, 0.996078431372549, 0.992156862745098, 1.0), 220 | "Ivory": RGBA(0.992156862745098, 0.964705882352941, 0.894117647058824, 1.0), 221 | "Cream": RGBA(1.0, 0.980392156862745, 0.854901960784314, 1.0), 222 | "Egg Shell": RGBA(0.996078431372549, 0.976470588235294, 0.890196078431372, 1.0), 223 | "Cotton": RGBA(0.984313725490196, 0.988235294117647, 0.968627450980392, 1.0), 224 | "Chiffon": RGBA(0.980392156862745, 0.980392156862745, 0.949019607843137, 1.0), 225 | "Salt": RGBA(0.968627450980392, 0.937254901960784, 0.925490196078431, 1.0), 226 | "Lace": RGBA(0.980392156862745, 0.952941176470588, 0.92156862745098, 1.0), 227 | "Coconut": RGBA(1.0, 0.945098039215686, 0.901960784313726, 1.0), 228 | "Linen": RGBA(0.949019607843137, 0.917647058823529, 0.827450980392157, 1.0), 229 | "Bone": RGBA(0.905882352941176, 0.874509803921569, 0.8, 1.0), 230 | "Daisy": RGBA(1.0, 1.0, 1.0, 1.0), 231 | "Powder": RGBA(0.984313725490196, 0.988235294117647, 0.968627450980392, 1.0), 232 | "Frost": RGBA(0.925490196078431, 0.988235294117647, 0.988235294117647, 1.0), 233 | "Porcelain": RGBA(1.0, 0.996078431372549, 0.988235294117647, 1.0), 234 | "Parchment": RGBA(0.984313725490196, 0.96078431372549, 0.874509803921569, 1.0), 235 | "Rice": RGBA(0.980392156862745, 0.96078431372549, 0.937254901960784, 1.0), 236 | // Yellow 237 | "Yellow": RGBA(0.992156862745098, 0.901960784313726, 0.294117647058824, 1.0), 238 | "Canary": RGBA(0.976470588235294, 0.784313725490196, 0.00784313725490196, 1.0), 239 | "Gold": RGBA(0.976470588235294, 0.650980392156863, 0.00784313725490196, 1.0), 240 | "Daffodil": RGBA(0.992156862745098, 0.933333333333333, 0.529411764705882, 1.0), 241 | "Flaxen": RGBA(0.83921568627451, 0.717647058823529, 0.352941176470588, 1.0), 242 | "Butter": RGBA(0.996078431372549, 0.886274509803922, 0.152941176470588, 1.0), 243 | "Lemon": RGBA(0.937254901960784, 0.992156862745098, 0.372549019607843, 1.0), 244 | "Mustard": RGBA(0.909803921568627, 0.72156862745098, 0.156862745098039, 1.0), 245 | "Corn": RGBA(0.894117647058824, 0.803921568627451, 0.0196078431372549, 1.0), 246 | "Medallion": RGBA(0.890196078431372, 0.694117647058824, 0.0156862745098039, 1.0), 247 | "Dandelion": RGBA(0.992156862745098, 0.807843137254902, 0.164705882352941, 1.0), 248 | "Bumblebee": RGBA(0.988235294117647, 0.886274509803922, 0.0196078431372549, 1.0), 249 | "Banana": RGBA(0.988235294117647, 0.956862745098039, 0.63921568627451, 1.0), 250 | "Butterscotch": RGBA(0.980392156862745, 0.741176470588235, 0.00784313725490196, 1.0), 251 | "Dijon": RGBA(0.76078431372549, 0.572549019607843, 0.0, 1.0), 252 | "Blonde": RGBA(0.996078431372549, 0.92156862745098, 0.458823529411765, 1.0), 253 | "Pineapple": RGBA(0.996078431372549, 0.886274509803922, 0.152941176470588, 1.0), 254 | "Tuscan sun": RGBA(0.988235294117647, 0.819607843137255, 0.164705882352941, 1.0), 255 | ] 256 | } 257 | -------------------------------------------------------------------------------- /WaddaColor.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 46; 7 | objects = { 8 | 9 | /* Begin PBXBuildFile section */ 10 | 04E381BA1C7CF76B0050A0DB /* WaddaColor.h in Headers */ = {isa = PBXBuildFile; fileRef = 04E381B91C7CF76B0050A0DB /* WaddaColor.h */; settings = {ATTRIBUTES = (Public, ); }; }; 11 | 04E381C11C7CF76B0050A0DB /* WaddaColor.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 04E381B61C7CF76B0050A0DB /* WaddaColor.framework */; }; 12 | 04E381C61C7CF76B0050A0DB /* WaddaColorTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 04E381C51C7CF76B0050A0DB /* WaddaColorTests.swift */; }; 13 | 04E381D11C7CF7910050A0DB /* WaddaColor.swift in Sources */ = {isa = PBXBuildFile; fileRef = 04E381D01C7CF7910050A0DB /* WaddaColor.swift */; }; 14 | 04E381D31C7CF7F10050A0DB /* ColorNames.swift in Sources */ = {isa = PBXBuildFile; fileRef = 04E381D21C7CF7F10050A0DB /* ColorNames.swift */; }; 15 | 04E381D51C7D135F0050A0DB /* ColorModels.swift in Sources */ = {isa = PBXBuildFile; fileRef = 04E381D41C7D135F0050A0DB /* ColorModels.swift */; }; 16 | 04E381DF1C7E4B560050A0DB /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 04E381DE1C7E4B560050A0DB /* AppDelegate.swift */; }; 17 | 04E381E11C7E4B560050A0DB /* FirstViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 04E381E01C7E4B560050A0DB /* FirstViewController.swift */; }; 18 | 04E381E31C7E4B560050A0DB /* SecondViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 04E381E21C7E4B560050A0DB /* SecondViewController.swift */; }; 19 | 04E381E61C7E4B560050A0DB /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 04E381E41C7E4B560050A0DB /* Main.storyboard */; }; 20 | 04E381E81C7E4B560050A0DB /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 04E381E71C7E4B560050A0DB /* Assets.xcassets */; }; 21 | 04E381EB1C7E4B560050A0DB /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 04E381E91C7E4B560050A0DB /* LaunchScreen.storyboard */; }; 22 | /* End PBXBuildFile section */ 23 | 24 | /* Begin PBXContainerItemProxy section */ 25 | 04E381C21C7CF76B0050A0DB /* PBXContainerItemProxy */ = { 26 | isa = PBXContainerItemProxy; 27 | containerPortal = 04E381AD1C7CF76B0050A0DB /* Project object */; 28 | proxyType = 1; 29 | remoteGlobalIDString = 04E381B51C7CF76B0050A0DB; 30 | remoteInfo = WaddaColor; 31 | }; 32 | /* End PBXContainerItemProxy section */ 33 | 34 | /* Begin PBXFileReference section */ 35 | 04E381B61C7CF76B0050A0DB /* WaddaColor.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = WaddaColor.framework; sourceTree = BUILT_PRODUCTS_DIR; }; 36 | 04E381B91C7CF76B0050A0DB /* WaddaColor.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = WaddaColor.h; sourceTree = ""; }; 37 | 04E381BB1C7CF76B0050A0DB /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 38 | 04E381C01C7CF76B0050A0DB /* WaddaColorTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = WaddaColorTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; 39 | 04E381C51C7CF76B0050A0DB /* WaddaColorTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = WaddaColorTests.swift; sourceTree = ""; }; 40 | 04E381C71C7CF76B0050A0DB /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 41 | 04E381D01C7CF7910050A0DB /* WaddaColor.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = WaddaColor.swift; sourceTree = ""; }; 42 | 04E381D21C7CF7F10050A0DB /* ColorNames.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ColorNames.swift; sourceTree = ""; }; 43 | 04E381D41C7D135F0050A0DB /* ColorModels.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ColorModels.swift; sourceTree = ""; }; 44 | 04E381DC1C7E4B560050A0DB /* WhatTheColor.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = WhatTheColor.app; sourceTree = BUILT_PRODUCTS_DIR; }; 45 | 04E381DE1C7E4B560050A0DB /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; 46 | 04E381E01C7E4B560050A0DB /* FirstViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = FirstViewController.swift; sourceTree = ""; }; 47 | 04E381E21C7E4B560050A0DB /* SecondViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SecondViewController.swift; sourceTree = ""; }; 48 | 04E381E51C7E4B560050A0DB /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; 49 | 04E381E71C7E4B560050A0DB /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; 50 | 04E381EA1C7E4B560050A0DB /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; 51 | 04E381EC1C7E4B560050A0DB /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 52 | 04E381F01C7E5CB30050A0DB /* README.md */ = {isa = PBXFileReference; lastKnownFileType = net.daringfireball.markdown; path = README.md; sourceTree = ""; }; 53 | /* End PBXFileReference section */ 54 | 55 | /* Begin PBXFrameworksBuildPhase section */ 56 | 04E381B21C7CF76B0050A0DB /* Frameworks */ = { 57 | isa = PBXFrameworksBuildPhase; 58 | buildActionMask = 2147483647; 59 | files = ( 60 | ); 61 | runOnlyForDeploymentPostprocessing = 0; 62 | }; 63 | 04E381BD1C7CF76B0050A0DB /* Frameworks */ = { 64 | isa = PBXFrameworksBuildPhase; 65 | buildActionMask = 2147483647; 66 | files = ( 67 | 04E381C11C7CF76B0050A0DB /* WaddaColor.framework in Frameworks */, 68 | ); 69 | runOnlyForDeploymentPostprocessing = 0; 70 | }; 71 | 04E381D91C7E4B560050A0DB /* Frameworks */ = { 72 | isa = PBXFrameworksBuildPhase; 73 | buildActionMask = 2147483647; 74 | files = ( 75 | ); 76 | runOnlyForDeploymentPostprocessing = 0; 77 | }; 78 | /* End PBXFrameworksBuildPhase section */ 79 | 80 | /* Begin PBXGroup section */ 81 | 04E381AC1C7CF76B0050A0DB = { 82 | isa = PBXGroup; 83 | children = ( 84 | 04E381F01C7E5CB30050A0DB /* README.md */, 85 | 04E381B81C7CF76B0050A0DB /* WaddaColor */, 86 | 04E381C41C7CF76B0050A0DB /* WaddaColorTests */, 87 | 04E381DD1C7E4B560050A0DB /* WhatTheColor */, 88 | 04E381B71C7CF76B0050A0DB /* Products */, 89 | ); 90 | sourceTree = ""; 91 | }; 92 | 04E381B71C7CF76B0050A0DB /* Products */ = { 93 | isa = PBXGroup; 94 | children = ( 95 | 04E381B61C7CF76B0050A0DB /* WaddaColor.framework */, 96 | 04E381C01C7CF76B0050A0DB /* WaddaColorTests.xctest */, 97 | 04E381DC1C7E4B560050A0DB /* WhatTheColor.app */, 98 | ); 99 | name = Products; 100 | sourceTree = ""; 101 | }; 102 | 04E381B81C7CF76B0050A0DB /* WaddaColor */ = { 103 | isa = PBXGroup; 104 | children = ( 105 | 04E381B91C7CF76B0050A0DB /* WaddaColor.h */, 106 | 04E381BB1C7CF76B0050A0DB /* Info.plist */, 107 | 04E381D01C7CF7910050A0DB /* WaddaColor.swift */, 108 | 04E381D41C7D135F0050A0DB /* ColorModels.swift */, 109 | 04E381D21C7CF7F10050A0DB /* ColorNames.swift */, 110 | ); 111 | path = WaddaColor; 112 | sourceTree = ""; 113 | }; 114 | 04E381C41C7CF76B0050A0DB /* WaddaColorTests */ = { 115 | isa = PBXGroup; 116 | children = ( 117 | 04E381C51C7CF76B0050A0DB /* WaddaColorTests.swift */, 118 | 04E381C71C7CF76B0050A0DB /* Info.plist */, 119 | ); 120 | path = WaddaColorTests; 121 | sourceTree = ""; 122 | }; 123 | 04E381DD1C7E4B560050A0DB /* WhatTheColor */ = { 124 | isa = PBXGroup; 125 | children = ( 126 | 04E381DE1C7E4B560050A0DB /* AppDelegate.swift */, 127 | 04E381E01C7E4B560050A0DB /* FirstViewController.swift */, 128 | 04E381E21C7E4B560050A0DB /* SecondViewController.swift */, 129 | 04E381E41C7E4B560050A0DB /* Main.storyboard */, 130 | 04E381E71C7E4B560050A0DB /* Assets.xcassets */, 131 | 04E381E91C7E4B560050A0DB /* LaunchScreen.storyboard */, 132 | 04E381EC1C7E4B560050A0DB /* Info.plist */, 133 | ); 134 | path = WhatTheColor; 135 | sourceTree = ""; 136 | }; 137 | /* End PBXGroup section */ 138 | 139 | /* Begin PBXHeadersBuildPhase section */ 140 | 04E381B31C7CF76B0050A0DB /* Headers */ = { 141 | isa = PBXHeadersBuildPhase; 142 | buildActionMask = 2147483647; 143 | files = ( 144 | 04E381BA1C7CF76B0050A0DB /* WaddaColor.h in Headers */, 145 | ); 146 | runOnlyForDeploymentPostprocessing = 0; 147 | }; 148 | /* End PBXHeadersBuildPhase section */ 149 | 150 | /* Begin PBXNativeTarget section */ 151 | 04E381B51C7CF76B0050A0DB /* WaddaColor */ = { 152 | isa = PBXNativeTarget; 153 | buildConfigurationList = 04E381CA1C7CF76B0050A0DB /* Build configuration list for PBXNativeTarget "WaddaColor" */; 154 | buildPhases = ( 155 | 04E381B11C7CF76B0050A0DB /* Sources */, 156 | 04E381B21C7CF76B0050A0DB /* Frameworks */, 157 | 04E381B31C7CF76B0050A0DB /* Headers */, 158 | 04E381B41C7CF76B0050A0DB /* Resources */, 159 | ); 160 | buildRules = ( 161 | ); 162 | dependencies = ( 163 | ); 164 | name = WaddaColor; 165 | productName = WaddaColor; 166 | productReference = 04E381B61C7CF76B0050A0DB /* WaddaColor.framework */; 167 | productType = "com.apple.product-type.framework"; 168 | }; 169 | 04E381BF1C7CF76B0050A0DB /* WaddaColorTests */ = { 170 | isa = PBXNativeTarget; 171 | buildConfigurationList = 04E381CD1C7CF76B0050A0DB /* Build configuration list for PBXNativeTarget "WaddaColorTests" */; 172 | buildPhases = ( 173 | 04E381BC1C7CF76B0050A0DB /* Sources */, 174 | 04E381BD1C7CF76B0050A0DB /* Frameworks */, 175 | 04E381BE1C7CF76B0050A0DB /* Resources */, 176 | ); 177 | buildRules = ( 178 | ); 179 | dependencies = ( 180 | 04E381C31C7CF76B0050A0DB /* PBXTargetDependency */, 181 | ); 182 | name = WaddaColorTests; 183 | productName = WaddaColorTests; 184 | productReference = 04E381C01C7CF76B0050A0DB /* WaddaColorTests.xctest */; 185 | productType = "com.apple.product-type.bundle.unit-test"; 186 | }; 187 | 04E381DB1C7E4B560050A0DB /* WhatTheColor */ = { 188 | isa = PBXNativeTarget; 189 | buildConfigurationList = 04E381EF1C7E4B560050A0DB /* Build configuration list for PBXNativeTarget "WhatTheColor" */; 190 | buildPhases = ( 191 | 04E381D81C7E4B560050A0DB /* Sources */, 192 | 04E381D91C7E4B560050A0DB /* Frameworks */, 193 | 04E381DA1C7E4B560050A0DB /* Resources */, 194 | ); 195 | buildRules = ( 196 | ); 197 | dependencies = ( 198 | ); 199 | name = WhatTheColor; 200 | productName = WhatTheColor; 201 | productReference = 04E381DC1C7E4B560050A0DB /* WhatTheColor.app */; 202 | productType = "com.apple.product-type.application"; 203 | }; 204 | /* End PBXNativeTarget section */ 205 | 206 | /* Begin PBXProject section */ 207 | 04E381AD1C7CF76B0050A0DB /* Project object */ = { 208 | isa = PBXProject; 209 | attributes = { 210 | LastSwiftUpdateCheck = 0720; 211 | LastUpgradeCheck = 0720; 212 | ORGANIZATIONNAME = "Johan Sørensen"; 213 | TargetAttributes = { 214 | 04E381B51C7CF76B0050A0DB = { 215 | CreatedOnToolsVersion = 7.2; 216 | }; 217 | 04E381BF1C7CF76B0050A0DB = { 218 | CreatedOnToolsVersion = 7.2; 219 | }; 220 | 04E381DB1C7E4B560050A0DB = { 221 | CreatedOnToolsVersion = 7.2; 222 | }; 223 | }; 224 | }; 225 | buildConfigurationList = 04E381B01C7CF76B0050A0DB /* Build configuration list for PBXProject "WaddaColor" */; 226 | compatibilityVersion = "Xcode 3.2"; 227 | developmentRegion = English; 228 | hasScannedForEncodings = 0; 229 | knownRegions = ( 230 | en, 231 | Base, 232 | ); 233 | mainGroup = 04E381AC1C7CF76B0050A0DB; 234 | productRefGroup = 04E381B71C7CF76B0050A0DB /* Products */; 235 | projectDirPath = ""; 236 | projectRoot = ""; 237 | targets = ( 238 | 04E381B51C7CF76B0050A0DB /* WaddaColor */, 239 | 04E381BF1C7CF76B0050A0DB /* WaddaColorTests */, 240 | 04E381DB1C7E4B560050A0DB /* WhatTheColor */, 241 | ); 242 | }; 243 | /* End PBXProject section */ 244 | 245 | /* Begin PBXResourcesBuildPhase section */ 246 | 04E381B41C7CF76B0050A0DB /* Resources */ = { 247 | isa = PBXResourcesBuildPhase; 248 | buildActionMask = 2147483647; 249 | files = ( 250 | ); 251 | runOnlyForDeploymentPostprocessing = 0; 252 | }; 253 | 04E381BE1C7CF76B0050A0DB /* Resources */ = { 254 | isa = PBXResourcesBuildPhase; 255 | buildActionMask = 2147483647; 256 | files = ( 257 | ); 258 | runOnlyForDeploymentPostprocessing = 0; 259 | }; 260 | 04E381DA1C7E4B560050A0DB /* Resources */ = { 261 | isa = PBXResourcesBuildPhase; 262 | buildActionMask = 2147483647; 263 | files = ( 264 | 04E381EB1C7E4B560050A0DB /* LaunchScreen.storyboard in Resources */, 265 | 04E381E81C7E4B560050A0DB /* Assets.xcassets in Resources */, 266 | 04E381E61C7E4B560050A0DB /* Main.storyboard in Resources */, 267 | ); 268 | runOnlyForDeploymentPostprocessing = 0; 269 | }; 270 | /* End PBXResourcesBuildPhase section */ 271 | 272 | /* Begin PBXSourcesBuildPhase section */ 273 | 04E381B11C7CF76B0050A0DB /* Sources */ = { 274 | isa = PBXSourcesBuildPhase; 275 | buildActionMask = 2147483647; 276 | files = ( 277 | 04E381D31C7CF7F10050A0DB /* ColorNames.swift in Sources */, 278 | 04E381D11C7CF7910050A0DB /* WaddaColor.swift in Sources */, 279 | 04E381D51C7D135F0050A0DB /* ColorModels.swift in Sources */, 280 | ); 281 | runOnlyForDeploymentPostprocessing = 0; 282 | }; 283 | 04E381BC1C7CF76B0050A0DB /* Sources */ = { 284 | isa = PBXSourcesBuildPhase; 285 | buildActionMask = 2147483647; 286 | files = ( 287 | 04E381C61C7CF76B0050A0DB /* WaddaColorTests.swift in Sources */, 288 | ); 289 | runOnlyForDeploymentPostprocessing = 0; 290 | }; 291 | 04E381D81C7E4B560050A0DB /* Sources */ = { 292 | isa = PBXSourcesBuildPhase; 293 | buildActionMask = 2147483647; 294 | files = ( 295 | 04E381E31C7E4B560050A0DB /* SecondViewController.swift in Sources */, 296 | 04E381DF1C7E4B560050A0DB /* AppDelegate.swift in Sources */, 297 | 04E381E11C7E4B560050A0DB /* FirstViewController.swift in Sources */, 298 | ); 299 | runOnlyForDeploymentPostprocessing = 0; 300 | }; 301 | /* End PBXSourcesBuildPhase section */ 302 | 303 | /* Begin PBXTargetDependency section */ 304 | 04E381C31C7CF76B0050A0DB /* PBXTargetDependency */ = { 305 | isa = PBXTargetDependency; 306 | target = 04E381B51C7CF76B0050A0DB /* WaddaColor */; 307 | targetProxy = 04E381C21C7CF76B0050A0DB /* PBXContainerItemProxy */; 308 | }; 309 | /* End PBXTargetDependency section */ 310 | 311 | /* Begin PBXVariantGroup section */ 312 | 04E381E41C7E4B560050A0DB /* Main.storyboard */ = { 313 | isa = PBXVariantGroup; 314 | children = ( 315 | 04E381E51C7E4B560050A0DB /* Base */, 316 | ); 317 | name = Main.storyboard; 318 | sourceTree = ""; 319 | }; 320 | 04E381E91C7E4B560050A0DB /* LaunchScreen.storyboard */ = { 321 | isa = PBXVariantGroup; 322 | children = ( 323 | 04E381EA1C7E4B560050A0DB /* Base */, 324 | ); 325 | name = LaunchScreen.storyboard; 326 | sourceTree = ""; 327 | }; 328 | /* End PBXVariantGroup section */ 329 | 330 | /* Begin XCBuildConfiguration section */ 331 | 04E381C81C7CF76B0050A0DB /* Debug */ = { 332 | isa = XCBuildConfiguration; 333 | buildSettings = { 334 | ALWAYS_SEARCH_USER_PATHS = NO; 335 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 336 | CLANG_CXX_LIBRARY = "libc++"; 337 | CLANG_ENABLE_MODULES = YES; 338 | CLANG_ENABLE_OBJC_ARC = YES; 339 | CLANG_WARN_BOOL_CONVERSION = YES; 340 | CLANG_WARN_CONSTANT_CONVERSION = YES; 341 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 342 | CLANG_WARN_EMPTY_BODY = YES; 343 | CLANG_WARN_ENUM_CONVERSION = YES; 344 | CLANG_WARN_INT_CONVERSION = YES; 345 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 346 | CLANG_WARN_UNREACHABLE_CODE = YES; 347 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 348 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 349 | COPY_PHASE_STRIP = NO; 350 | CURRENT_PROJECT_VERSION = 1; 351 | DEBUG_INFORMATION_FORMAT = dwarf; 352 | ENABLE_STRICT_OBJC_MSGSEND = YES; 353 | ENABLE_TESTABILITY = YES; 354 | GCC_C_LANGUAGE_STANDARD = gnu99; 355 | GCC_DYNAMIC_NO_PIC = NO; 356 | GCC_NO_COMMON_BLOCKS = YES; 357 | GCC_OPTIMIZATION_LEVEL = 0; 358 | GCC_PREPROCESSOR_DEFINITIONS = ( 359 | "DEBUG=1", 360 | "$(inherited)", 361 | ); 362 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 363 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 364 | GCC_WARN_UNDECLARED_SELECTOR = YES; 365 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 366 | GCC_WARN_UNUSED_FUNCTION = YES; 367 | GCC_WARN_UNUSED_VARIABLE = YES; 368 | IPHONEOS_DEPLOYMENT_TARGET = 9.2; 369 | MTL_ENABLE_DEBUG_INFO = YES; 370 | ONLY_ACTIVE_ARCH = YES; 371 | SDKROOT = iphoneos; 372 | SWIFT_OPTIMIZATION_LEVEL = "-Onone"; 373 | TARGETED_DEVICE_FAMILY = "1,2"; 374 | VERSIONING_SYSTEM = "apple-generic"; 375 | VERSION_INFO_PREFIX = ""; 376 | }; 377 | name = Debug; 378 | }; 379 | 04E381C91C7CF76B0050A0DB /* Release */ = { 380 | isa = XCBuildConfiguration; 381 | buildSettings = { 382 | ALWAYS_SEARCH_USER_PATHS = NO; 383 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 384 | CLANG_CXX_LIBRARY = "libc++"; 385 | CLANG_ENABLE_MODULES = YES; 386 | CLANG_ENABLE_OBJC_ARC = YES; 387 | CLANG_WARN_BOOL_CONVERSION = YES; 388 | CLANG_WARN_CONSTANT_CONVERSION = YES; 389 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 390 | CLANG_WARN_EMPTY_BODY = YES; 391 | CLANG_WARN_ENUM_CONVERSION = YES; 392 | CLANG_WARN_INT_CONVERSION = YES; 393 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 394 | CLANG_WARN_UNREACHABLE_CODE = YES; 395 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 396 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 397 | COPY_PHASE_STRIP = NO; 398 | CURRENT_PROJECT_VERSION = 1; 399 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; 400 | ENABLE_NS_ASSERTIONS = NO; 401 | ENABLE_STRICT_OBJC_MSGSEND = YES; 402 | GCC_C_LANGUAGE_STANDARD = gnu99; 403 | GCC_NO_COMMON_BLOCKS = YES; 404 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 405 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 406 | GCC_WARN_UNDECLARED_SELECTOR = YES; 407 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 408 | GCC_WARN_UNUSED_FUNCTION = YES; 409 | GCC_WARN_UNUSED_VARIABLE = YES; 410 | IPHONEOS_DEPLOYMENT_TARGET = 9.2; 411 | MTL_ENABLE_DEBUG_INFO = NO; 412 | SDKROOT = iphoneos; 413 | TARGETED_DEVICE_FAMILY = "1,2"; 414 | VALIDATE_PRODUCT = YES; 415 | VERSIONING_SYSTEM = "apple-generic"; 416 | VERSION_INFO_PREFIX = ""; 417 | }; 418 | name = Release; 419 | }; 420 | 04E381CB1C7CF76B0050A0DB /* Debug */ = { 421 | isa = XCBuildConfiguration; 422 | buildSettings = { 423 | CLANG_ENABLE_MODULES = YES; 424 | DEFINES_MODULE = YES; 425 | DYLIB_COMPATIBILITY_VERSION = 1; 426 | DYLIB_CURRENT_VERSION = 1; 427 | DYLIB_INSTALL_NAME_BASE = "@rpath"; 428 | INFOPLIST_FILE = WaddaColor/Info.plist; 429 | INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; 430 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; 431 | PRODUCT_BUNDLE_IDENTIFIER = com.johansorensen.WaddaColor; 432 | PRODUCT_NAME = "$(TARGET_NAME)"; 433 | SKIP_INSTALL = YES; 434 | SWIFT_OPTIMIZATION_LEVEL = "-Onone"; 435 | }; 436 | name = Debug; 437 | }; 438 | 04E381CC1C7CF76B0050A0DB /* Release */ = { 439 | isa = XCBuildConfiguration; 440 | buildSettings = { 441 | CLANG_ENABLE_MODULES = YES; 442 | DEFINES_MODULE = YES; 443 | DYLIB_COMPATIBILITY_VERSION = 1; 444 | DYLIB_CURRENT_VERSION = 1; 445 | DYLIB_INSTALL_NAME_BASE = "@rpath"; 446 | INFOPLIST_FILE = WaddaColor/Info.plist; 447 | INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; 448 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; 449 | PRODUCT_BUNDLE_IDENTIFIER = com.johansorensen.WaddaColor; 450 | PRODUCT_NAME = "$(TARGET_NAME)"; 451 | SKIP_INSTALL = YES; 452 | }; 453 | name = Release; 454 | }; 455 | 04E381CE1C7CF76B0050A0DB /* Debug */ = { 456 | isa = XCBuildConfiguration; 457 | buildSettings = { 458 | INFOPLIST_FILE = WaddaColorTests/Info.plist; 459 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; 460 | PRODUCT_BUNDLE_IDENTIFIER = com.johansorensen.WaddaColorTests; 461 | PRODUCT_NAME = "$(TARGET_NAME)"; 462 | }; 463 | name = Debug; 464 | }; 465 | 04E381CF1C7CF76B0050A0DB /* Release */ = { 466 | isa = XCBuildConfiguration; 467 | buildSettings = { 468 | INFOPLIST_FILE = WaddaColorTests/Info.plist; 469 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; 470 | PRODUCT_BUNDLE_IDENTIFIER = com.johansorensen.WaddaColorTests; 471 | PRODUCT_NAME = "$(TARGET_NAME)"; 472 | }; 473 | name = Release; 474 | }; 475 | 04E381ED1C7E4B560050A0DB /* Debug */ = { 476 | isa = XCBuildConfiguration; 477 | buildSettings = { 478 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 479 | INFOPLIST_FILE = WhatTheColor/Info.plist; 480 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 481 | PRODUCT_BUNDLE_IDENTIFIER = com.johansorensen.WhatTheColor; 482 | PRODUCT_NAME = "$(TARGET_NAME)"; 483 | }; 484 | name = Debug; 485 | }; 486 | 04E381EE1C7E4B560050A0DB /* Release */ = { 487 | isa = XCBuildConfiguration; 488 | buildSettings = { 489 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 490 | INFOPLIST_FILE = WhatTheColor/Info.plist; 491 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 492 | PRODUCT_BUNDLE_IDENTIFIER = com.johansorensen.WhatTheColor; 493 | PRODUCT_NAME = "$(TARGET_NAME)"; 494 | }; 495 | name = Release; 496 | }; 497 | /* End XCBuildConfiguration section */ 498 | 499 | /* Begin XCConfigurationList section */ 500 | 04E381B01C7CF76B0050A0DB /* Build configuration list for PBXProject "WaddaColor" */ = { 501 | isa = XCConfigurationList; 502 | buildConfigurations = ( 503 | 04E381C81C7CF76B0050A0DB /* Debug */, 504 | 04E381C91C7CF76B0050A0DB /* Release */, 505 | ); 506 | defaultConfigurationIsVisible = 0; 507 | defaultConfigurationName = Release; 508 | }; 509 | 04E381CA1C7CF76B0050A0DB /* Build configuration list for PBXNativeTarget "WaddaColor" */ = { 510 | isa = XCConfigurationList; 511 | buildConfigurations = ( 512 | 04E381CB1C7CF76B0050A0DB /* Debug */, 513 | 04E381CC1C7CF76B0050A0DB /* Release */, 514 | ); 515 | defaultConfigurationIsVisible = 0; 516 | defaultConfigurationName = Release; 517 | }; 518 | 04E381CD1C7CF76B0050A0DB /* Build configuration list for PBXNativeTarget "WaddaColorTests" */ = { 519 | isa = XCConfigurationList; 520 | buildConfigurations = ( 521 | 04E381CE1C7CF76B0050A0DB /* Debug */, 522 | 04E381CF1C7CF76B0050A0DB /* Release */, 523 | ); 524 | defaultConfigurationIsVisible = 0; 525 | defaultConfigurationName = Release; 526 | }; 527 | 04E381EF1C7E4B560050A0DB /* Build configuration list for PBXNativeTarget "WhatTheColor" */ = { 528 | isa = XCConfigurationList; 529 | buildConfigurations = ( 530 | 04E381ED1C7E4B560050A0DB /* Debug */, 531 | 04E381EE1C7E4B560050A0DB /* Release */, 532 | ); 533 | defaultConfigurationIsVisible = 0; 534 | defaultConfigurationName = Release; 535 | }; 536 | /* End XCConfigurationList section */ 537 | }; 538 | rootObject = 04E381AD1C7CF76B0050A0DB /* Project object */; 539 | } 540 | --------------------------------------------------------------------------------