├── .gitignore ├── Demo ├── AppDelegate.swift ├── Base.lproj │ ├── LaunchScreen.xib │ └── Main.storyboard ├── DetailViewController.swift ├── HueExtension.swift ├── Images.xcassets │ └── AppIcon.appiconset │ │ └── Contents.json ├── Info.plist ├── NameOfColor.swift ├── SettingViewController.swift ├── ViewController.swift └── third-party │ └── ntc.js ├── LICENSE ├── Package.swift ├── README.md ├── RandomColor ├── ColorDefinition.swift ├── Hue.swift ├── Info.plist ├── Luminosity.swift ├── RandomColor.h └── RandomColor.swift ├── RandomColorSwift.podspec ├── RandomColorSwift.xcodeproj ├── project.pbxproj ├── project.xcworkspace │ ├── contents.xcworkspacedata │ └── xcshareddata │ │ ├── IDEWorkspaceChecks.plist │ │ └── RandomColorSwift.xcscmblueprint └── xcshareddata │ └── xcschemes │ └── RandomColor.xcscheme ├── RandomColorSwiftTests ├── Info.plist └── RandomColorSwiftTests.swift ├── RandomColorTests ├── Info.plist └── RandomColorTests.swift └── demo.png /.gitignore: -------------------------------------------------------------------------------- 1 | # Created by https://www.gitignore.io 2 | 3 | ### Xcode ### 4 | build/ 5 | *.pbxuser 6 | !default.pbxuser 7 | *.mode1v3 8 | !default.mode1v3 9 | *.mode2v3 10 | !default.mode2v3 11 | *.perspectivev3 12 | !default.perspectivev3 13 | xcuserdata 14 | *.xccheckout 15 | *.moved-aside 16 | DerivedData 17 | *.xcuserstate 18 | 19 | 20 | ### OSX ### 21 | .DS_Store 22 | .AppleDouble 23 | .LSOverride 24 | 25 | # Icon must end with two \r 26 | Icon 27 | 28 | 29 | # Thumbnails 30 | ._* 31 | 32 | # Files that might appear on external disk 33 | .Spotlight-V100 34 | .Trashes 35 | 36 | # Directories potentially created on remote AFP share 37 | .AppleDB 38 | .AppleDesktop 39 | Network Trash Folder 40 | Temporary Items 41 | .apdisk 42 | 43 | 44 | ### Swift ### 45 | # Xcode 46 | # 47 | build/ 48 | *.pbxuser 49 | !default.pbxuser 50 | *.mode1v3 51 | !default.mode1v3 52 | *.mode2v3 53 | !default.mode2v3 54 | *.perspectivev3 55 | !default.perspectivev3 56 | xcuserdata 57 | *.xccheckout 58 | *.moved-aside 59 | DerivedData 60 | *.hmap 61 | *.ipa 62 | *.xcuserstate 63 | 64 | # CocoaPods 65 | # 66 | # We recommend against adding the Pods directory to your .gitignore. However 67 | # you should judge for yourself, the pros and cons are mentioned at: 68 | # http://guides.cocoapods.org/using/using-cocoapods.html#should-i-ignore-the-pods-directory-in-source-control 69 | # 70 | # Pods/ 71 | 72 | # Carthage 73 | # 74 | # Add this line if you want to avoid checking in source code from Carthage dependencies. 75 | # Carthage/Checkouts 76 | 77 | Carthage/Build 78 | 79 | 80 | ### Objective-C ### 81 | # Xcode 82 | # 83 | build/ 84 | *.pbxuser 85 | !default.pbxuser 86 | *.mode1v3 87 | !default.mode1v3 88 | *.mode2v3 89 | !default.mode2v3 90 | *.perspectivev3 91 | !default.perspectivev3 92 | xcuserdata 93 | *.xccheckout 94 | *.moved-aside 95 | DerivedData 96 | *.hmap 97 | *.ipa 98 | *.xcuserstate 99 | 100 | # CocoaPods 101 | # 102 | # We recommend against adding the Pods directory to your .gitignore. However 103 | # you should judge for yourself, the pros and cons are mentioned at: 104 | # http://guides.cocoapods.org/using/using-cocoapods.html#should-i-ignore-the-pods-directory-in-source-control 105 | # 106 | # Pods/ 107 | 108 | 109 | ### AppCode ### 110 | # Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm 111 | 112 | *.iml 113 | 114 | ## Directory-based project format: 115 | .idea/ 116 | # if you remove the above rule, at least ignore the following: 117 | 118 | # User-specific stuff: 119 | # .idea/workspace.xml 120 | # .idea/tasks.xml 121 | # .idea/dictionaries 122 | 123 | # Sensitive or high-churn files: 124 | # .idea/dataSources.ids 125 | # .idea/dataSources.xml 126 | # .idea/sqlDataSources.xml 127 | # .idea/dynamic.xml 128 | # .idea/uiDesigner.xml 129 | 130 | # Gradle: 131 | # .idea/gradle.xml 132 | # .idea/libraries 133 | 134 | # Mongo Explorer plugin: 135 | # .idea/mongoSettings.xml 136 | 137 | ## File-based project format: 138 | *.ipr 139 | *.iws 140 | 141 | ## Plugin-specific files: 142 | 143 | # IntelliJ 144 | out/ 145 | 146 | # mpeltonen/sbt-idea plugin 147 | .idea_modules/ 148 | 149 | # JIRA plugin 150 | atlassian-ide-plugin.xml 151 | 152 | # Crashlytics plugin (for Android Studio and IntelliJ) 153 | com_crashlytics_export_strings.xml 154 | crashlytics.properties 155 | crashlytics-build.properties 156 | .ruby-version 157 | 158 | .build 159 | .swiftpm -------------------------------------------------------------------------------- /Demo/AppDelegate.swift: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.swift 3 | // RandomColorSwift 4 | // 5 | // Copyright (c) 2015 Wei Wang (http://onevcat.com) 6 | // 7 | // Permission is hereby granted, free of charge, to any person obtaining a copy 8 | // of this software and associated documentation files (the "Software"), to deal 9 | // in the Software without restriction, including without limitation the rights 10 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 11 | // copies of the Software, and to permit persons to whom the Software is 12 | // furnished to do so, subject to the following conditions: 13 | // 14 | // The above copyright notice and this permission notice shall be included in all 15 | // copies or substantial portions of the Software. 16 | // 17 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 18 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 19 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 20 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 21 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 22 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 23 | // SOFTWARE. 24 | 25 | import UIKit 26 | 27 | @UIApplicationMain 28 | class AppDelegate: UIResponder, UIApplicationDelegate { 29 | 30 | var window: UIWindow? 31 | 32 | func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey : Any]? = nil) -> Bool { 33 | // Override point for customization after application launch. 34 | return true 35 | } 36 | 37 | func applicationWillResignActive(_ application: UIApplication) { 38 | // 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. 39 | // 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. 40 | } 41 | 42 | func applicationDidEnterBackground(_ application: UIApplication) { 43 | // 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. 44 | // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits. 45 | } 46 | 47 | func applicationWillEnterForeground(_ application: UIApplication) { 48 | // 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. 49 | } 50 | 51 | func applicationDidBecomeActive(_ application: UIApplication) { 52 | // 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. 53 | } 54 | 55 | func applicationWillTerminate(_ application: UIApplication) { 56 | // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:. 57 | } 58 | 59 | 60 | } 61 | 62 | -------------------------------------------------------------------------------- /Demo/Base.lproj/LaunchScreen.xib: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 20 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | -------------------------------------------------------------------------------- /Demo/Base.lproj/Main.storyboard: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 79 | 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 | 124 | 125 | 132 | 133 | 134 | 135 | 136 | 137 | 138 | 139 | 140 | 141 | 148 | 149 | 150 | 151 | 152 | 153 | 154 | 155 | 156 | 157 | 158 | 159 | 160 | 161 | 162 | 169 | 176 | 177 | 178 | 179 | 180 | 181 | 182 | 183 | 184 | 185 | 186 | 187 | 188 | 189 | 190 | 191 | 192 | 193 | 194 | 195 | 202 | 203 | 204 | 205 | 206 | 207 | 208 | 209 | 210 | 211 | 212 | 213 | 214 | 215 | 216 | 217 | 218 | 219 | 220 | 221 | 222 | 223 | 224 | 225 | 226 | 227 | 228 | 229 | 230 | 231 | 232 | 233 | 234 | 235 | 236 | 237 | 238 | 239 | 240 | 241 | 242 | 243 | 244 | 245 | 246 | 247 | 248 | 249 | 250 | 251 | 252 | 253 | 254 | 255 | 256 | 257 | 258 | 259 | 260 | 261 | 262 | 263 | 264 | 265 | 266 | 267 | 268 | 269 | 270 | 271 | 272 | 273 | 274 | 275 | 276 | 277 | 278 | 279 | 280 | 281 | 282 | 283 | 284 | 285 | 286 | 287 | 288 | 289 | -------------------------------------------------------------------------------- /Demo/DetailViewController.swift: -------------------------------------------------------------------------------- 1 | // 2 | // DetailViewController.swift 3 | // RandomColorSwift 4 | // 5 | // Created by WANG WEI on 2015/01/23. 6 | // Copyright (c) 2020年 OneV's Den. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | 11 | class DetailViewController: UIViewController { 12 | 13 | var color: UIColor? 14 | 15 | @IBOutlet weak var colorView: UIView! 16 | @IBOutlet weak var colorNameLabel: UILabel! 17 | @IBOutlet weak var colorHexLabel: UILabel! 18 | 19 | override func viewDidLoad() { 20 | super.viewDidLoad() 21 | 22 | colorView.layer.cornerRadius = 10; 23 | colorView.layer.masksToBounds = true; 24 | 25 | colorView.backgroundColor = color 26 | colorNameLabel.text = color?.name 27 | colorHexLabel.text = color?.hexString 28 | } 29 | 30 | override func didReceiveMemoryWarning() { 31 | super.didReceiveMemoryWarning() 32 | // Dispose of any resources that can be recreated. 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /Demo/HueExtension.swift: -------------------------------------------------------------------------------- 1 | // 2 | // HueExtension.swift 3 | // RandomColorSwift 4 | // 5 | // Copyright (c) 2020 Wei Wang (http://onevcat.com) 6 | // 7 | // Permission is hereby granted, free of charge, to any person obtaining a copy 8 | // of this software and associated documentation files (the "Software"), to deal 9 | // in the Software without restriction, including without limitation the rights 10 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 11 | // copies of the Software, and to permit persons to whom the Software is 12 | // furnished to do so, subject to the following conditions: 13 | // 14 | // The above copyright notice and this permission notice shall be included in all 15 | // copies or substantial portions of the Software. 16 | // 17 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 18 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 19 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 20 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 21 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 22 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 23 | // SOFTWARE. 24 | 25 | import Foundation 26 | import RandomColor 27 | 28 | extension Hue { 29 | public static func fromInt(_ value: Int) -> Hue { 30 | switch value { 31 | case 1: return .monochrome 32 | case 2: return .red 33 | case 3: return .orange 34 | case 4: return .yellow 35 | case 5: return .green 36 | case 6: return .blue 37 | case 7: return .purple 38 | case 8: return .pink 39 | case -1: return .value(0) 40 | default: return .random 41 | } 42 | } 43 | } 44 | 45 | extension Hue: CustomStringConvertible { 46 | public var description: String { 47 | get { 48 | switch self { 49 | case .monochrome: return "Monochrome" 50 | case .red: return "Red" 51 | case .orange: return "Orange" 52 | case .yellow: return "Yellow" 53 | case .green: return "Green" 54 | case .blue: return "Blue" 55 | case .purple: return "Purple" 56 | case .pink: return "Pink" 57 | case .value(_): return "Value" 58 | case .random: return "Random" 59 | } 60 | } 61 | } 62 | } 63 | -------------------------------------------------------------------------------- /Demo/Images.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 | "idiom" : "ipad", 35 | "size" : "29x29", 36 | "scale" : "1x" 37 | }, 38 | { 39 | "idiom" : "ipad", 40 | "size" : "29x29", 41 | "scale" : "2x" 42 | }, 43 | { 44 | "idiom" : "ipad", 45 | "size" : "40x40", 46 | "scale" : "1x" 47 | }, 48 | { 49 | "idiom" : "ipad", 50 | "size" : "40x40", 51 | "scale" : "2x" 52 | }, 53 | { 54 | "idiom" : "ipad", 55 | "size" : "76x76", 56 | "scale" : "1x" 57 | }, 58 | { 59 | "idiom" : "ipad", 60 | "size" : "76x76", 61 | "scale" : "2x" 62 | } 63 | ], 64 | "info" : { 65 | "version" : 1, 66 | "author" : "xcode" 67 | } 68 | } -------------------------------------------------------------------------------- /Demo/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 | UISupportedInterfaceOrientations 34 | 35 | UIInterfaceOrientationPortrait 36 | UIInterfaceOrientationLandscapeLeft 37 | UIInterfaceOrientationLandscapeRight 38 | 39 | UISupportedInterfaceOrientations~ipad 40 | 41 | UIInterfaceOrientationPortrait 42 | UIInterfaceOrientationPortraitUpsideDown 43 | UIInterfaceOrientationLandscapeLeft 44 | UIInterfaceOrientationLandscapeRight 45 | 46 | 47 | 48 | -------------------------------------------------------------------------------- /Demo/NameOfColor.swift: -------------------------------------------------------------------------------- 1 | // 2 | // NameOfColor.swift 3 | // RandomColorSwift 4 | // 5 | // Created by WANG WEI on 2015/01/23. 6 | // Copyright (c) 2020年 OneV's Den. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | import JavaScriptCore 11 | 12 | private var context: JSContext = { 13 | let jsPath = Bundle.main.path(forResource: "ntc", ofType: "js")! 14 | var error: NSError? 15 | let jsString = try! String(contentsOfFile:jsPath, encoding: String.Encoding.utf8) 16 | 17 | let context = JSContext() 18 | context!.evaluateScript(jsString) 19 | return context! 20 | }() 21 | 22 | extension UIColor { 23 | var hexString: String { 24 | var red: CGFloat = 0 25 | var green: CGFloat = 0 26 | var blue: CGFloat = 0 27 | 28 | self.getRed(&red, green: &green, blue: &blue, alpha: nil) 29 | 30 | let r = Int(255.0 * red); 31 | let g = Int(255.0 * green); 32 | let b = Int(255.0 * blue); 33 | 34 | return String(format: "#%02x%02x%02x", r,g,b) 35 | } 36 | } 37 | 38 | extension UIColor { 39 | var name: String { 40 | get { 41 | if let colorInfo = context.evaluateScript("ntc.name('\(self.hexString)')").toArray() { 42 | return colorInfo[1] as! String 43 | } else { 44 | return "not found" 45 | } 46 | } 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /Demo/SettingViewController.swift: -------------------------------------------------------------------------------- 1 | // 2 | // SettingViewController.swift 3 | // RandomColorSwift 4 | // 5 | // Copyright (c) 2020 Wei Wang (http://onevcat.com) 6 | // 7 | // Permission is hereby granted, free of charge, to any person obtaining a copy 8 | // of this software and associated documentation files (the "Software"), to deal 9 | // in the Software without restriction, including without limitation the rights 10 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 11 | // copies of the Software, and to permit persons to whom the Software is 12 | // furnished to do so, subject to the following conditions: 13 | // 14 | // The above copyright notice and this permission notice shall be included in all 15 | // copies or substantial portions of the Software. 16 | // 17 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 18 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 19 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 20 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 21 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 22 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 23 | // SOFTWARE. 24 | 25 | import UIKit 26 | import RandomColor 27 | 28 | protocol SettingViewControllerDelegate: class { 29 | func settingViewController(_ viewController: SettingViewController, didSetCount count: Int, hue: Hue, luminosity: Luminosity) 30 | } 31 | 32 | class SettingViewController: UITableViewController { 33 | //MARK: Color variables 34 | var count: Int = 99 { 35 | didSet { 36 | countLabel?.text = String(count) 37 | } 38 | } 39 | var hue: Hue = .random { 40 | didSet { 41 | hueLabel?.text = "\(hue)" 42 | } 43 | } 44 | 45 | var luminosity: Luminosity = .light 46 | 47 | //MARK: Delegate 48 | weak var delegate: SettingViewControllerDelegate? 49 | 50 | //MARK: UI Outlets 51 | @IBOutlet weak var countLabel: UILabel! 52 | @IBOutlet weak var hueLabel: UILabel! 53 | @IBOutlet weak var slider: UISlider! 54 | @IBOutlet weak var stepper: UIStepper! 55 | @IBOutlet weak var segment: UISegmentedControl! 56 | 57 | override func viewDidLoad() { 58 | super.viewDidLoad() 59 | 60 | //refresh UI 61 | syncUI() 62 | } 63 | 64 | func syncUI() { 65 | slider.value = Float(self.count) 66 | count = Int(slider.value) 67 | 68 | stepper.value = Double(hue.toInt()) 69 | hue = Hue.fromInt(Int(stepper.value)) 70 | 71 | segment.selectedSegmentIndex = luminosity.rawValue 72 | } 73 | } 74 | 75 | //MARK: UI Actions 76 | extension SettingViewController { 77 | 78 | @IBAction func doneButtonPressed(_ sender: AnyObject) { 79 | delegate?.settingViewController(self, didSetCount: count, hue: hue, luminosity: luminosity) 80 | } 81 | 82 | @IBAction func countSliderValueChanged(_ slider: UISlider) { 83 | count = Int(slider.value) 84 | } 85 | 86 | @IBAction func stepperValueChanged(_ stepper: UIStepper) { 87 | hue = Hue.fromInt(Int(stepper.value)) 88 | } 89 | 90 | @IBAction func segmentValueChanged(_ segment: UISegmentedControl) { 91 | if let value = Luminosity(rawValue: segment.selectedSegmentIndex) { 92 | luminosity = value 93 | } 94 | } 95 | } 96 | -------------------------------------------------------------------------------- /Demo/ViewController.swift: -------------------------------------------------------------------------------- 1 | // 2 | // ViewController.swift 3 | // RandomColorSwift 4 | // 5 | // Copyright (c) 2020 Wei Wang (http://onevcat.com) 6 | // 7 | // Permission is hereby granted, free of charge, to any person obtaining a copy 8 | // of this software and associated documentation files (the "Software"), to deal 9 | // in the Software without restriction, including without limitation the rights 10 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 11 | // copies of the Software, and to permit persons to whom the Software is 12 | // furnished to do so, subject to the following conditions: 13 | // 14 | // The above copyright notice and this permission notice shall be included in all 15 | // copies or substantial portions of the Software. 16 | // 17 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 18 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 19 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 20 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 21 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 22 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 23 | // SOFTWARE. 24 | 25 | import UIKit 26 | import RandomColor 27 | 28 | class ViewController: UICollectionViewController { 29 | 30 | var colors: [UIColor]! 31 | 32 | fileprivate var count = 99 33 | fileprivate var hue: Hue = .random 34 | fileprivate var luminosity: Luminosity = .light 35 | 36 | //MARK: Life cycle 37 | override func viewDidLoad() { 38 | super.viewDidLoad() 39 | // Do any additional setup after loading the view, typically from a nib. 40 | refresh() 41 | } 42 | 43 | //MARK: Segue Transition 44 | override func prepare(for segue: UIStoryboardSegue, sender: Any?) { 45 | if segue.identifier == "showSetting" { 46 | let settingVC = (segue.destination as! UINavigationController).topViewController as! SettingViewController 47 | settingVC.delegate = self 48 | settingVC.count = count 49 | settingVC.hue = hue 50 | settingVC.luminosity = luminosity 51 | } else if segue.identifier == "showDetail" { 52 | if let indexPath = collectionView?.indexPath(for: sender as! UICollectionViewCell) { 53 | let detailVC = segue.destination as! DetailViewController 54 | detailVC.color = colors[indexPath.row] 55 | } 56 | } 57 | } 58 | 59 | func refresh() { 60 | colors = randomColors(count: count, hue: hue, luminosity: luminosity) 61 | collectionView?.reloadData() 62 | } 63 | } 64 | 65 | //MARK: Collection View DataSource 66 | extension ViewController { 67 | override func collectionView(_ collectionView: UICollectionView, numberOfItemsInSection section: Int) -> Int { 68 | return colors.count 69 | } 70 | override func collectionView(_ collectionView: UICollectionView, cellForItemAt indexPath: IndexPath) -> UICollectionViewCell { 71 | let cell = collectionView.dequeueReusableCell(withReuseIdentifier: "cell", for: indexPath as IndexPath) 72 | cell.contentView.backgroundColor = colors[indexPath.row] 73 | return cell 74 | } 75 | } 76 | 77 | 78 | extension ViewController: SettingViewControllerDelegate { 79 | 80 | func settingViewController(_ viewController: SettingViewController, didSetCount count: Int, hue: Hue, luminosity: Luminosity) { 81 | dismiss(animated: true, completion: nil) 82 | 83 | self.count = count 84 | self.hue = hue 85 | self.luminosity = luminosity 86 | 87 | refresh() 88 | 89 | } 90 | } 91 | -------------------------------------------------------------------------------- /Demo/third-party/ntc.js: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | +-----------------------------------------------------------------+ 4 | | Created by Chirag Mehta - http://chir.ag/projects/ntc | 5 | |-----------------------------------------------------------------| 6 | | ntc js (Name that Color JavaScript) | 7 | +-----------------------------------------------------------------+ 8 | 9 | All the functions, code, lists etc. have been written specifically 10 | for the Name that Color JavaScript by Chirag Mehta unless otherwise 11 | specified. 12 | 13 | This script is released under the: Creative Commons License: 14 | Attribution 2.5 http://creativecommons.org/licenses/by/2.5/ 15 | 16 | Sample Usage: 17 | 18 | 19 | 20 | 30 | 31 | */ 32 | 33 | var ntc = { 34 | 35 | init: function() { 36 | var color, rgb, hsl; 37 | for(var i = 0; i < ntc.names.length; i++) 38 | { 39 | color = "#" + ntc.names[i][0]; 40 | rgb = ntc.rgb(color); 41 | hsl = ntc.hsl(color); 42 | ntc.names[i].push(rgb[0], rgb[1], rgb[2], hsl[0], hsl[1], hsl[2]); 43 | } 44 | }, 45 | 46 | name: function(color) { 47 | 48 | color = color.toUpperCase(); 49 | if(color.length < 3 || color.length > 7) 50 | return ["#000000", "Invalid Color: " + color, false]; 51 | if(color.length % 3 == 0) 52 | color = "#" + color; 53 | if(color.length == 4) 54 | color = "#" + color.substr(1, 1) + color.substr(1, 1) + color.substr(2, 1) + color.substr(2, 1) + color.substr(3, 1) + color.substr(3, 1); 55 | 56 | var rgb = ntc.rgb(color); 57 | var r = rgb[0], g = rgb[1], b = rgb[2]; 58 | var hsl = ntc.hsl(color); 59 | var h = hsl[0], s = hsl[1], l = hsl[2]; 60 | var ndf1 = 0; ndf2 = 0; ndf = 0; 61 | var cl = -1, df = -1; 62 | 63 | for(var i = 0; i < ntc.names.length; i++) 64 | { 65 | if(color == "#" + ntc.names[i][0]) 66 | return ["#" + ntc.names[i][0], ntc.names[i][1], true]; 67 | 68 | ndf1 = Math.pow(r - ntc.names[i][2], 2) + Math.pow(g - ntc.names[i][3], 2) + Math.pow(b - ntc.names[i][4], 2); 69 | ndf2 = Math.pow(h - ntc.names[i][5], 2) + Math.pow(s - ntc.names[i][6], 2) + Math.pow(l - ntc.names[i][7], 2); 70 | ndf = ndf1 + ndf2 * 2; 71 | if(df < 0 || df > ndf) 72 | { 73 | df = ndf; 74 | cl = i; 75 | } 76 | } 77 | 78 | return (cl < 0 ? ["#000000", "Invalid Color: " + color, false] : ["#" + ntc.names[cl][0], ntc.names[cl][1], false]); 79 | }, 80 | 81 | // adopted from: Farbtastic 1.2 82 | // http://acko.net/dev/farbtastic 83 | hsl: function (color) { 84 | 85 | var rgb = [parseInt('0x' + color.substring(1, 3)) / 255, parseInt('0x' + color.substring(3, 5)) / 255, parseInt('0x' + color.substring(5, 7)) / 255]; 86 | var min, max, delta, h, s, l; 87 | var r = rgb[0], g = rgb[1], b = rgb[2]; 88 | 89 | min = Math.min(r, Math.min(g, b)); 90 | max = Math.max(r, Math.max(g, b)); 91 | delta = max - min; 92 | l = (min + max) / 2; 93 | 94 | s = 0; 95 | if(l > 0 && l < 1) 96 | s = delta / (l < 0.5 ? (2 * l) : (2 - 2 * l)); 97 | 98 | h = 0; 99 | if(delta > 0) 100 | { 101 | if (max == r && max != g) h += (g - b) / delta; 102 | if (max == g && max != b) h += (2 + (b - r) / delta); 103 | if (max == b && max != r) h += (4 + (r - g) / delta); 104 | h /= 6; 105 | } 106 | return [parseInt(h * 255), parseInt(s * 255), parseInt(l * 255)]; 107 | }, 108 | 109 | // adopted from: Farbtastic 1.2 110 | // http://acko.net/dev/farbtastic 111 | rgb: function(color) { 112 | return [parseInt('0x' + color.substring(1, 3)), parseInt('0x' + color.substring(3, 5)), parseInt('0x' + color.substring(5, 7))]; 113 | }, 114 | 115 | names: [ 116 | ["000000", "Black"], 117 | ["000080", "Navy Blue"], 118 | ["0000C8", "Dark Blue"], 119 | ["0000FF", "Blue"], 120 | ["000741", "Stratos"], 121 | ["001B1C", "Swamp"], 122 | ["002387", "Resolution Blue"], 123 | ["002900", "Deep Fir"], 124 | ["002E20", "Burnham"], 125 | ["002FA7", "International Klein Blue"], 126 | ["003153", "Prussian Blue"], 127 | ["003366", "Midnight Blue"], 128 | ["003399", "Smalt"], 129 | ["003532", "Deep Teal"], 130 | ["003E40", "Cyprus"], 131 | ["004620", "Kaitoke Green"], 132 | ["0047AB", "Cobalt"], 133 | ["004816", "Crusoe"], 134 | ["004950", "Sherpa Blue"], 135 | ["0056A7", "Endeavour"], 136 | ["00581A", "Camarone"], 137 | ["0066CC", "Science Blue"], 138 | ["0066FF", "Blue Ribbon"], 139 | ["00755E", "Tropical Rain Forest"], 140 | ["0076A3", "Allports"], 141 | ["007BA7", "Deep Cerulean"], 142 | ["007EC7", "Lochmara"], 143 | ["007FFF", "Azure Radiance"], 144 | ["008080", "Teal"], 145 | ["0095B6", "Bondi Blue"], 146 | ["009DC4", "Pacific Blue"], 147 | ["00A693", "Persian Green"], 148 | ["00A86B", "Jade"], 149 | ["00CC99", "Caribbean Green"], 150 | ["00CCCC", "Robin's Egg Blue"], 151 | ["00FF00", "Green"], 152 | ["00FF7F", "Spring Green"], 153 | ["00FFFF", "Cyan / Aqua"], 154 | ["010D1A", "Blue Charcoal"], 155 | ["011635", "Midnight"], 156 | ["011D13", "Holly"], 157 | ["012731", "Daintree"], 158 | ["01361C", "Cardin Green"], 159 | ["01371A", "County Green"], 160 | ["013E62", "Astronaut Blue"], 161 | ["013F6A", "Regal Blue"], 162 | ["014B43", "Aqua Deep"], 163 | ["015E85", "Orient"], 164 | ["016162", "Blue Stone"], 165 | ["016D39", "Fun Green"], 166 | ["01796F", "Pine Green"], 167 | ["017987", "Blue Lagoon"], 168 | ["01826B", "Deep Sea"], 169 | ["01A368", "Green Haze"], 170 | ["022D15", "English Holly"], 171 | ["02402C", "Sherwood Green"], 172 | ["02478E", "Congress Blue"], 173 | ["024E46", "Evening Sea"], 174 | ["026395", "Bahama Blue"], 175 | ["02866F", "Observatory"], 176 | ["02A4D3", "Cerulean"], 177 | ["03163C", "Tangaroa"], 178 | ["032B52", "Green Vogue"], 179 | ["036A6E", "Mosque"], 180 | ["041004", "Midnight Moss"], 181 | ["041322", "Black Pearl"], 182 | ["042E4C", "Blue Whale"], 183 | ["044022", "Zuccini"], 184 | ["044259", "Teal Blue"], 185 | ["051040", "Deep Cove"], 186 | ["051657", "Gulf Blue"], 187 | ["055989", "Venice Blue"], 188 | ["056F57", "Watercourse"], 189 | ["062A78", "Catalina Blue"], 190 | ["063537", "Tiber"], 191 | ["069B81", "Gossamer"], 192 | ["06A189", "Niagara"], 193 | ["073A50", "Tarawera"], 194 | ["080110", "Jaguar"], 195 | ["081910", "Black Bean"], 196 | ["082567", "Deep Sapphire"], 197 | ["088370", "Elf Green"], 198 | ["08E8DE", "Bright Turquoise"], 199 | ["092256", "Downriver"], 200 | ["09230F", "Palm Green"], 201 | ["09255D", "Madison"], 202 | ["093624", "Bottle Green"], 203 | ["095859", "Deep Sea Green"], 204 | ["097F4B", "Salem"], 205 | ["0A001C", "Black Russian"], 206 | ["0A480D", "Dark Fern"], 207 | ["0A6906", "Japanese Laurel"], 208 | ["0A6F75", "Atoll"], 209 | ["0B0B0B", "Cod Gray"], 210 | ["0B0F08", "Marshland"], 211 | ["0B1107", "Gordons Green"], 212 | ["0B1304", "Black Forest"], 213 | ["0B6207", "San Felix"], 214 | ["0BDA51", "Malachite"], 215 | ["0C0B1D", "Ebony"], 216 | ["0C0D0F", "Woodsmoke"], 217 | ["0C1911", "Racing Green"], 218 | ["0C7A79", "Surfie Green"], 219 | ["0C8990", "Blue Chill"], 220 | ["0D0332", "Black Rock"], 221 | ["0D1117", "Bunker"], 222 | ["0D1C19", "Aztec"], 223 | ["0D2E1C", "Bush"], 224 | ["0E0E18", "Cinder"], 225 | ["0E2A30", "Firefly"], 226 | ["0F2D9E", "Torea Bay"], 227 | ["10121D", "Vulcan"], 228 | ["101405", "Green Waterloo"], 229 | ["105852", "Eden"], 230 | ["110C6C", "Arapawa"], 231 | ["120A8F", "Ultramarine"], 232 | ["123447", "Elephant"], 233 | ["126B40", "Jewel"], 234 | ["130000", "Diesel"], 235 | ["130A06", "Asphalt"], 236 | ["13264D", "Blue Zodiac"], 237 | ["134F19", "Parsley"], 238 | ["140600", "Nero"], 239 | ["1450AA", "Tory Blue"], 240 | ["151F4C", "Bunting"], 241 | ["1560BD", "Denim"], 242 | ["15736B", "Genoa"], 243 | ["161928", "Mirage"], 244 | ["161D10", "Hunter Green"], 245 | ["162A40", "Big Stone"], 246 | ["163222", "Celtic"], 247 | ["16322C", "Timber Green"], 248 | ["163531", "Gable Green"], 249 | ["171F04", "Pine Tree"], 250 | ["175579", "Chathams Blue"], 251 | ["182D09", "Deep Forest Green"], 252 | ["18587A", "Blumine"], 253 | ["19330E", "Palm Leaf"], 254 | ["193751", "Nile Blue"], 255 | ["1959A8", "Fun Blue"], 256 | ["1A1A68", "Lucky Point"], 257 | ["1AB385", "Mountain Meadow"], 258 | ["1B0245", "Tolopea"], 259 | ["1B1035", "Haiti"], 260 | ["1B127B", "Deep Koamaru"], 261 | ["1B1404", "Acadia"], 262 | ["1B2F11", "Seaweed"], 263 | ["1B3162", "Biscay"], 264 | ["1B659D", "Matisse"], 265 | ["1C1208", "Crowshead"], 266 | ["1C1E13", "Rangoon Green"], 267 | ["1C39BB", "Persian Blue"], 268 | ["1C402E", "Everglade"], 269 | ["1C7C7D", "Elm"], 270 | ["1D6142", "Green Pea"], 271 | ["1E0F04", "Creole"], 272 | ["1E1609", "Karaka"], 273 | ["1E1708", "El Paso"], 274 | ["1E385B", "Cello"], 275 | ["1E433C", "Te Papa Green"], 276 | ["1E90FF", "Dodger Blue"], 277 | ["1E9AB0", "Eastern Blue"], 278 | ["1F120F", "Night Rider"], 279 | ["1FC2C2", "Java"], 280 | ["20208D", "Jacksons Purple"], 281 | ["202E54", "Cloud Burst"], 282 | ["204852", "Blue Dianne"], 283 | ["211A0E", "Eternity"], 284 | ["220878", "Deep Blue"], 285 | ["228B22", "Forest Green"], 286 | ["233418", "Mallard"], 287 | ["240A40", "Violet"], 288 | ["240C02", "Kilamanjaro"], 289 | ["242A1D", "Log Cabin"], 290 | ["242E16", "Black Olive"], 291 | ["24500F", "Green House"], 292 | ["251607", "Graphite"], 293 | ["251706", "Cannon Black"], 294 | ["251F4F", "Port Gore"], 295 | ["25272C", "Shark"], 296 | ["25311C", "Green Kelp"], 297 | ["2596D1", "Curious Blue"], 298 | ["260368", "Paua"], 299 | ["26056A", "Paris M"], 300 | ["261105", "Wood Bark"], 301 | ["261414", "Gondola"], 302 | ["262335", "Steel Gray"], 303 | ["26283B", "Ebony Clay"], 304 | ["273A81", "Bay of Many"], 305 | ["27504B", "Plantation"], 306 | ["278A5B", "Eucalyptus"], 307 | ["281E15", "Oil"], 308 | ["283A77", "Astronaut"], 309 | ["286ACD", "Mariner"], 310 | ["290C5E", "Violent Violet"], 311 | ["292130", "Bastille"], 312 | ["292319", "Zeus"], 313 | ["292937", "Charade"], 314 | ["297B9A", "Jelly Bean"], 315 | ["29AB87", "Jungle Green"], 316 | ["2A0359", "Cherry Pie"], 317 | ["2A140E", "Coffee Bean"], 318 | ["2A2630", "Baltic Sea"], 319 | ["2A380B", "Turtle Green"], 320 | ["2A52BE", "Cerulean Blue"], 321 | ["2B0202", "Sepia Black"], 322 | ["2B194F", "Valhalla"], 323 | ["2B3228", "Heavy Metal"], 324 | ["2C0E8C", "Blue Gem"], 325 | ["2C1632", "Revolver"], 326 | ["2C2133", "Bleached Cedar"], 327 | ["2C8C84", "Lochinvar"], 328 | ["2D2510", "Mikado"], 329 | ["2D383A", "Outer Space"], 330 | ["2D569B", "St Tropaz"], 331 | ["2E0329", "Jacaranda"], 332 | ["2E1905", "Jacko Bean"], 333 | ["2E3222", "Rangitoto"], 334 | ["2E3F62", "Rhino"], 335 | ["2E8B57", "Sea Green"], 336 | ["2EBFD4", "Scooter"], 337 | ["2F270E", "Onion"], 338 | ["2F3CB3", "Governor Bay"], 339 | ["2F519E", "Sapphire"], 340 | ["2F5A57", "Spectra"], 341 | ["2F6168", "Casal"], 342 | ["300529", "Melanzane"], 343 | ["301F1E", "Cocoa Brown"], 344 | ["302A0F", "Woodrush"], 345 | ["304B6A", "San Juan"], 346 | ["30D5C8", "Turquoise"], 347 | ["311C17", "Eclipse"], 348 | ["314459", "Pickled Bluewood"], 349 | ["315BA1", "Azure"], 350 | ["31728D", "Calypso"], 351 | ["317D82", "Paradiso"], 352 | ["32127A", "Persian Indigo"], 353 | ["32293A", "Blackcurrant"], 354 | ["323232", "Mine Shaft"], 355 | ["325D52", "Stromboli"], 356 | ["327C14", "Bilbao"], 357 | ["327DA0", "Astral"], 358 | ["33036B", "Christalle"], 359 | ["33292F", "Thunder"], 360 | ["33CC99", "Shamrock"], 361 | ["341515", "Tamarind"], 362 | ["350036", "Mardi Gras"], 363 | ["350E42", "Valentino"], 364 | ["350E57", "Jagger"], 365 | ["353542", "Tuna"], 366 | ["354E8C", "Chambray"], 367 | ["363050", "Martinique"], 368 | ["363534", "Tuatara"], 369 | ["363C0D", "Waiouru"], 370 | ["36747D", "Ming"], 371 | ["368716", "La Palma"], 372 | ["370202", "Chocolate"], 373 | ["371D09", "Clinker"], 374 | ["37290E", "Brown Tumbleweed"], 375 | ["373021", "Birch"], 376 | ["377475", "Oracle"], 377 | ["380474", "Blue Diamond"], 378 | ["381A51", "Grape"], 379 | ["383533", "Dune"], 380 | ["384555", "Oxford Blue"], 381 | ["384910", "Clover"], 382 | ["394851", "Limed Spruce"], 383 | ["396413", "Dell"], 384 | ["3A0020", "Toledo"], 385 | ["3A2010", "Sambuca"], 386 | ["3A2A6A", "Jacarta"], 387 | ["3A686C", "William"], 388 | ["3A6A47", "Killarney"], 389 | ["3AB09E", "Keppel"], 390 | ["3B000B", "Temptress"], 391 | ["3B0910", "Aubergine"], 392 | ["3B1F1F", "Jon"], 393 | ["3B2820", "Treehouse"], 394 | ["3B7A57", "Amazon"], 395 | ["3B91B4", "Boston Blue"], 396 | ["3C0878", "Windsor"], 397 | ["3C1206", "Rebel"], 398 | ["3C1F76", "Meteorite"], 399 | ["3C2005", "Dark Ebony"], 400 | ["3C3910", "Camouflage"], 401 | ["3C4151", "Bright Gray"], 402 | ["3C4443", "Cape Cod"], 403 | ["3C493A", "Lunar Green"], 404 | ["3D0C02", "Bean "], 405 | ["3D2B1F", "Bistre"], 406 | ["3D7D52", "Goblin"], 407 | ["3E0480", "Kingfisher Daisy"], 408 | ["3E1C14", "Cedar"], 409 | ["3E2B23", "English Walnut"], 410 | ["3E2C1C", "Black Marlin"], 411 | ["3E3A44", "Ship Gray"], 412 | ["3EABBF", "Pelorous"], 413 | ["3F2109", "Bronze"], 414 | ["3F2500", "Cola"], 415 | ["3F3002", "Madras"], 416 | ["3F307F", "Minsk"], 417 | ["3F4C3A", "Cabbage Pont"], 418 | ["3F583B", "Tom Thumb"], 419 | ["3F5D53", "Mineral Green"], 420 | ["3FC1AA", "Puerto Rico"], 421 | ["3FFF00", "Harlequin"], 422 | ["401801", "Brown Pod"], 423 | ["40291D", "Cork"], 424 | ["403B38", "Masala"], 425 | ["403D19", "Thatch Green"], 426 | ["405169", "Fiord"], 427 | ["40826D", "Viridian"], 428 | ["40A860", "Chateau Green"], 429 | ["410056", "Ripe Plum"], 430 | ["411F10", "Paco"], 431 | ["412010", "Deep Oak"], 432 | ["413C37", "Merlin"], 433 | ["414257", "Gun Powder"], 434 | ["414C7D", "East Bay"], 435 | ["4169E1", "Royal Blue"], 436 | ["41AA78", "Ocean Green"], 437 | ["420303", "Burnt Maroon"], 438 | ["423921", "Lisbon Brown"], 439 | ["427977", "Faded Jade"], 440 | ["431560", "Scarlet Gum"], 441 | ["433120", "Iroko"], 442 | ["433E37", "Armadillo"], 443 | ["434C59", "River Bed"], 444 | ["436A0D", "Green Leaf"], 445 | ["44012D", "Barossa"], 446 | ["441D00", "Morocco Brown"], 447 | ["444954", "Mako"], 448 | ["454936", "Kelp"], 449 | ["456CAC", "San Marino"], 450 | ["45B1E8", "Picton Blue"], 451 | ["460B41", "Loulou"], 452 | ["462425", "Crater Brown"], 453 | ["465945", "Gray Asparagus"], 454 | ["4682B4", "Steel Blue"], 455 | ["480404", "Rustic Red"], 456 | ["480607", "Bulgarian Rose"], 457 | ["480656", "Clairvoyant"], 458 | ["481C1C", "Cocoa Bean"], 459 | ["483131", "Woody Brown"], 460 | ["483C32", "Taupe"], 461 | ["49170C", "Van Cleef"], 462 | ["492615", "Brown Derby"], 463 | ["49371B", "Metallic Bronze"], 464 | ["495400", "Verdun Green"], 465 | ["496679", "Blue Bayoux"], 466 | ["497183", "Bismark"], 467 | ["4A2A04", "Bracken"], 468 | ["4A3004", "Deep Bronze"], 469 | ["4A3C30", "Mondo"], 470 | ["4A4244", "Tundora"], 471 | ["4A444B", "Gravel"], 472 | ["4A4E5A", "Trout"], 473 | ["4B0082", "Pigment Indigo"], 474 | ["4B5D52", "Nandor"], 475 | ["4C3024", "Saddle"], 476 | ["4C4F56", "Abbey"], 477 | ["4D0135", "Blackberry"], 478 | ["4D0A18", "Cab Sav"], 479 | ["4D1E01", "Indian Tan"], 480 | ["4D282D", "Cowboy"], 481 | ["4D282E", "Livid Brown"], 482 | ["4D3833", "Rock"], 483 | ["4D3D14", "Punga"], 484 | ["4D400F", "Bronzetone"], 485 | ["4D5328", "Woodland"], 486 | ["4E0606", "Mahogany"], 487 | ["4E2A5A", "Bossanova"], 488 | ["4E3B41", "Matterhorn"], 489 | ["4E420C", "Bronze Olive"], 490 | ["4E4562", "Mulled Wine"], 491 | ["4E6649", "Axolotl"], 492 | ["4E7F9E", "Wedgewood"], 493 | ["4EABD1", "Shakespeare"], 494 | ["4F1C70", "Honey Flower"], 495 | ["4F2398", "Daisy Bush"], 496 | ["4F69C6", "Indigo"], 497 | ["4F7942", "Fern Green"], 498 | ["4F9D5D", "Fruit Salad"], 499 | ["4FA83D", "Apple"], 500 | ["504351", "Mortar"], 501 | ["507096", "Kashmir Blue"], 502 | ["507672", "Cutty Sark"], 503 | ["50C878", "Emerald"], 504 | ["514649", "Emperor"], 505 | ["516E3D", "Chalet Green"], 506 | ["517C66", "Como"], 507 | ["51808F", "Smalt Blue"], 508 | ["52001F", "Castro"], 509 | ["520C17", "Maroon Oak"], 510 | ["523C94", "Gigas"], 511 | ["533455", "Voodoo"], 512 | ["534491", "Victoria"], 513 | ["53824B", "Hippie Green"], 514 | ["541012", "Heath"], 515 | ["544333", "Judge Gray"], 516 | ["54534D", "Fuscous Gray"], 517 | ["549019", "Vida Loca"], 518 | ["55280C", "Cioccolato"], 519 | ["555B10", "Saratoga"], 520 | ["556D56", "Finlandia"], 521 | ["5590D9", "Havelock Blue"], 522 | ["56B4BE", "Fountain Blue"], 523 | ["578363", "Spring Leaves"], 524 | ["583401", "Saddle Brown"], 525 | ["585562", "Scarpa Flow"], 526 | ["587156", "Cactus"], 527 | ["589AAF", "Hippie Blue"], 528 | ["591D35", "Wine Berry"], 529 | ["592804", "Brown Bramble"], 530 | ["593737", "Congo Brown"], 531 | ["594433", "Millbrook"], 532 | ["5A6E9C", "Waikawa Gray"], 533 | ["5A87A0", "Horizon"], 534 | ["5B3013", "Jambalaya"], 535 | ["5C0120", "Bordeaux"], 536 | ["5C0536", "Mulberry Wood"], 537 | ["5C2E01", "Carnaby Tan"], 538 | ["5C5D75", "Comet"], 539 | ["5D1E0F", "Redwood"], 540 | ["5D4C51", "Don Juan"], 541 | ["5D5C58", "Chicago"], 542 | ["5D5E37", "Verdigris"], 543 | ["5D7747", "Dingley"], 544 | ["5DA19F", "Breaker Bay"], 545 | ["5E483E", "Kabul"], 546 | ["5E5D3B", "Hemlock"], 547 | ["5F3D26", "Irish Coffee"], 548 | ["5F5F6E", "Mid Gray"], 549 | ["5F6672", "Shuttle Gray"], 550 | ["5FA777", "Aqua Forest"], 551 | ["5FB3AC", "Tradewind"], 552 | ["604913", "Horses Neck"], 553 | ["605B73", "Smoky"], 554 | ["606E68", "Corduroy"], 555 | ["6093D1", "Danube"], 556 | ["612718", "Espresso"], 557 | ["614051", "Eggplant"], 558 | ["615D30", "Costa Del Sol"], 559 | ["61845F", "Glade Green"], 560 | ["622F30", "Buccaneer"], 561 | ["623F2D", "Quincy"], 562 | ["624E9A", "Butterfly Bush"], 563 | ["625119", "West Coast"], 564 | ["626649", "Finch"], 565 | ["639A8F", "Patina"], 566 | ["63B76C", "Fern"], 567 | ["6456B7", "Blue Violet"], 568 | ["646077", "Dolphin"], 569 | ["646463", "Storm Dust"], 570 | ["646A54", "Siam"], 571 | ["646E75", "Nevada"], 572 | ["6495ED", "Cornflower Blue"], 573 | ["64CCDB", "Viking"], 574 | ["65000B", "Rosewood"], 575 | ["651A14", "Cherrywood"], 576 | ["652DC1", "Purple Heart"], 577 | ["657220", "Fern Frond"], 578 | ["65745D", "Willow Grove"], 579 | ["65869F", "Hoki"], 580 | ["660045", "Pompadour"], 581 | ["660099", "Purple"], 582 | ["66023C", "Tyrian Purple"], 583 | ["661010", "Dark Tan"], 584 | ["66B58F", "Silver Tree"], 585 | ["66FF00", "Bright Green"], 586 | ["66FF66", "Screamin' Green"], 587 | ["67032D", "Black Rose"], 588 | ["675FA6", "Scampi"], 589 | ["676662", "Ironside Gray"], 590 | ["678975", "Viridian Green"], 591 | ["67A712", "Christi"], 592 | ["683600", "Nutmeg Wood Finish"], 593 | ["685558", "Zambezi"], 594 | ["685E6E", "Salt Box"], 595 | ["692545", "Tawny Port"], 596 | ["692D54", "Finn"], 597 | ["695F62", "Scorpion"], 598 | ["697E9A", "Lynch"], 599 | ["6A442E", "Spice"], 600 | ["6A5D1B", "Himalaya"], 601 | ["6A6051", "Soya Bean"], 602 | ["6B2A14", "Hairy Heath"], 603 | ["6B3FA0", "Royal Purple"], 604 | ["6B4E31", "Shingle Fawn"], 605 | ["6B5755", "Dorado"], 606 | ["6B8BA2", "Bermuda Gray"], 607 | ["6B8E23", "Olive Drab"], 608 | ["6C3082", "Eminence"], 609 | ["6CDAE7", "Turquoise Blue"], 610 | ["6D0101", "Lonestar"], 611 | ["6D5E54", "Pine Cone"], 612 | ["6D6C6C", "Dove Gray"], 613 | ["6D9292", "Juniper"], 614 | ["6D92A1", "Gothic"], 615 | ["6E0902", "Red Oxide"], 616 | ["6E1D14", "Moccaccino"], 617 | ["6E4826", "Pickled Bean"], 618 | ["6E4B26", "Dallas"], 619 | ["6E6D57", "Kokoda"], 620 | ["6E7783", "Pale Sky"], 621 | ["6F440C", "Cafe Royale"], 622 | ["6F6A61", "Flint"], 623 | ["6F8E63", "Highland"], 624 | ["6F9D02", "Limeade"], 625 | ["6FD0C5", "Downy"], 626 | ["701C1C", "Persian Plum"], 627 | ["704214", "Sepia"], 628 | ["704A07", "Antique Bronze"], 629 | ["704F50", "Ferra"], 630 | ["706555", "Coffee"], 631 | ["708090", "Slate Gray"], 632 | ["711A00", "Cedar Wood Finish"], 633 | ["71291D", "Metallic Copper"], 634 | ["714693", "Affair"], 635 | ["714AB2", "Studio"], 636 | ["715D47", "Tobacco Brown"], 637 | ["716338", "Yellow Metal"], 638 | ["716B56", "Peat"], 639 | ["716E10", "Olivetone"], 640 | ["717486", "Storm Gray"], 641 | ["718080", "Sirocco"], 642 | ["71D9E2", "Aquamarine Blue"], 643 | ["72010F", "Venetian Red"], 644 | ["724A2F", "Old Copper"], 645 | ["726D4E", "Go Ben"], 646 | ["727B89", "Raven"], 647 | ["731E8F", "Seance"], 648 | ["734A12", "Raw Umber"], 649 | ["736C9F", "Kimberly"], 650 | ["736D58", "Crocodile"], 651 | ["737829", "Crete"], 652 | ["738678", "Xanadu"], 653 | ["74640D", "Spicy Mustard"], 654 | ["747D63", "Limed Ash"], 655 | ["747D83", "Rolling Stone"], 656 | ["748881", "Blue Smoke"], 657 | ["749378", "Laurel"], 658 | ["74C365", "Mantis"], 659 | ["755A57", "Russett"], 660 | ["7563A8", "Deluge"], 661 | ["76395D", "Cosmic"], 662 | ["7666C6", "Blue Marguerite"], 663 | ["76BD17", "Lima"], 664 | ["76D7EA", "Sky Blue"], 665 | ["770F05", "Dark Burgundy"], 666 | ["771F1F", "Crown of Thorns"], 667 | ["773F1A", "Walnut"], 668 | ["776F61", "Pablo"], 669 | ["778120", "Pacifika"], 670 | ["779E86", "Oxley"], 671 | ["77DD77", "Pastel Green"], 672 | ["780109", "Japanese Maple"], 673 | ["782D19", "Mocha"], 674 | ["782F16", "Peanut"], 675 | ["78866B", "Camouflage Green"], 676 | ["788A25", "Wasabi"], 677 | ["788BBA", "Ship Cove"], 678 | ["78A39C", "Sea Nymph"], 679 | ["795D4C", "Roman Coffee"], 680 | ["796878", "Old Lavender"], 681 | ["796989", "Rum"], 682 | ["796A78", "Fedora"], 683 | ["796D62", "Sandstone"], 684 | ["79DEEC", "Spray"], 685 | ["7A013A", "Siren"], 686 | ["7A58C1", "Fuchsia Blue"], 687 | ["7A7A7A", "Boulder"], 688 | ["7A89B8", "Wild Blue Yonder"], 689 | ["7AC488", "De York"], 690 | ["7B3801", "Red Beech"], 691 | ["7B3F00", "Cinnamon"], 692 | ["7B6608", "Yukon Gold"], 693 | ["7B7874", "Tapa"], 694 | ["7B7C94", "Waterloo "], 695 | ["7B8265", "Flax Smoke"], 696 | ["7B9F80", "Amulet"], 697 | ["7BA05B", "Asparagus"], 698 | ["7C1C05", "Kenyan Copper"], 699 | ["7C7631", "Pesto"], 700 | ["7C778A", "Topaz"], 701 | ["7C7B7A", "Concord"], 702 | ["7C7B82", "Jumbo"], 703 | ["7C881A", "Trendy Green"], 704 | ["7CA1A6", "Gumbo"], 705 | ["7CB0A1", "Acapulco"], 706 | ["7CB7BB", "Neptune"], 707 | ["7D2C14", "Pueblo"], 708 | ["7DA98D", "Bay Leaf"], 709 | ["7DC8F7", "Malibu"], 710 | ["7DD8C6", "Bermuda"], 711 | ["7E3A15", "Copper Canyon"], 712 | ["7F1734", "Claret"], 713 | ["7F3A02", "Peru Tan"], 714 | ["7F626D", "Falcon"], 715 | ["7F7589", "Mobster"], 716 | ["7F76D3", "Moody Blue"], 717 | ["7FFF00", "Chartreuse"], 718 | ["7FFFD4", "Aquamarine"], 719 | ["800000", "Maroon"], 720 | ["800B47", "Rose Bud Cherry"], 721 | ["801818", "Falu Red"], 722 | ["80341F", "Red Robin"], 723 | ["803790", "Vivid Violet"], 724 | ["80461B", "Russet"], 725 | ["807E79", "Friar Gray"], 726 | ["808000", "Olive"], 727 | ["808080", "Gray"], 728 | ["80B3AE", "Gulf Stream"], 729 | ["80B3C4", "Glacier"], 730 | ["80CCEA", "Seagull"], 731 | ["81422C", "Nutmeg"], 732 | ["816E71", "Spicy Pink"], 733 | ["817377", "Empress"], 734 | ["819885", "Spanish Green"], 735 | ["826F65", "Sand Dune"], 736 | ["828685", "Gunsmoke"], 737 | ["828F72", "Battleship Gray"], 738 | ["831923", "Merlot"], 739 | ["837050", "Shadow"], 740 | ["83AA5D", "Chelsea Cucumber"], 741 | ["83D0C6", "Monte Carlo"], 742 | ["843179", "Plum"], 743 | ["84A0A0", "Granny Smith"], 744 | ["8581D9", "Chetwode Blue"], 745 | ["858470", "Bandicoot"], 746 | ["859FAF", "Bali Hai"], 747 | ["85C4CC", "Half Baked"], 748 | ["860111", "Red Devil"], 749 | ["863C3C", "Lotus"], 750 | ["86483C", "Ironstone"], 751 | ["864D1E", "Bull Shot"], 752 | ["86560A", "Rusty Nail"], 753 | ["868974", "Bitter"], 754 | ["86949F", "Regent Gray"], 755 | ["871550", "Disco"], 756 | ["87756E", "Americano"], 757 | ["877C7B", "Hurricane"], 758 | ["878D91", "Oslo Gray"], 759 | ["87AB39", "Sushi"], 760 | ["885342", "Spicy Mix"], 761 | ["886221", "Kumera"], 762 | ["888387", "Suva Gray"], 763 | ["888D65", "Avocado"], 764 | ["893456", "Camelot"], 765 | ["893843", "Solid Pink"], 766 | ["894367", "Cannon Pink"], 767 | ["897D6D", "Makara"], 768 | ["8A3324", "Burnt Umber"], 769 | ["8A73D6", "True V"], 770 | ["8A8360", "Clay Creek"], 771 | ["8A8389", "Monsoon"], 772 | ["8A8F8A", "Stack"], 773 | ["8AB9F1", "Jordy Blue"], 774 | ["8B00FF", "Electric Violet"], 775 | ["8B0723", "Monarch"], 776 | ["8B6B0B", "Corn Harvest"], 777 | ["8B8470", "Olive Haze"], 778 | ["8B847E", "Schooner"], 779 | ["8B8680", "Natural Gray"], 780 | ["8B9C90", "Mantle"], 781 | ["8B9FEE", "Portage"], 782 | ["8BA690", "Envy"], 783 | ["8BA9A5", "Cascade"], 784 | ["8BE6D8", "Riptide"], 785 | ["8C055E", "Cardinal Pink"], 786 | ["8C472F", "Mule Fawn"], 787 | ["8C5738", "Potters Clay"], 788 | ["8C6495", "Trendy Pink"], 789 | ["8D0226", "Paprika"], 790 | ["8D3D38", "Sanguine Brown"], 791 | ["8D3F3F", "Tosca"], 792 | ["8D7662", "Cement"], 793 | ["8D8974", "Granite Green"], 794 | ["8D90A1", "Manatee"], 795 | ["8DA8CC", "Polo Blue"], 796 | ["8E0000", "Red Berry"], 797 | ["8E4D1E", "Rope"], 798 | ["8E6F70", "Opium"], 799 | ["8E775E", "Domino"], 800 | ["8E8190", "Mamba"], 801 | ["8EABC1", "Nepal"], 802 | ["8F021C", "Pohutukawa"], 803 | ["8F3E33", "El Salva"], 804 | ["8F4B0E", "Korma"], 805 | ["8F8176", "Squirrel"], 806 | ["8FD6B4", "Vista Blue"], 807 | ["900020", "Burgundy"], 808 | ["901E1E", "Old Brick"], 809 | ["907874", "Hemp"], 810 | ["907B71", "Almond Frost"], 811 | ["908D39", "Sycamore"], 812 | ["92000A", "Sangria"], 813 | ["924321", "Cumin"], 814 | ["926F5B", "Beaver"], 815 | ["928573", "Stonewall"], 816 | ["928590", "Venus"], 817 | ["9370DB", "Medium Purple"], 818 | ["93CCEA", "Cornflower"], 819 | ["93DFB8", "Algae Green"], 820 | ["944747", "Copper Rust"], 821 | ["948771", "Arrowtown"], 822 | ["950015", "Scarlett"], 823 | ["956387", "Strikemaster"], 824 | ["959396", "Mountain Mist"], 825 | ["960018", "Carmine"], 826 | ["964B00", "Brown"], 827 | ["967059", "Leather"], 828 | ["9678B6", "Purple Mountain's Majesty"], 829 | ["967BB6", "Lavender Purple"], 830 | ["96A8A1", "Pewter"], 831 | ["96BBAB", "Summer Green"], 832 | ["97605D", "Au Chico"], 833 | ["9771B5", "Wisteria"], 834 | ["97CD2D", "Atlantis"], 835 | ["983D61", "Vin Rouge"], 836 | ["9874D3", "Lilac Bush"], 837 | ["98777B", "Bazaar"], 838 | ["98811B", "Hacienda"], 839 | ["988D77", "Pale Oyster"], 840 | ["98FF98", "Mint Green"], 841 | ["990066", "Fresh Eggplant"], 842 | ["991199", "Violet Eggplant"], 843 | ["991613", "Tamarillo"], 844 | ["991B07", "Totem Pole"], 845 | ["996666", "Copper Rose"], 846 | ["9966CC", "Amethyst"], 847 | ["997A8D", "Mountbatten Pink"], 848 | ["9999CC", "Blue Bell"], 849 | ["9A3820", "Prairie Sand"], 850 | ["9A6E61", "Toast"], 851 | ["9A9577", "Gurkha"], 852 | ["9AB973", "Olivine"], 853 | ["9AC2B8", "Shadow Green"], 854 | ["9B4703", "Oregon"], 855 | ["9B9E8F", "Lemon Grass"], 856 | ["9C3336", "Stiletto"], 857 | ["9D5616", "Hawaiian Tan"], 858 | ["9DACB7", "Gull Gray"], 859 | ["9DC209", "Pistachio"], 860 | ["9DE093", "Granny Smith Apple"], 861 | ["9DE5FF", "Anakiwa"], 862 | ["9E5302", "Chelsea Gem"], 863 | ["9E5B40", "Sepia Skin"], 864 | ["9EA587", "Sage"], 865 | ["9EA91F", "Citron"], 866 | ["9EB1CD", "Rock Blue"], 867 | ["9EDEE0", "Morning Glory"], 868 | ["9F381D", "Cognac"], 869 | ["9F821C", "Reef Gold"], 870 | ["9F9F9C", "Star Dust"], 871 | ["9FA0B1", "Santas Gray"], 872 | ["9FD7D3", "Sinbad"], 873 | ["9FDD8C", "Feijoa"], 874 | ["A02712", "Tabasco"], 875 | ["A1750D", "Buttered Rum"], 876 | ["A1ADB5", "Hit Gray"], 877 | ["A1C50A", "Citrus"], 878 | ["A1DAD7", "Aqua Island"], 879 | ["A1E9DE", "Water Leaf"], 880 | ["A2006D", "Flirt"], 881 | ["A23B6C", "Rouge"], 882 | ["A26645", "Cape Palliser"], 883 | ["A2AAB3", "Gray Chateau"], 884 | ["A2AEAB", "Edward"], 885 | ["A3807B", "Pharlap"], 886 | ["A397B4", "Amethyst Smoke"], 887 | ["A3E3ED", "Blizzard Blue"], 888 | ["A4A49D", "Delta"], 889 | ["A4A6D3", "Wistful"], 890 | ["A4AF6E", "Green Smoke"], 891 | ["A50B5E", "Jazzberry Jam"], 892 | ["A59B91", "Zorba"], 893 | ["A5CB0C", "Bahia"], 894 | ["A62F20", "Roof Terracotta"], 895 | ["A65529", "Paarl"], 896 | ["A68B5B", "Barley Corn"], 897 | ["A69279", "Donkey Brown"], 898 | ["A6A29A", "Dawn"], 899 | ["A72525", "Mexican Red"], 900 | ["A7882C", "Luxor Gold"], 901 | ["A85307", "Rich Gold"], 902 | ["A86515", "Reno Sand"], 903 | ["A86B6B", "Coral Tree"], 904 | ["A8989B", "Dusty Gray"], 905 | ["A899E6", "Dull Lavender"], 906 | ["A8A589", "Tallow"], 907 | ["A8AE9C", "Bud"], 908 | ["A8AF8E", "Locust"], 909 | ["A8BD9F", "Norway"], 910 | ["A8E3BD", "Chinook"], 911 | ["A9A491", "Gray Olive"], 912 | ["A9ACB6", "Aluminium"], 913 | ["A9B2C3", "Cadet Blue"], 914 | ["A9B497", "Schist"], 915 | ["A9BDBF", "Tower Gray"], 916 | ["A9BEF2", "Perano"], 917 | ["A9C6C2", "Opal"], 918 | ["AA375A", "Night Shadz"], 919 | ["AA4203", "Fire"], 920 | ["AA8B5B", "Muesli"], 921 | ["AA8D6F", "Sandal"], 922 | ["AAA5A9", "Shady Lady"], 923 | ["AAA9CD", "Logan"], 924 | ["AAABB7", "Spun Pearl"], 925 | ["AAD6E6", "Regent St Blue"], 926 | ["AAF0D1", "Magic Mint"], 927 | ["AB0563", "Lipstick"], 928 | ["AB3472", "Royal Heath"], 929 | ["AB917A", "Sandrift"], 930 | ["ABA0D9", "Cold Purple"], 931 | ["ABA196", "Bronco"], 932 | ["AC8A56", "Limed Oak"], 933 | ["AC91CE", "East Side"], 934 | ["AC9E22", "Lemon Ginger"], 935 | ["ACA494", "Napa"], 936 | ["ACA586", "Hillary"], 937 | ["ACA59F", "Cloudy"], 938 | ["ACACAC", "Silver Chalice"], 939 | ["ACB78E", "Swamp Green"], 940 | ["ACCBB1", "Spring Rain"], 941 | ["ACDD4D", "Conifer"], 942 | ["ACE1AF", "Celadon"], 943 | ["AD781B", "Mandalay"], 944 | ["ADBED1", "Casper"], 945 | ["ADDFAD", "Moss Green"], 946 | ["ADE6C4", "Padua"], 947 | ["ADFF2F", "Green Yellow"], 948 | ["AE4560", "Hippie Pink"], 949 | ["AE6020", "Desert"], 950 | ["AE809E", "Bouquet"], 951 | ["AF4035", "Medium Carmine"], 952 | ["AF4D43", "Apple Blossom"], 953 | ["AF593E", "Brown Rust"], 954 | ["AF8751", "Driftwood"], 955 | ["AF8F2C", "Alpine"], 956 | ["AF9F1C", "Lucky"], 957 | ["AFA09E", "Martini"], 958 | ["AFB1B8", "Bombay"], 959 | ["AFBDD9", "Pigeon Post"], 960 | ["B04C6A", "Cadillac"], 961 | ["B05D54", "Matrix"], 962 | ["B05E81", "Tapestry"], 963 | ["B06608", "Mai Tai"], 964 | ["B09A95", "Del Rio"], 965 | ["B0E0E6", "Powder Blue"], 966 | ["B0E313", "Inch Worm"], 967 | ["B10000", "Bright Red"], 968 | ["B14A0B", "Vesuvius"], 969 | ["B1610B", "Pumpkin Skin"], 970 | ["B16D52", "Santa Fe"], 971 | ["B19461", "Teak"], 972 | ["B1E2C1", "Fringy Flower"], 973 | ["B1F4E7", "Ice Cold"], 974 | ["B20931", "Shiraz"], 975 | ["B2A1EA", "Biloba Flower"], 976 | ["B32D29", "Tall Poppy"], 977 | ["B35213", "Fiery Orange"], 978 | ["B38007", "Hot Toddy"], 979 | ["B3AF95", "Taupe Gray"], 980 | ["B3C110", "La Rioja"], 981 | ["B43332", "Well Read"], 982 | ["B44668", "Blush"], 983 | ["B4CFD3", "Jungle Mist"], 984 | ["B57281", "Turkish Rose"], 985 | ["B57EDC", "Lavender"], 986 | ["B5A27F", "Mongoose"], 987 | ["B5B35C", "Olive Green"], 988 | ["B5D2CE", "Jet Stream"], 989 | ["B5ECDF", "Cruise"], 990 | ["B6316C", "Hibiscus"], 991 | ["B69D98", "Thatch"], 992 | ["B6B095", "Heathered Gray"], 993 | ["B6BAA4", "Eagle"], 994 | ["B6D1EA", "Spindle"], 995 | ["B6D3BF", "Gum Leaf"], 996 | ["B7410E", "Rust"], 997 | ["B78E5C", "Muddy Waters"], 998 | ["B7A214", "Sahara"], 999 | ["B7A458", "Husk"], 1000 | ["B7B1B1", "Nobel"], 1001 | ["B7C3D0", "Heather"], 1002 | ["B7F0BE", "Madang"], 1003 | ["B81104", "Milano Red"], 1004 | ["B87333", "Copper"], 1005 | ["B8B56A", "Gimblet"], 1006 | ["B8C1B1", "Green Spring"], 1007 | ["B8C25D", "Celery"], 1008 | ["B8E0F9", "Sail"], 1009 | ["B94E48", "Chestnut"], 1010 | ["B95140", "Crail"], 1011 | ["B98D28", "Marigold"], 1012 | ["B9C46A", "Wild Willow"], 1013 | ["B9C8AC", "Rainee"], 1014 | ["BA0101", "Guardsman Red"], 1015 | ["BA450C", "Rock Spray"], 1016 | ["BA6F1E", "Bourbon"], 1017 | ["BA7F03", "Pirate Gold"], 1018 | ["BAB1A2", "Nomad"], 1019 | ["BAC7C9", "Submarine"], 1020 | ["BAEEF9", "Charlotte"], 1021 | ["BB3385", "Medium Red Violet"], 1022 | ["BB8983", "Brandy Rose"], 1023 | ["BBD009", "Rio Grande"], 1024 | ["BBD7C1", "Surf"], 1025 | ["BCC9C2", "Powder Ash"], 1026 | ["BD5E2E", "Tuscany"], 1027 | ["BD978E", "Quicksand"], 1028 | ["BDB1A8", "Silk"], 1029 | ["BDB2A1", "Malta"], 1030 | ["BDB3C7", "Chatelle"], 1031 | ["BDBBD7", "Lavender Gray"], 1032 | ["BDBDC6", "French Gray"], 1033 | ["BDC8B3", "Clay Ash"], 1034 | ["BDC9CE", "Loblolly"], 1035 | ["BDEDFD", "French Pass"], 1036 | ["BEA6C3", "London Hue"], 1037 | ["BEB5B7", "Pink Swan"], 1038 | ["BEDE0D", "Fuego"], 1039 | ["BF5500", "Rose of Sharon"], 1040 | ["BFB8B0", "Tide"], 1041 | ["BFBED8", "Blue Haze"], 1042 | ["BFC1C2", "Silver Sand"], 1043 | ["BFC921", "Key Lime Pie"], 1044 | ["BFDBE2", "Ziggurat"], 1045 | ["BFFF00", "Lime"], 1046 | ["C02B18", "Thunderbird"], 1047 | ["C04737", "Mojo"], 1048 | ["C08081", "Old Rose"], 1049 | ["C0C0C0", "Silver"], 1050 | ["C0D3B9", "Pale Leaf"], 1051 | ["C0D8B6", "Pixie Green"], 1052 | ["C1440E", "Tia Maria"], 1053 | ["C154C1", "Fuchsia Pink"], 1054 | ["C1A004", "Buddha Gold"], 1055 | ["C1B7A4", "Bison Hide"], 1056 | ["C1BAB0", "Tea"], 1057 | ["C1BECD", "Gray Suit"], 1058 | ["C1D7B0", "Sprout"], 1059 | ["C1F07C", "Sulu"], 1060 | ["C26B03", "Indochine"], 1061 | ["C2955D", "Twine"], 1062 | ["C2BDB6", "Cotton Seed"], 1063 | ["C2CAC4", "Pumice"], 1064 | ["C2E8E5", "Jagged Ice"], 1065 | ["C32148", "Maroon Flush"], 1066 | ["C3B091", "Indian Khaki"], 1067 | ["C3BFC1", "Pale Slate"], 1068 | ["C3C3BD", "Gray Nickel"], 1069 | ["C3CDE6", "Periwinkle Gray"], 1070 | ["C3D1D1", "Tiara"], 1071 | ["C3DDF9", "Tropical Blue"], 1072 | ["C41E3A", "Cardinal"], 1073 | ["C45655", "Fuzzy Wuzzy Brown"], 1074 | ["C45719", "Orange Roughy"], 1075 | ["C4C4BC", "Mist Gray"], 1076 | ["C4D0B0", "Coriander"], 1077 | ["C4F4EB", "Mint Tulip"], 1078 | ["C54B8C", "Mulberry"], 1079 | ["C59922", "Nugget"], 1080 | ["C5994B", "Tussock"], 1081 | ["C5DBCA", "Sea Mist"], 1082 | ["C5E17A", "Yellow Green"], 1083 | ["C62D42", "Brick Red"], 1084 | ["C6726B", "Contessa"], 1085 | ["C69191", "Oriental Pink"], 1086 | ["C6A84B", "Roti"], 1087 | ["C6C3B5", "Ash"], 1088 | ["C6C8BD", "Kangaroo"], 1089 | ["C6E610", "Las Palmas"], 1090 | ["C7031E", "Monza"], 1091 | ["C71585", "Red Violet"], 1092 | ["C7BCA2", "Coral Reef"], 1093 | ["C7C1FF", "Melrose"], 1094 | ["C7C4BF", "Cloud"], 1095 | ["C7C9D5", "Ghost"], 1096 | ["C7CD90", "Pine Glade"], 1097 | ["C7DDE5", "Botticelli"], 1098 | ["C88A65", "Antique Brass"], 1099 | ["C8A2C8", "Lilac"], 1100 | ["C8A528", "Hokey Pokey"], 1101 | ["C8AABF", "Lily"], 1102 | ["C8B568", "Laser"], 1103 | ["C8E3D7", "Edgewater"], 1104 | ["C96323", "Piper"], 1105 | ["C99415", "Pizza"], 1106 | ["C9A0DC", "Light Wisteria"], 1107 | ["C9B29B", "Rodeo Dust"], 1108 | ["C9B35B", "Sundance"], 1109 | ["C9B93B", "Earls Green"], 1110 | ["C9C0BB", "Silver Rust"], 1111 | ["C9D9D2", "Conch"], 1112 | ["C9FFA2", "Reef"], 1113 | ["C9FFE5", "Aero Blue"], 1114 | ["CA3435", "Flush Mahogany"], 1115 | ["CABB48", "Turmeric"], 1116 | ["CADCD4", "Paris White"], 1117 | ["CAE00D", "Bitter Lemon"], 1118 | ["CAE6DA", "Skeptic"], 1119 | ["CB8FA9", "Viola"], 1120 | ["CBCAB6", "Foggy Gray"], 1121 | ["CBD3B0", "Green Mist"], 1122 | ["CBDBD6", "Nebula"], 1123 | ["CC3333", "Persian Red"], 1124 | ["CC5500", "Burnt Orange"], 1125 | ["CC7722", "Ochre"], 1126 | ["CC8899", "Puce"], 1127 | ["CCCAA8", "Thistle Green"], 1128 | ["CCCCFF", "Periwinkle"], 1129 | ["CCFF00", "Electric Lime"], 1130 | ["CD5700", "Tenn"], 1131 | ["CD5C5C", "Chestnut Rose"], 1132 | ["CD8429", "Brandy Punch"], 1133 | ["CDF4FF", "Onahau"], 1134 | ["CEB98F", "Sorrell Brown"], 1135 | ["CEBABA", "Cold Turkey"], 1136 | ["CEC291", "Yuma"], 1137 | ["CEC7A7", "Chino"], 1138 | ["CFA39D", "Eunry"], 1139 | ["CFB53B", "Old Gold"], 1140 | ["CFDCCF", "Tasman"], 1141 | ["CFE5D2", "Surf Crest"], 1142 | ["CFF9F3", "Humming Bird"], 1143 | ["CFFAF4", "Scandal"], 1144 | ["D05F04", "Red Stage"], 1145 | ["D06DA1", "Hopbush"], 1146 | ["D07D12", "Meteor"], 1147 | ["D0BEF8", "Perfume"], 1148 | ["D0C0E5", "Prelude"], 1149 | ["D0F0C0", "Tea Green"], 1150 | ["D18F1B", "Geebung"], 1151 | ["D1BEA8", "Vanilla"], 1152 | ["D1C6B4", "Soft Amber"], 1153 | ["D1D2CA", "Celeste"], 1154 | ["D1D2DD", "Mischka"], 1155 | ["D1E231", "Pear"], 1156 | ["D2691E", "Hot Cinnamon"], 1157 | ["D27D46", "Raw Sienna"], 1158 | ["D29EAA", "Careys Pink"], 1159 | ["D2B48C", "Tan"], 1160 | ["D2DA97", "Deco"], 1161 | ["D2F6DE", "Blue Romance"], 1162 | ["D2F8B0", "Gossip"], 1163 | ["D3CBBA", "Sisal"], 1164 | ["D3CDC5", "Swirl"], 1165 | ["D47494", "Charm"], 1166 | ["D4B6AF", "Clam Shell"], 1167 | ["D4BF8D", "Straw"], 1168 | ["D4C4A8", "Akaroa"], 1169 | ["D4CD16", "Bird Flower"], 1170 | ["D4D7D9", "Iron"], 1171 | ["D4DFE2", "Geyser"], 1172 | ["D4E2FC", "Hawkes Blue"], 1173 | ["D54600", "Grenadier"], 1174 | ["D591A4", "Can Can"], 1175 | ["D59A6F", "Whiskey"], 1176 | ["D5D195", "Winter Hazel"], 1177 | ["D5F6E3", "Granny Apple"], 1178 | ["D69188", "My Pink"], 1179 | ["D6C562", "Tacha"], 1180 | ["D6CEF6", "Moon Raker"], 1181 | ["D6D6D1", "Quill Gray"], 1182 | ["D6FFDB", "Snowy Mint"], 1183 | ["D7837F", "New York Pink"], 1184 | ["D7C498", "Pavlova"], 1185 | ["D7D0FF", "Fog"], 1186 | ["D84437", "Valencia"], 1187 | ["D87C63", "Japonica"], 1188 | ["D8BFD8", "Thistle"], 1189 | ["D8C2D5", "Maverick"], 1190 | ["D8FCFA", "Foam"], 1191 | ["D94972", "Cabaret"], 1192 | ["D99376", "Burning Sand"], 1193 | ["D9B99B", "Cameo"], 1194 | ["D9D6CF", "Timberwolf"], 1195 | ["D9DCC1", "Tana"], 1196 | ["D9E4F5", "Link Water"], 1197 | ["D9F7FF", "Mabel"], 1198 | ["DA3287", "Cerise"], 1199 | ["DA5B38", "Flame Pea"], 1200 | ["DA6304", "Bamboo"], 1201 | ["DA6A41", "Red Damask"], 1202 | ["DA70D6", "Orchid"], 1203 | ["DA8A67", "Copperfield"], 1204 | ["DAA520", "Golden Grass"], 1205 | ["DAECD6", "Zanah"], 1206 | ["DAF4F0", "Iceberg"], 1207 | ["DAFAFF", "Oyster Bay"], 1208 | ["DB5079", "Cranberry"], 1209 | ["DB9690", "Petite Orchid"], 1210 | ["DB995E", "Di Serria"], 1211 | ["DBDBDB", "Alto"], 1212 | ["DBFFF8", "Frosted Mint"], 1213 | ["DC143C", "Crimson"], 1214 | ["DC4333", "Punch"], 1215 | ["DCB20C", "Galliano"], 1216 | ["DCB4BC", "Blossom"], 1217 | ["DCD747", "Wattle"], 1218 | ["DCD9D2", "Westar"], 1219 | ["DCDDCC", "Moon Mist"], 1220 | ["DCEDB4", "Caper"], 1221 | ["DCF0EA", "Swans Down"], 1222 | ["DDD6D5", "Swiss Coffee"], 1223 | ["DDF9F1", "White Ice"], 1224 | ["DE3163", "Cerise Red"], 1225 | ["DE6360", "Roman"], 1226 | ["DEA681", "Tumbleweed"], 1227 | ["DEBA13", "Gold Tips"], 1228 | ["DEC196", "Brandy"], 1229 | ["DECBC6", "Wafer"], 1230 | ["DED4A4", "Sapling"], 1231 | ["DED717", "Barberry"], 1232 | ["DEE5C0", "Beryl Green"], 1233 | ["DEF5FF", "Pattens Blue"], 1234 | ["DF73FF", "Heliotrope"], 1235 | ["DFBE6F", "Apache"], 1236 | ["DFCD6F", "Chenin"], 1237 | ["DFCFDB", "Lola"], 1238 | ["DFECDA", "Willow Brook"], 1239 | ["DFFF00", "Chartreuse Yellow"], 1240 | ["E0B0FF", "Mauve"], 1241 | ["E0B646", "Anzac"], 1242 | ["E0B974", "Harvest Gold"], 1243 | ["E0C095", "Calico"], 1244 | ["E0FFFF", "Baby Blue"], 1245 | ["E16865", "Sunglo"], 1246 | ["E1BC64", "Equator"], 1247 | ["E1C0C8", "Pink Flare"], 1248 | ["E1E6D6", "Periglacial Blue"], 1249 | ["E1EAD4", "Kidnapper"], 1250 | ["E1F6E8", "Tara"], 1251 | ["E25465", "Mandy"], 1252 | ["E2725B", "Terracotta"], 1253 | ["E28913", "Golden Bell"], 1254 | ["E292C0", "Shocking"], 1255 | ["E29418", "Dixie"], 1256 | ["E29CD2", "Light Orchid"], 1257 | ["E2D8ED", "Snuff"], 1258 | ["E2EBED", "Mystic"], 1259 | ["E2F3EC", "Apple Green"], 1260 | ["E30B5C", "Razzmatazz"], 1261 | ["E32636", "Alizarin Crimson"], 1262 | ["E34234", "Cinnabar"], 1263 | ["E3BEBE", "Cavern Pink"], 1264 | ["E3F5E1", "Peppermint"], 1265 | ["E3F988", "Mindaro"], 1266 | ["E47698", "Deep Blush"], 1267 | ["E49B0F", "Gamboge"], 1268 | ["E4C2D5", "Melanie"], 1269 | ["E4CFDE", "Twilight"], 1270 | ["E4D1C0", "Bone"], 1271 | ["E4D422", "Sunflower"], 1272 | ["E4D5B7", "Grain Brown"], 1273 | ["E4D69B", "Zombie"], 1274 | ["E4F6E7", "Frostee"], 1275 | ["E4FFD1", "Snow Flurry"], 1276 | ["E52B50", "Amaranth"], 1277 | ["E5841B", "Zest"], 1278 | ["E5CCC9", "Dust Storm"], 1279 | ["E5D7BD", "Stark White"], 1280 | ["E5D8AF", "Hampton"], 1281 | ["E5E0E1", "Bon Jour"], 1282 | ["E5E5E5", "Mercury"], 1283 | ["E5F9F6", "Polar"], 1284 | ["E64E03", "Trinidad"], 1285 | ["E6BE8A", "Gold Sand"], 1286 | ["E6BEA5", "Cashmere"], 1287 | ["E6D7B9", "Double Spanish White"], 1288 | ["E6E4D4", "Satin Linen"], 1289 | ["E6F2EA", "Harp"], 1290 | ["E6F8F3", "Off Green"], 1291 | ["E6FFE9", "Hint of Green"], 1292 | ["E6FFFF", "Tranquil"], 1293 | ["E77200", "Mango Tango"], 1294 | ["E7730A", "Christine"], 1295 | ["E79F8C", "Tonys Pink"], 1296 | ["E79FC4", "Kobi"], 1297 | ["E7BCB4", "Rose Fog"], 1298 | ["E7BF05", "Corn"], 1299 | ["E7CD8C", "Putty"], 1300 | ["E7ECE6", "Gray Nurse"], 1301 | ["E7F8FF", "Lily White"], 1302 | ["E7FEFF", "Bubbles"], 1303 | ["E89928", "Fire Bush"], 1304 | ["E8B9B3", "Shilo"], 1305 | ["E8E0D5", "Pearl Bush"], 1306 | ["E8EBE0", "Green White"], 1307 | ["E8F1D4", "Chrome White"], 1308 | ["E8F2EB", "Gin"], 1309 | ["E8F5F2", "Aqua Squeeze"], 1310 | ["E96E00", "Clementine"], 1311 | ["E97451", "Burnt Sienna"], 1312 | ["E97C07", "Tahiti Gold"], 1313 | ["E9CECD", "Oyster Pink"], 1314 | ["E9D75A", "Confetti"], 1315 | ["E9E3E3", "Ebb"], 1316 | ["E9F8ED", "Ottoman"], 1317 | ["E9FFFD", "Clear Day"], 1318 | ["EA88A8", "Carissma"], 1319 | ["EAAE69", "Porsche"], 1320 | ["EAB33B", "Tulip Tree"], 1321 | ["EAC674", "Rob Roy"], 1322 | ["EADAB8", "Raffia"], 1323 | ["EAE8D4", "White Rock"], 1324 | ["EAF6EE", "Panache"], 1325 | ["EAF6FF", "Solitude"], 1326 | ["EAF9F5", "Aqua Spring"], 1327 | ["EAFFFE", "Dew"], 1328 | ["EB9373", "Apricot"], 1329 | ["EBC2AF", "Zinnwaldite"], 1330 | ["ECA927", "Fuel Yellow"], 1331 | ["ECC54E", "Ronchi"], 1332 | ["ECC7EE", "French Lilac"], 1333 | ["ECCDB9", "Just Right"], 1334 | ["ECE090", "Wild Rice"], 1335 | ["ECEBBD", "Fall Green"], 1336 | ["ECEBCE", "Aths Special"], 1337 | ["ECF245", "Starship"], 1338 | ["ED0A3F", "Red Ribbon"], 1339 | ["ED7A1C", "Tango"], 1340 | ["ED9121", "Carrot Orange"], 1341 | ["ED989E", "Sea Pink"], 1342 | ["EDB381", "Tacao"], 1343 | ["EDC9AF", "Desert Sand"], 1344 | ["EDCDAB", "Pancho"], 1345 | ["EDDCB1", "Chamois"], 1346 | ["EDEA99", "Primrose"], 1347 | ["EDF5DD", "Frost"], 1348 | ["EDF5F5", "Aqua Haze"], 1349 | ["EDF6FF", "Zumthor"], 1350 | ["EDF9F1", "Narvik"], 1351 | ["EDFC84", "Honeysuckle"], 1352 | ["EE82EE", "Lavender Magenta"], 1353 | ["EEC1BE", "Beauty Bush"], 1354 | ["EED794", "Chalky"], 1355 | ["EED9C4", "Almond"], 1356 | ["EEDC82", "Flax"], 1357 | ["EEDEDA", "Bizarre"], 1358 | ["EEE3AD", "Double Colonial White"], 1359 | ["EEEEE8", "Cararra"], 1360 | ["EEEF78", "Manz"], 1361 | ["EEF0C8", "Tahuna Sands"], 1362 | ["EEF0F3", "Athens Gray"], 1363 | ["EEF3C3", "Tusk"], 1364 | ["EEF4DE", "Loafer"], 1365 | ["EEF6F7", "Catskill White"], 1366 | ["EEFDFF", "Twilight Blue"], 1367 | ["EEFF9A", "Jonquil"], 1368 | ["EEFFE2", "Rice Flower"], 1369 | ["EF863F", "Jaffa"], 1370 | ["EFEFEF", "Gallery"], 1371 | ["EFF2F3", "Porcelain"], 1372 | ["F091A9", "Mauvelous"], 1373 | ["F0D52D", "Golden Dream"], 1374 | ["F0DB7D", "Golden Sand"], 1375 | ["F0DC82", "Buff"], 1376 | ["F0E2EC", "Prim"], 1377 | ["F0E68C", "Khaki"], 1378 | ["F0EEFD", "Selago"], 1379 | ["F0EEFF", "Titan White"], 1380 | ["F0F8FF", "Alice Blue"], 1381 | ["F0FCEA", "Feta"], 1382 | ["F18200", "Gold Drop"], 1383 | ["F19BAB", "Wewak"], 1384 | ["F1E788", "Sahara Sand"], 1385 | ["F1E9D2", "Parchment"], 1386 | ["F1E9FF", "Blue Chalk"], 1387 | ["F1EEC1", "Mint Julep"], 1388 | ["F1F1F1", "Seashell"], 1389 | ["F1F7F2", "Saltpan"], 1390 | ["F1FFAD", "Tidal"], 1391 | ["F1FFC8", "Chiffon"], 1392 | ["F2552A", "Flamingo"], 1393 | ["F28500", "Tangerine"], 1394 | ["F2C3B2", "Mandys Pink"], 1395 | ["F2F2F2", "Concrete"], 1396 | ["F2FAFA", "Black Squeeze"], 1397 | ["F34723", "Pomegranate"], 1398 | ["F3AD16", "Buttercup"], 1399 | ["F3D69D", "New Orleans"], 1400 | ["F3D9DF", "Vanilla Ice"], 1401 | ["F3E7BB", "Sidecar"], 1402 | ["F3E9E5", "Dawn Pink"], 1403 | ["F3EDCF", "Wheatfield"], 1404 | ["F3FB62", "Canary"], 1405 | ["F3FBD4", "Orinoco"], 1406 | ["F3FFD8", "Carla"], 1407 | ["F400A1", "Hollywood Cerise"], 1408 | ["F4A460", "Sandy brown"], 1409 | ["F4C430", "Saffron"], 1410 | ["F4D81C", "Ripe Lemon"], 1411 | ["F4EBD3", "Janna"], 1412 | ["F4F2EE", "Pampas"], 1413 | ["F4F4F4", "Wild Sand"], 1414 | ["F4F8FF", "Zircon"], 1415 | ["F57584", "Froly"], 1416 | ["F5C85C", "Cream Can"], 1417 | ["F5C999", "Manhattan"], 1418 | ["F5D5A0", "Maize"], 1419 | ["F5DEB3", "Wheat"], 1420 | ["F5E7A2", "Sandwisp"], 1421 | ["F5E7E2", "Pot Pourri"], 1422 | ["F5E9D3", "Albescent White"], 1423 | ["F5EDEF", "Soft Peach"], 1424 | ["F5F3E5", "Ecru White"], 1425 | ["F5F5DC", "Beige"], 1426 | ["F5FB3D", "Golden Fizz"], 1427 | ["F5FFBE", "Australian Mint"], 1428 | ["F64A8A", "French Rose"], 1429 | ["F653A6", "Brilliant Rose"], 1430 | ["F6A4C9", "Illusion"], 1431 | ["F6F0E6", "Merino"], 1432 | ["F6F7F7", "Black Haze"], 1433 | ["F6FFDC", "Spring Sun"], 1434 | ["F7468A", "Violet Red"], 1435 | ["F77703", "Chilean Fire"], 1436 | ["F77FBE", "Persian Pink"], 1437 | ["F7B668", "Rajah"], 1438 | ["F7C8DA", "Azalea"], 1439 | ["F7DBE6", "We Peep"], 1440 | ["F7F2E1", "Quarter Spanish White"], 1441 | ["F7F5FA", "Whisper"], 1442 | ["F7FAF7", "Snow Drift"], 1443 | ["F8B853", "Casablanca"], 1444 | ["F8C3DF", "Chantilly"], 1445 | ["F8D9E9", "Cherub"], 1446 | ["F8DB9D", "Marzipan"], 1447 | ["F8DD5C", "Energy Yellow"], 1448 | ["F8E4BF", "Givry"], 1449 | ["F8F0E8", "White Linen"], 1450 | ["F8F4FF", "Magnolia"], 1451 | ["F8F6F1", "Spring Wood"], 1452 | ["F8F7DC", "Coconut Cream"], 1453 | ["F8F7FC", "White Lilac"], 1454 | ["F8F8F7", "Desert Storm"], 1455 | ["F8F99C", "Texas"], 1456 | ["F8FACD", "Corn Field"], 1457 | ["F8FDD3", "Mimosa"], 1458 | ["F95A61", "Carnation"], 1459 | ["F9BF58", "Saffron Mango"], 1460 | ["F9E0ED", "Carousel Pink"], 1461 | ["F9E4BC", "Dairy Cream"], 1462 | ["F9E663", "Portica"], 1463 | ["F9EAF3", "Amour"], 1464 | ["F9F8E4", "Rum Swizzle"], 1465 | ["F9FF8B", "Dolly"], 1466 | ["F9FFF6", "Sugar Cane"], 1467 | ["FA7814", "Ecstasy"], 1468 | ["FA9D5A", "Tan Hide"], 1469 | ["FAD3A2", "Corvette"], 1470 | ["FADFAD", "Peach Yellow"], 1471 | ["FAE600", "Turbo"], 1472 | ["FAEAB9", "Astra"], 1473 | ["FAECCC", "Champagne"], 1474 | ["FAF0E6", "Linen"], 1475 | ["FAF3F0", "Fantasy"], 1476 | ["FAF7D6", "Citrine White"], 1477 | ["FAFAFA", "Alabaster"], 1478 | ["FAFDE4", "Hint of Yellow"], 1479 | ["FAFFA4", "Milan"], 1480 | ["FB607F", "Brink Pink"], 1481 | ["FB8989", "Geraldine"], 1482 | ["FBA0E3", "Lavender Rose"], 1483 | ["FBA129", "Sea Buckthorn"], 1484 | ["FBAC13", "Sun"], 1485 | ["FBAED2", "Lavender Pink"], 1486 | ["FBB2A3", "Rose Bud"], 1487 | ["FBBEDA", "Cupid"], 1488 | ["FBCCE7", "Classic Rose"], 1489 | ["FBCEB1", "Apricot Peach"], 1490 | ["FBE7B2", "Banana Mania"], 1491 | ["FBE870", "Marigold Yellow"], 1492 | ["FBE96C", "Festival"], 1493 | ["FBEA8C", "Sweet Corn"], 1494 | ["FBEC5D", "Candy Corn"], 1495 | ["FBF9F9", "Hint of Red"], 1496 | ["FBFFBA", "Shalimar"], 1497 | ["FC0FC0", "Shocking Pink"], 1498 | ["FC80A5", "Tickle Me Pink"], 1499 | ["FC9C1D", "Tree Poppy"], 1500 | ["FCC01E", "Lightning Yellow"], 1501 | ["FCD667", "Goldenrod"], 1502 | ["FCD917", "Candlelight"], 1503 | ["FCDA98", "Cherokee"], 1504 | ["FCF4D0", "Double Pearl Lusta"], 1505 | ["FCF4DC", "Pearl Lusta"], 1506 | ["FCF8F7", "Vista White"], 1507 | ["FCFBF3", "Bianca"], 1508 | ["FCFEDA", "Moon Glow"], 1509 | ["FCFFE7", "China Ivory"], 1510 | ["FCFFF9", "Ceramic"], 1511 | ["FD0E35", "Torch Red"], 1512 | ["FD5B78", "Wild Watermelon"], 1513 | ["FD7B33", "Crusta"], 1514 | ["FD7C07", "Sorbus"], 1515 | ["FD9FA2", "Sweet Pink"], 1516 | ["FDD5B1", "Light Apricot"], 1517 | ["FDD7E4", "Pig Pink"], 1518 | ["FDE1DC", "Cinderella"], 1519 | ["FDE295", "Golden Glow"], 1520 | ["FDE910", "Lemon"], 1521 | ["FDF5E6", "Old Lace"], 1522 | ["FDF6D3", "Half Colonial White"], 1523 | ["FDF7AD", "Drover"], 1524 | ["FDFEB8", "Pale Prim"], 1525 | ["FDFFD5", "Cumulus"], 1526 | ["FE28A2", "Persian Rose"], 1527 | ["FE4C40", "Sunset Orange"], 1528 | ["FE6F5E", "Bittersweet"], 1529 | ["FE9D04", "California"], 1530 | ["FEA904", "Yellow Sea"], 1531 | ["FEBAAD", "Melon"], 1532 | ["FED33C", "Bright Sun"], 1533 | ["FED85D", "Dandelion"], 1534 | ["FEDB8D", "Salomie"], 1535 | ["FEE5AC", "Cape Honey"], 1536 | ["FEEBF3", "Remy"], 1537 | ["FEEFCE", "Oasis"], 1538 | ["FEF0EC", "Bridesmaid"], 1539 | ["FEF2C7", "Beeswax"], 1540 | ["FEF3D8", "Bleach White"], 1541 | ["FEF4CC", "Pipi"], 1542 | ["FEF4DB", "Half Spanish White"], 1543 | ["FEF4F8", "Wisp Pink"], 1544 | ["FEF5F1", "Provincial Pink"], 1545 | ["FEF7DE", "Half Dutch White"], 1546 | ["FEF8E2", "Solitaire"], 1547 | ["FEF8FF", "White Pointer"], 1548 | ["FEF9E3", "Off Yellow"], 1549 | ["FEFCED", "Orange White"], 1550 | ["FF0000", "Red"], 1551 | ["FF007F", "Rose"], 1552 | ["FF00CC", "Purple Pizzazz"], 1553 | ["FF00FF", "Magenta / Fuchsia"], 1554 | ["FF2400", "Scarlet"], 1555 | ["FF3399", "Wild Strawberry"], 1556 | ["FF33CC", "Razzle Dazzle Rose"], 1557 | ["FF355E", "Radical Red"], 1558 | ["FF3F34", "Red Orange"], 1559 | ["FF4040", "Coral Red"], 1560 | ["FF4D00", "Vermilion"], 1561 | ["FF4F00", "International Orange"], 1562 | ["FF6037", "Outrageous Orange"], 1563 | ["FF6600", "Blaze Orange"], 1564 | ["FF66FF", "Pink Flamingo"], 1565 | ["FF681F", "Orange"], 1566 | ["FF69B4", "Hot Pink"], 1567 | ["FF6B53", "Persimmon"], 1568 | ["FF6FFF", "Blush Pink"], 1569 | ["FF7034", "Burning Orange"], 1570 | ["FF7518", "Pumpkin"], 1571 | ["FF7D07", "Flamenco"], 1572 | ["FF7F00", "Flush Orange"], 1573 | ["FF7F50", "Coral"], 1574 | ["FF8C69", "Salmon"], 1575 | ["FF9000", "Pizazz"], 1576 | ["FF910F", "West Side"], 1577 | ["FF91A4", "Pink Salmon"], 1578 | ["FF9933", "Neon Carrot"], 1579 | ["FF9966", "Atomic Tangerine"], 1580 | ["FF9980", "Vivid Tangerine"], 1581 | ["FF9E2C", "Sunshade"], 1582 | ["FFA000", "Orange Peel"], 1583 | ["FFA194", "Mona Lisa"], 1584 | ["FFA500", "Web Orange"], 1585 | ["FFA6C9", "Carnation Pink"], 1586 | ["FFAB81", "Hit Pink"], 1587 | ["FFAE42", "Yellow Orange"], 1588 | ["FFB0AC", "Cornflower Lilac"], 1589 | ["FFB1B3", "Sundown"], 1590 | ["FFB31F", "My Sin"], 1591 | ["FFB555", "Texas Rose"], 1592 | ["FFB7D5", "Cotton Candy"], 1593 | ["FFB97B", "Macaroni and Cheese"], 1594 | ["FFBA00", "Selective Yellow"], 1595 | ["FFBD5F", "Koromiko"], 1596 | ["FFBF00", "Amber"], 1597 | ["FFC0A8", "Wax Flower"], 1598 | ["FFC0CB", "Pink"], 1599 | ["FFC3C0", "Your Pink"], 1600 | ["FFC901", "Supernova"], 1601 | ["FFCBA4", "Flesh"], 1602 | ["FFCC33", "Sunglow"], 1603 | ["FFCC5C", "Golden Tainoi"], 1604 | ["FFCC99", "Peach Orange"], 1605 | ["FFCD8C", "Chardonnay"], 1606 | ["FFD1DC", "Pastel Pink"], 1607 | ["FFD2B7", "Romantic"], 1608 | ["FFD38C", "Grandis"], 1609 | ["FFD700", "Gold"], 1610 | ["FFD800", "School bus Yellow"], 1611 | ["FFD8D9", "Cosmos"], 1612 | ["FFDB58", "Mustard"], 1613 | ["FFDCD6", "Peach Schnapps"], 1614 | ["FFDDAF", "Caramel"], 1615 | ["FFDDCD", "Tuft Bush"], 1616 | ["FFDDCF", "Watusi"], 1617 | ["FFDDF4", "Pink Lace"], 1618 | ["FFDEAD", "Navajo White"], 1619 | ["FFDEB3", "Frangipani"], 1620 | ["FFE1DF", "Pippin"], 1621 | ["FFE1F2", "Pale Rose"], 1622 | ["FFE2C5", "Negroni"], 1623 | ["FFE5A0", "Cream Brulee"], 1624 | ["FFE5B4", "Peach"], 1625 | ["FFE6C7", "Tequila"], 1626 | ["FFE772", "Kournikova"], 1627 | ["FFEAC8", "Sandy Beach"], 1628 | ["FFEAD4", "Karry"], 1629 | ["FFEC13", "Broom"], 1630 | ["FFEDBC", "Colonial White"], 1631 | ["FFEED8", "Derby"], 1632 | ["FFEFA1", "Vis Vis"], 1633 | ["FFEFC1", "Egg White"], 1634 | ["FFEFD5", "Papaya Whip"], 1635 | ["FFEFEC", "Fair Pink"], 1636 | ["FFF0DB", "Peach Cream"], 1637 | ["FFF0F5", "Lavender blush"], 1638 | ["FFF14F", "Gorse"], 1639 | ["FFF1B5", "Buttermilk"], 1640 | ["FFF1D8", "Pink Lady"], 1641 | ["FFF1EE", "Forget Me Not"], 1642 | ["FFF1F9", "Tutu"], 1643 | ["FFF39D", "Picasso"], 1644 | ["FFF3F1", "Chardon"], 1645 | ["FFF46E", "Paris Daisy"], 1646 | ["FFF4CE", "Barley White"], 1647 | ["FFF4DD", "Egg Sour"], 1648 | ["FFF4E0", "Sazerac"], 1649 | ["FFF4E8", "Serenade"], 1650 | ["FFF4F3", "Chablis"], 1651 | ["FFF5EE", "Seashell Peach"], 1652 | ["FFF5F3", "Sauvignon"], 1653 | ["FFF6D4", "Milk Punch"], 1654 | ["FFF6DF", "Varden"], 1655 | ["FFF6F5", "Rose White"], 1656 | ["FFF8D1", "Baja White"], 1657 | ["FFF9E2", "Gin Fizz"], 1658 | ["FFF9E6", "Early Dawn"], 1659 | ["FFFACD", "Lemon Chiffon"], 1660 | ["FFFAF4", "Bridal Heath"], 1661 | ["FFFBDC", "Scotch Mist"], 1662 | ["FFFBF9", "Soapstone"], 1663 | ["FFFC99", "Witch Haze"], 1664 | ["FFFCEA", "Buttery White"], 1665 | ["FFFCEE", "Island Spice"], 1666 | ["FFFDD0", "Cream"], 1667 | ["FFFDE6", "Chilean Heath"], 1668 | ["FFFDE8", "Travertine"], 1669 | ["FFFDF3", "Orchid White"], 1670 | ["FFFDF4", "Quarter Pearl Lusta"], 1671 | ["FFFEE1", "Half and Half"], 1672 | ["FFFEEC", "Apricot White"], 1673 | ["FFFEF0", "Rice Cake"], 1674 | ["FFFEF6", "Black White"], 1675 | ["FFFEFD", "Romance"], 1676 | ["FFFF00", "Yellow"], 1677 | ["FFFF66", "Laser Lemon"], 1678 | ["FFFF99", "Pale Canary"], 1679 | ["FFFFB4", "Portafino"], 1680 | ["FFFFF0", "Ivory"], 1681 | ["FFFFFF", "White"] 1682 | ] 1683 | 1684 | } 1685 | 1686 | ntc.init(); 1687 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2015 Wei Wang (http://onevcat.com) 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining a copy 4 | of this software and associated documentation files (the "Software"), to deal 5 | in the Software without restriction, including without limitation the rights 6 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | copies of the Software, and to permit persons to whom the Software is 8 | furnished to do so, subject to the following conditions: 9 | 10 | The above copyright notice and this permission notice shall be included in all 11 | copies or substantial portions of the Software. 12 | 13 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 19 | SOFTWARE. -------------------------------------------------------------------------------- /Package.swift: -------------------------------------------------------------------------------- 1 | // swift-tools-version:5.0 2 | import PackageDescription 3 | 4 | let package = Package( 5 | name: "RandomColor", 6 | platforms: [.iOS(.v8), .macOS(.v10_10), .tvOS(.v9), .watchOS(.v2)], 7 | products: [ 8 | .library(name: "RandomColor", targets: ["RandomColor"]) 9 | ], 10 | targets: [ 11 | .target( 12 | name: "RandomColor", 13 | path: "RandomColor" 14 | ) 15 | ] 16 | ) 17 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Random Color Swift 2 | 3 | Inspired by David Merfield's [randomColor.js](https://github.com/davidmerfield/randomColor). It is a ported version to Swift. You can use the library to generate attractive random colors on iOS or macOS. 4 | 5 | ![](https://raw.githubusercontent.com/onevcat/RandomColorSwift/master/demo.png) 6 | 7 | ## Install 8 | 9 | This framework supports Swift 4.0/4.2/5.0 and above. 10 | 11 | ### Swift Package Manager 12 | 13 | Just like using any other Swift Package, add this repo to the `dependencies` section and depend it in your target: 14 | 15 | ```swift 16 | let package = Package( 17 | name: "MyApp", 18 | //... 19 | dependencies: [ 20 | .package(url: "https://github.com/onevcat/RandomColorSwift.git", .upToNextMajor(from: "2.0.0")), 21 | ], 22 | targets: [ 23 | .target( 24 | name: "MyApp", 25 | dependencies: ["RandomColor"]), 26 | ] 27 | ``` 28 | 29 | Or, use the Swift Package Manager integrated in Xcode 11 or above to [add this package as a dependency to your app](https://developer.apple.com/documentation/xcode/adding_package_dependencies_to_your_app). 30 | 31 | ### CocoaPods 32 | 33 | The easiest way to use `RandomColor` is installing it by [CocoaPods](http://cocoapods.org). Add these lines to your Podfile: 34 | 35 | ```ruby 36 | source 'https://github.com/CocoaPods/Specs.git' 37 | platform :ios, '8.0' 38 | # platform :osx, '10.10' 39 | use_frameworks! 40 | 41 | pod 'RandomColorSwift' 42 | ``` 43 | 44 | ### Carthage 45 | 46 | [Carthage](https://github.com/Carthage/Carthage) is also supported: 47 | 48 | ```ogdl 49 | github "onevcat/RandomColorSwift" 50 | ``` 51 | 52 | ### Manually 53 | 54 | If you need to support iOS 7.x, you will need to add the library manually into your project since dynamic framework is not supported for iOS 7. 55 | 56 | Clone this repo and throw the source files under `RandomColor` folder into your project to use it. 57 | 58 | ## Example 59 | 60 | ```swift 61 | import RandomColor 62 | 63 | // Returns a UIColor or NSColor object for an attractive color 64 | let color = randomColor() 65 | 66 | // Returns an array of ten green colors 67 | let greenColors = randomColors(count: 10, hue: .green) 68 | 69 | // Returns a color for light blue 70 | let lightBlurColor = randomColor(hue: .blue, luminosity: .light) 71 | 72 | // Returns a color for a 'truly random' color 73 | let randomColor = randomColor(hue: .random, luminosity: .random) 74 | 75 | // Returns an array of ten dark pink colors 76 | let darkPinkColors = randomColors(count: 10, hue: .pink, luminosity: .dark) 77 | 78 | // Returns an array of twenty colors at hue of 120 79 | let colors = randomColors(count: 20, hue: .value(120), luminosity: .random) 80 | 81 | ``` 82 | 83 | There is also a demo project in this repo. 84 | 85 | ## Options 86 | 87 | You can pass an options object to influence the type of color it produces. The options object accepts the following properties: 88 | 89 | **Hue** – Controls the hue of the generated color. Possible hue values for colors are `.monochrome`, `.red`, `.orange`, `.yellow`, `.green`, `.blue`, `.purple`, `.pink`, `.random` or `.value(Int)`. If you use `.value(Int)`, you should pass an `Int` between 0 and 360. 90 | 91 | **Luminosity** – Controls the luminosity of the generated color. You can pass `.bright`, `.light`, `.dark` or `.random`. 92 | 93 | **Count** – An `Int` which specifies the number of colors to generate. 94 | 95 | ## Acknowledgements 96 | 97 | Thanks for David Merfield bringing us randomColor.js, which is a great utility. 98 | 99 | The demo project is using Chirag Mehta's [Name the Color](http://chir.ag/projects/name-that-color) JavaScript library to extract name of color. 100 | 101 | ## License 102 | 103 | This project is licensed under the terms of the MIT license. 104 | 105 | 106 | -------------------------------------------------------------------------------- /RandomColor/ColorDefinition.swift: -------------------------------------------------------------------------------- 1 | // 2 | // ColorDefinition.swift 3 | // RandomColorSwift 4 | // 5 | // Copyright (c) 2020 Wei Wang (http://onevcat.com) 6 | // 7 | // Permission is hereby granted, free of charge, to any person obtaining a copy 8 | // of this software and associated documentation files (the "Software"), to deal 9 | // in the Software without restriction, including without limitation the rights 10 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 11 | // copies of the Software, and to permit persons to whom the Software is 12 | // furnished to do so, subject to the following conditions: 13 | // 14 | // The above copyright notice and this permission notice shall be included in all 15 | // copies or substantial portions of the Software. 16 | // 17 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 18 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 19 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 20 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 21 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 22 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 23 | // SOFTWARE. 24 | 25 | import Foundation 26 | 27 | typealias Range = (min: Int, max: Int) 28 | 29 | struct ColorDefinition { 30 | let hueRange: Range? 31 | let lowerBounds: [Range] 32 | 33 | lazy var saturationRange: Range = { 34 | let sMin = self.lowerBounds[0].0 35 | let sMax = self.lowerBounds[self.lowerBounds.count - 1].0 36 | return (sMin, sMax) 37 | }() 38 | 39 | lazy var brightnessRange: Range = { 40 | let bMin = self.lowerBounds[self.lowerBounds.count - 1].1 41 | let bMax = self.lowerBounds[0].1 42 | return (bMin, bMax) 43 | }() 44 | 45 | init(hueRange: Range?, lowerBounds: [Range]) { 46 | self.hueRange = hueRange 47 | self.lowerBounds = lowerBounds 48 | } 49 | } 50 | -------------------------------------------------------------------------------- /RandomColor/Hue.swift: -------------------------------------------------------------------------------- 1 | // 2 | // Hue.swift 3 | // RandomColorSwift 4 | // 5 | // Copyright (c) 2020 Wei Wang (http://onevcat.com) 6 | // 7 | // Permission is hereby granted, free of charge, to any person obtaining a copy 8 | // of this software and associated documentation files (the "Software"), to deal 9 | // in the Software without restriction, including without limitation the rights 10 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 11 | // copies of the Software, and to permit persons to whom the Software is 12 | // furnished to do so, subject to the following conditions: 13 | // 14 | // The above copyright notice and this permission notice shall be included in all 15 | // copies or substantial portions of the Software. 16 | // 17 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 18 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 19 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 20 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 21 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 22 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 23 | // SOFTWARE. 24 | 25 | import Foundation 26 | 27 | public enum Hue { 28 | 29 | case monochrome, red, orange, yellow, green, blue, purple, pink 30 | case value(Int) 31 | case random 32 | 33 | public func toInt() -> Int { 34 | switch self { 35 | case .monochrome: return 1 36 | case .red: return 2 37 | case .orange: return 3 38 | case .yellow: return 4 39 | case .green: return 5 40 | case .blue: return 6 41 | case .purple: return 7 42 | case .pink: return 8 43 | case .value(_): return -1 44 | case .random: return 0 45 | } 46 | } 47 | } 48 | 49 | public func == (lhs: Hue, rhs: Hue) -> Bool { 50 | return lhs.toInt() == rhs.toInt() 51 | } 52 | 53 | extension Hue: Hashable { 54 | public func hash(into hasher: inout Hasher) { 55 | hasher.combine(self.toInt()) 56 | } 57 | } 58 | -------------------------------------------------------------------------------- /RandomColor/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 | -------------------------------------------------------------------------------- /RandomColor/Luminosity.swift: -------------------------------------------------------------------------------- 1 | // 2 | // Luminosity.swift 3 | // RandomColorSwift 4 | // 5 | // Copyright (c) 2020 Wei Wang (http://onevcat.com) 6 | // 7 | // Permission is hereby granted, free of charge, to any person obtaining a copy 8 | // of this software and associated documentation files (the "Software"), to deal 9 | // in the Software without restriction, including without limitation the rights 10 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 11 | // copies of the Software, and to permit persons to whom the Software is 12 | // furnished to do so, subject to the following conditions: 13 | // 14 | // The above copyright notice and this permission notice shall be included in all 15 | // copies or substantial portions of the Software. 16 | // 17 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 18 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 19 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 20 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 21 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 22 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 23 | // SOFTWARE. 24 | 25 | import Foundation 26 | 27 | public enum Luminosity: Int { 28 | case bright, light, dark 29 | case random 30 | } 31 | -------------------------------------------------------------------------------- /RandomColor/RandomColor.h: -------------------------------------------------------------------------------- 1 | // 2 | // RandomColor.h 3 | // RandomColor 4 | // 5 | // Copyright (c) 2020 Wei Wang (http://onevcat.com) 6 | // 7 | // Permission is hereby granted, free of charge, to any person obtaining a copy 8 | // of this software and associated documentation files (the "Software"), to deal 9 | // in the Software without restriction, including without limitation the rights 10 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 11 | // copies of the Software, and to permit persons to whom the Software is 12 | // furnished to do so, subject to the following conditions: 13 | // 14 | // The above copyright notice and this permission notice shall be included in all 15 | // copies or substantial portions of the Software. 16 | // 17 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 18 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 19 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 20 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 21 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 22 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 23 | // SOFTWARE. 24 | 25 | #import 26 | 27 | //! Project version number for RandomColor. 28 | FOUNDATION_EXPORT double RandomColorVersionNumber; 29 | 30 | //! Project version string for RandomColor. 31 | FOUNDATION_EXPORT const unsigned char RandomColorVersionString[]; 32 | 33 | // In this header, you should import all the public headers of your framework using statements like #import 34 | 35 | 36 | -------------------------------------------------------------------------------- /RandomColor/RandomColor.swift: -------------------------------------------------------------------------------- 1 | // 2 | // RandomColor.swift 3 | // RandomColorSwift 4 | // 5 | // Copyright (c) 2020 Wei Wang (http://onevcat.com) 6 | // 7 | // Permission is hereby granted, free of charge, to any person obtaining a copy 8 | // of this software and associated documentation files (the "Software"), to deal 9 | // in the Software without restriction, including without limitation the rights 10 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 11 | // copies of the Software, and to permit persons to whom the Software is 12 | // furnished to do so, subject to the following conditions: 13 | // 14 | // The above copyright notice and this permission notice shall be included in all 15 | // copies or substantial portions of the Software. 16 | // 17 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 18 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 19 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 20 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 21 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 22 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 23 | // SOFTWARE. 24 | 25 | #if canImport(UIKit) 26 | import UIKit 27 | public typealias Color = UIColor 28 | #else 29 | import Cocoa 30 | public typealias Color = NSColor 31 | #endif 32 | 33 | private var colorDictionary: [Hue: ColorDefinition] = [ 34 | .monochrome: ColorDefinition(hueRange: nil, lowerBounds: [(0,0), (100,0)]), 35 | .red: ColorDefinition(hueRange: (-26,18), lowerBounds: [(20,100), (30,92), (40,89), (50,85), (60,78), (70,70), (80,60), (90,55), (100,50)]), 36 | .orange: ColorDefinition(hueRange: (19,46), lowerBounds: [(20,100), (30,93), (40,88), (50,86), (60,85), (70,70), (100,70)]), 37 | .yellow: ColorDefinition(hueRange: (47,62), lowerBounds: [(25,100), (40,94), (50,89), (60,86), (70,84), (80,82), (90,80), (100,75)]), 38 | .green: ColorDefinition(hueRange: (63,178), lowerBounds: [(30,100), (40,90), (50,85), (60,81), (70,74), (80,64), (90,50), (100,40)]), 39 | .blue: ColorDefinition(hueRange: (179,257), lowerBounds: [(20,100), (30,86), (40,80), (50,74), (60,60), (70,52), (80,44), (90,39), (100,35)]), 40 | .purple: ColorDefinition(hueRange: (258, 282), lowerBounds: [(20,100), (30,87), (40,79), (50,70), (60,65), (70,59), (80,52), (90,45), (100,42)]), 41 | .pink: ColorDefinition(hueRange: (283, 334), lowerBounds: [(20,100), (30,90), (40,86), (60,84), (80,80), (90,75), (100,73)]) 42 | ] 43 | 44 | extension Hue { 45 | var range: Range { 46 | switch self { 47 | case .value(let value): return (value, value) 48 | case .random: return (0, 360) 49 | default: 50 | if let colorDefinition = colorDictionary[self] { 51 | return colorDefinition.hueRange ?? (0, 360) 52 | } else { 53 | assert(false, "Unrecgonized Hue enum: \(self).") 54 | return (0, 360) 55 | } 56 | } 57 | } 58 | } 59 | 60 | /** 61 | Generate a single random color with some conditions. 62 | 63 | - parameter hue: Hue of target color. It will be the main property of the generated color. Default is .Random. 64 | - parameter luminosity: Luminosity of target color. It will decide the brightness of generated color. Default is .Random. 65 | 66 | - returns: A random color following input conditions. It will be a `UIColor` object for iOS target, and an `NSColor` object for OSX target. 67 | */ 68 | public func randomColor(hue: Hue = .random, luminosity: Luminosity = .random) -> Color { 69 | 70 | func random(in range: Range) -> Int { 71 | assert(range.max >= range.min, "Max in range should be greater than min") 72 | return Int(arc4random_uniform(UInt32(range.max - range.min))) + range.min 73 | } 74 | 75 | func getColorDefinition(hueValue: Int) -> ColorDefinition { 76 | var hueValue = hueValue 77 | 78 | if hueValue >= 334 && hueValue <= 360 { 79 | hueValue -= 360 80 | } 81 | 82 | let color = colorDictionary.values.filter({ (definition: ColorDefinition) -> Bool in 83 | if let hueRange = definition.hueRange { 84 | return hueValue >= hueRange.min && hueValue <= hueRange.max 85 | } else { 86 | return false 87 | } 88 | }) 89 | 90 | assert(color.count == 1, "There should one and only one color satisfied the filter") 91 | return color.first! 92 | } 93 | 94 | func pickHue(_ hue: Hue) -> Int { 95 | var hueValue = random(in: hue.range) 96 | 97 | // Instead of storing red as two seperate ranges, 98 | // we group them, using negative numbers 99 | if hueValue < 0 { 100 | hueValue = hueValue + 360 101 | } 102 | return hueValue 103 | } 104 | 105 | func pickSaturation(color: ColorDefinition, hue: Hue, luminosity: Luminosity) -> Int { 106 | var color = color 107 | 108 | if luminosity == .random { 109 | return random(in: (0, 100)) 110 | } 111 | 112 | if hue == .monochrome { 113 | return 0 114 | } 115 | 116 | let saturationRange = color.saturationRange 117 | var sMin = saturationRange.min 118 | var sMax = saturationRange.max 119 | 120 | switch luminosity { 121 | case .bright: 122 | sMin = 55 123 | case .dark: 124 | sMin = sMax - 10 125 | case .light: 126 | sMax = 55 127 | default: () 128 | } 129 | 130 | return random(in: (sMin, sMax)) 131 | } 132 | 133 | func pickBrightness(color: ColorDefinition, saturationValue: Int, luminosity: Luminosity) -> Int { 134 | var color = color 135 | 136 | func getMinimumBrightness(saturationValue: Int) -> Int { 137 | let lowerBounds = color.lowerBounds; 138 | for i in 0 ..< lowerBounds.count - 1 { 139 | 140 | let s1 = Float(lowerBounds[i].0) 141 | let v1 = Float(lowerBounds[i].1) 142 | 143 | let s2 = Float(lowerBounds[i+1].0) 144 | let v2 = Float(lowerBounds[i+1].1) 145 | 146 | if Float(saturationValue) >= s1 && Float(saturationValue) <= s2 { 147 | let m = (v2 - v1) / (s2 - s1) 148 | let b = v1 - m * s1 149 | return lroundf(m * Float(saturationValue) + b) 150 | } 151 | } 152 | return 0 153 | } 154 | 155 | var bMin = getMinimumBrightness(saturationValue: saturationValue) 156 | var bMax = 100 157 | 158 | switch luminosity { 159 | case .dark: 160 | bMax = bMin + 20 161 | case .light: 162 | bMin = (bMax + bMin) / 2 163 | case .random: 164 | bMin = 0 165 | bMax = 100 166 | default: () 167 | } 168 | 169 | return random(in: (bMin, bMax)) 170 | } 171 | 172 | 173 | let hueValue = pickHue(hue) 174 | 175 | let color = getColorDefinition(hueValue: hueValue) 176 | 177 | let saturationValue = pickSaturation(color: color, hue: hue, luminosity: luminosity) 178 | let brightnessValue = pickBrightness(color: color, saturationValue: saturationValue, luminosity: luminosity) 179 | 180 | #if canImport(UIKit) 181 | return Color(hue: CGFloat(hueValue) / 360.0, 182 | saturation: CGFloat(saturationValue) / 100.0, 183 | brightness: CGFloat(brightnessValue) / 100.0, 184 | alpha: 1.0) 185 | #else 186 | return Color(deviceHue: CGFloat(hueValue) / 360.0, 187 | saturation: CGFloat(saturationValue) / 100.0, 188 | brightness: CGFloat(brightnessValue) / 100.0, 189 | alpha: 1.0) 190 | #endif 191 | } 192 | 193 | /** 194 | Generate a set of random colors with some conditions. 195 | 196 | - parameter count: The count of how many colors will be generated. 197 | - parameter hue: Hue of target color. It will be the main property of the generated color. Default is .Random. 198 | - parameter luminosity: Luminosity of target color. It will decide the brightness of generated color. Default is .Random. 199 | 200 | - returns: An array of random colors following input conditions. The elements will be `UIColor` objects for iOS target, and `NSColor` objects for OSX target. 201 | */ 202 | public func randomColors(count: Int, hue: Hue = .random, luminosity: Luminosity = .random) -> [Color] { 203 | var colors: [Color] = [] 204 | while (colors.count < count) { 205 | colors.append(randomColor(hue: hue, luminosity: luminosity)) 206 | } 207 | return colors 208 | } 209 | 210 | -------------------------------------------------------------------------------- /RandomColorSwift.podspec: -------------------------------------------------------------------------------- 1 | Pod::Spec.new do |s| 2 | 3 | s.name = "RandomColorSwift" 4 | s.version = "2.0.0" 5 | s.summary = "An attractive color generator for Swift. Ported from randomColor.js." 6 | 7 | s.description = <<-DESC 8 | A tiny library for generating attractive random colors. 9 | 10 | It produces bright colors with a reasonably high saturation. 11 | This makes randomColor particularly useful for data visualizations and generative art. 12 | DESC 13 | 14 | s.homepage = "https://github.com/onevcat/RandomColorSwift" 15 | 16 | s.license = { :type => "MIT", :file => "LICENSE" } 17 | 18 | s.authors = { "onevcat" => "onevcat@gmail.com" } 19 | s.social_media_url = "http://twitter.com/onevcat" 20 | 21 | s.ios.deployment_target = "8.0" 22 | s.osx.deployment_target = "10.10" 23 | 24 | s.source = { :git => "https://github.com/onevcat/RandomColorSwift.git", :tag => s.version } 25 | 26 | s.source_files = "RandomColor/*.swift" 27 | s.requires_arc = true 28 | s.swift_versions = ['4.0', '4.2', '5.0'] 29 | 30 | end 31 | -------------------------------------------------------------------------------- /RandomColorSwift.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 46; 7 | objects = { 8 | 9 | /* Begin PBXBuildFile section */ 10 | 4B1F67EC1A70F398007A07DD /* RandomColorSwiftTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4B1F67EB1A70F398007A07DD /* RandomColorSwiftTests.swift */; }; 11 | 4B1F68011A70F3D2007A07DD /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4B1F67F91A70F3D2007A07DD /* AppDelegate.swift */; }; 12 | 4B1F68041A70F3D2007A07DD /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 4B1F67FE1A70F3D2007A07DD /* Images.xcassets */; }; 13 | 4B1F68061A70F3D2007A07DD /* ViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4B1F68001A70F3D2007A07DD /* ViewController.swift */; }; 14 | 4B1F68071A70F46C007A07DD /* LaunchScreen.xib in Resources */ = {isa = PBXBuildFile; fileRef = 4B1F67FA1A70F3D2007A07DD /* LaunchScreen.xib */; }; 15 | 4B1F68081A70F46C007A07DD /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 4B1F67FC1A70F3D2007A07DD /* Main.storyboard */; }; 16 | 4B1F68131A70F4BF007A07DD /* RandomColor.h in Headers */ = {isa = PBXBuildFile; fileRef = 4B1F68121A70F4BF007A07DD /* RandomColor.h */; settings = {ATTRIBUTES = (Public, ); }; }; 17 | 4B1F68191A70F4BF007A07DD /* RandomColor.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 4B1F680E1A70F4BF007A07DD /* RandomColor.framework */; }; 18 | 4B1F68221A70F4C0007A07DD /* RandomColorTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4B1F68211A70F4C0007A07DD /* RandomColorTests.swift */; }; 19 | 4B1F68251A70F4C0007A07DD /* RandomColor.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 4B1F680E1A70F4BF007A07DD /* RandomColor.framework */; }; 20 | 4B1F68261A70F4C0007A07DD /* RandomColor.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 4B1F680E1A70F4BF007A07DD /* RandomColor.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; }; 21 | 4B1F682F1A70F4F4007A07DD /* RandomColor.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4B1F682E1A70F4F4007A07DD /* RandomColor.swift */; }; 22 | 4B1F68311A710067007A07DD /* Hue.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4B1F68301A710067007A07DD /* Hue.swift */; }; 23 | 4B1F68331A7100A0007A07DD /* Luminosity.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4B1F68321A7100A0007A07DD /* Luminosity.swift */; }; 24 | 4B1F68351A71013B007A07DD /* ColorDefinition.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4B1F68341A71013B007A07DD /* ColorDefinition.swift */; }; 25 | 4BA3C5D61A72081100CC3CBA /* HueExtension.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4BA3C5D51A72081100CC3CBA /* HueExtension.swift */; }; 26 | 4BC981EE1A72199600D35704 /* DetailViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4BC981ED1A72199600D35704 /* DetailViewController.swift */; }; 27 | 4BC981F91A72244400D35704 /* NameOfColor.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4BC981F81A72244400D35704 /* NameOfColor.swift */; }; 28 | 4BD46D0A1A71FA5B00469BDD /* SettingViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4BD46D091A71FA5B00469BDD /* SettingViewController.swift */; }; 29 | 4BF134FD1A72427200915038 /* ntc.js in Resources */ = {isa = PBXBuildFile; fileRef = 4BF134FC1A72427200915038 /* ntc.js */; }; 30 | /* End PBXBuildFile section */ 31 | 32 | /* Begin PBXContainerItemProxy section */ 33 | 4B1F67E61A70F398007A07DD /* PBXContainerItemProxy */ = { 34 | isa = PBXContainerItemProxy; 35 | containerPortal = 4B1F67C81A70F397007A07DD /* Project object */; 36 | proxyType = 1; 37 | remoteGlobalIDString = 4B1F67CF1A70F397007A07DD; 38 | remoteInfo = RandomColorSwift; 39 | }; 40 | 4B1F681A1A70F4BF007A07DD /* PBXContainerItemProxy */ = { 41 | isa = PBXContainerItemProxy; 42 | containerPortal = 4B1F67C81A70F397007A07DD /* Project object */; 43 | proxyType = 1; 44 | remoteGlobalIDString = 4B1F680D1A70F4BF007A07DD; 45 | remoteInfo = RandomColor; 46 | }; 47 | 4B1F681C1A70F4C0007A07DD /* PBXContainerItemProxy */ = { 48 | isa = PBXContainerItemProxy; 49 | containerPortal = 4B1F67C81A70F397007A07DD /* Project object */; 50 | proxyType = 1; 51 | remoteGlobalIDString = 4B1F67CF1A70F397007A07DD; 52 | remoteInfo = RandomColorSwiftDemo; 53 | }; 54 | 4B1F68231A70F4C0007A07DD /* PBXContainerItemProxy */ = { 55 | isa = PBXContainerItemProxy; 56 | containerPortal = 4B1F67C81A70F397007A07DD /* Project object */; 57 | proxyType = 1; 58 | remoteGlobalIDString = 4B1F680D1A70F4BF007A07DD; 59 | remoteInfo = RandomColor; 60 | }; 61 | /* End PBXContainerItemProxy section */ 62 | 63 | /* Begin PBXCopyFilesBuildPhase section */ 64 | 4B1F682C1A70F4C0007A07DD /* Embed Frameworks */ = { 65 | isa = PBXCopyFilesBuildPhase; 66 | buildActionMask = 2147483647; 67 | dstPath = ""; 68 | dstSubfolderSpec = 10; 69 | files = ( 70 | 4B1F68261A70F4C0007A07DD /* RandomColor.framework in Embed Frameworks */, 71 | ); 72 | name = "Embed Frameworks"; 73 | runOnlyForDeploymentPostprocessing = 0; 74 | }; 75 | /* End PBXCopyFilesBuildPhase section */ 76 | 77 | /* Begin PBXFileReference section */ 78 | 4B1F67D01A70F398007A07DD /* RandomColorSwiftDemo.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = RandomColorSwiftDemo.app; sourceTree = BUILT_PRODUCTS_DIR; }; 79 | 4B1F67E51A70F398007A07DD /* RandomColorSwiftDemoTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = RandomColorSwiftDemoTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; 80 | 4B1F67EA1A70F398007A07DD /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 81 | 4B1F67EB1A70F398007A07DD /* RandomColorSwiftTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = RandomColorSwiftTests.swift; sourceTree = ""; }; 82 | 4B1F67F91A70F3D2007A07DD /* AppDelegate.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; 83 | 4B1F67FB1A70F3D2007A07DD /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = Base; path = Base.lproj/LaunchScreen.xib; sourceTree = ""; }; 84 | 4B1F67FD1A70F3D2007A07DD /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; 85 | 4B1F67FE1A70F3D2007A07DD /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Images.xcassets; sourceTree = ""; }; 86 | 4B1F67FF1A70F3D2007A07DD /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 87 | 4B1F68001A70F3D2007A07DD /* ViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ViewController.swift; sourceTree = ""; }; 88 | 4B1F680E1A70F4BF007A07DD /* RandomColor.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = RandomColor.framework; sourceTree = BUILT_PRODUCTS_DIR; }; 89 | 4B1F68111A70F4BF007A07DD /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 90 | 4B1F68121A70F4BF007A07DD /* RandomColor.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = RandomColor.h; sourceTree = ""; }; 91 | 4B1F68181A70F4BF007A07DD /* RandomColorTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = RandomColorTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; 92 | 4B1F68201A70F4C0007A07DD /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 93 | 4B1F68211A70F4C0007A07DD /* RandomColorTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = RandomColorTests.swift; sourceTree = ""; }; 94 | 4B1F682E1A70F4F4007A07DD /* RandomColor.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = RandomColor.swift; sourceTree = ""; }; 95 | 4B1F68301A710067007A07DD /* Hue.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Hue.swift; sourceTree = ""; }; 96 | 4B1F68321A7100A0007A07DD /* Luminosity.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Luminosity.swift; sourceTree = ""; }; 97 | 4B1F68341A71013B007A07DD /* ColorDefinition.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ColorDefinition.swift; sourceTree = ""; }; 98 | 4BA3C5D51A72081100CC3CBA /* HueExtension.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = HueExtension.swift; sourceTree = ""; }; 99 | 4BC981ED1A72199600D35704 /* DetailViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = DetailViewController.swift; sourceTree = ""; }; 100 | 4BC981F81A72244400D35704 /* NameOfColor.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = NameOfColor.swift; sourceTree = ""; }; 101 | 4BD46D091A71FA5B00469BDD /* SettingViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = SettingViewController.swift; sourceTree = ""; }; 102 | 4BF134FC1A72427200915038 /* ntc.js */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.javascript; path = ntc.js; sourceTree = ""; }; 103 | /* End PBXFileReference section */ 104 | 105 | /* Begin PBXFrameworksBuildPhase section */ 106 | 4B1F67CD1A70F397007A07DD /* Frameworks */ = { 107 | isa = PBXFrameworksBuildPhase; 108 | buildActionMask = 2147483647; 109 | files = ( 110 | 4B1F68251A70F4C0007A07DD /* RandomColor.framework in Frameworks */, 111 | ); 112 | runOnlyForDeploymentPostprocessing = 0; 113 | }; 114 | 4B1F67E21A70F398007A07DD /* Frameworks */ = { 115 | isa = PBXFrameworksBuildPhase; 116 | buildActionMask = 2147483647; 117 | files = ( 118 | ); 119 | runOnlyForDeploymentPostprocessing = 0; 120 | }; 121 | 4B1F680A1A70F4BF007A07DD /* Frameworks */ = { 122 | isa = PBXFrameworksBuildPhase; 123 | buildActionMask = 2147483647; 124 | files = ( 125 | ); 126 | runOnlyForDeploymentPostprocessing = 0; 127 | }; 128 | 4B1F68151A70F4BF007A07DD /* Frameworks */ = { 129 | isa = PBXFrameworksBuildPhase; 130 | buildActionMask = 2147483647; 131 | files = ( 132 | 4B1F68191A70F4BF007A07DD /* RandomColor.framework in Frameworks */, 133 | ); 134 | runOnlyForDeploymentPostprocessing = 0; 135 | }; 136 | /* End PBXFrameworksBuildPhase section */ 137 | 138 | /* Begin PBXGroup section */ 139 | 4B1F67C71A70F397007A07DD = { 140 | isa = PBXGroup; 141 | children = ( 142 | 4B1F67F81A70F3D2007A07DD /* Demo */, 143 | 4B1F67E81A70F398007A07DD /* RandomColorSwiftTests */, 144 | 4B1F680F1A70F4BF007A07DD /* RandomColor */, 145 | 4B1F681E1A70F4C0007A07DD /* RandomColorTests */, 146 | 4B1F67D11A70F398007A07DD /* Products */, 147 | ); 148 | sourceTree = ""; 149 | }; 150 | 4B1F67D11A70F398007A07DD /* Products */ = { 151 | isa = PBXGroup; 152 | children = ( 153 | 4B1F67D01A70F398007A07DD /* RandomColorSwiftDemo.app */, 154 | 4B1F67E51A70F398007A07DD /* RandomColorSwiftDemoTests.xctest */, 155 | 4B1F680E1A70F4BF007A07DD /* RandomColor.framework */, 156 | 4B1F68181A70F4BF007A07DD /* RandomColorTests.xctest */, 157 | ); 158 | name = Products; 159 | sourceTree = ""; 160 | }; 161 | 4B1F67E81A70F398007A07DD /* RandomColorSwiftTests */ = { 162 | isa = PBXGroup; 163 | children = ( 164 | 4B1F67EB1A70F398007A07DD /* RandomColorSwiftTests.swift */, 165 | 4B1F67E91A70F398007A07DD /* Supporting Files */, 166 | ); 167 | path = RandomColorSwiftTests; 168 | sourceTree = ""; 169 | }; 170 | 4B1F67E91A70F398007A07DD /* Supporting Files */ = { 171 | isa = PBXGroup; 172 | children = ( 173 | 4B1F67EA1A70F398007A07DD /* Info.plist */, 174 | ); 175 | name = "Supporting Files"; 176 | sourceTree = ""; 177 | }; 178 | 4B1F67F81A70F3D2007A07DD /* Demo */ = { 179 | isa = PBXGroup; 180 | children = ( 181 | 4BF134FB1A72427200915038 /* third-party */, 182 | 4BD46D091A71FA5B00469BDD /* SettingViewController.swift */, 183 | 4BC981ED1A72199600D35704 /* DetailViewController.swift */, 184 | 4B1F67F91A70F3D2007A07DD /* AppDelegate.swift */, 185 | 4B1F67FA1A70F3D2007A07DD /* LaunchScreen.xib */, 186 | 4B1F67FC1A70F3D2007A07DD /* Main.storyboard */, 187 | 4BC981F81A72244400D35704 /* NameOfColor.swift */, 188 | 4B1F67FE1A70F3D2007A07DD /* Images.xcassets */, 189 | 4B1F67FF1A70F3D2007A07DD /* Info.plist */, 190 | 4B1F68001A70F3D2007A07DD /* ViewController.swift */, 191 | 4BA3C5D51A72081100CC3CBA /* HueExtension.swift */, 192 | ); 193 | path = Demo; 194 | sourceTree = ""; 195 | }; 196 | 4B1F680F1A70F4BF007A07DD /* RandomColor */ = { 197 | isa = PBXGroup; 198 | children = ( 199 | 4B1F68121A70F4BF007A07DD /* RandomColor.h */, 200 | 4B1F68101A70F4BF007A07DD /* Supporting Files */, 201 | 4B1F682E1A70F4F4007A07DD /* RandomColor.swift */, 202 | 4B1F68341A71013B007A07DD /* ColorDefinition.swift */, 203 | 4B1F68321A7100A0007A07DD /* Luminosity.swift */, 204 | 4B1F68301A710067007A07DD /* Hue.swift */, 205 | ); 206 | path = RandomColor; 207 | sourceTree = ""; 208 | }; 209 | 4B1F68101A70F4BF007A07DD /* Supporting Files */ = { 210 | isa = PBXGroup; 211 | children = ( 212 | 4B1F68111A70F4BF007A07DD /* Info.plist */, 213 | ); 214 | name = "Supporting Files"; 215 | sourceTree = ""; 216 | }; 217 | 4B1F681E1A70F4C0007A07DD /* RandomColorTests */ = { 218 | isa = PBXGroup; 219 | children = ( 220 | 4B1F68211A70F4C0007A07DD /* RandomColorTests.swift */, 221 | 4B1F681F1A70F4C0007A07DD /* Supporting Files */, 222 | ); 223 | path = RandomColorTests; 224 | sourceTree = ""; 225 | }; 226 | 4B1F681F1A70F4C0007A07DD /* Supporting Files */ = { 227 | isa = PBXGroup; 228 | children = ( 229 | 4B1F68201A70F4C0007A07DD /* Info.plist */, 230 | ); 231 | name = "Supporting Files"; 232 | sourceTree = ""; 233 | }; 234 | 4BF134FB1A72427200915038 /* third-party */ = { 235 | isa = PBXGroup; 236 | children = ( 237 | 4BF134FC1A72427200915038 /* ntc.js */, 238 | ); 239 | path = "third-party"; 240 | sourceTree = ""; 241 | }; 242 | /* End PBXGroup section */ 243 | 244 | /* Begin PBXHeadersBuildPhase section */ 245 | 4B1F680B1A70F4BF007A07DD /* Headers */ = { 246 | isa = PBXHeadersBuildPhase; 247 | buildActionMask = 2147483647; 248 | files = ( 249 | 4B1F68131A70F4BF007A07DD /* RandomColor.h in Headers */, 250 | ); 251 | runOnlyForDeploymentPostprocessing = 0; 252 | }; 253 | /* End PBXHeadersBuildPhase section */ 254 | 255 | /* Begin PBXNativeTarget section */ 256 | 4B1F67CF1A70F397007A07DD /* RandomColorSwiftDemo */ = { 257 | isa = PBXNativeTarget; 258 | buildConfigurationList = 4B1F67EF1A70F398007A07DD /* Build configuration list for PBXNativeTarget "RandomColorSwiftDemo" */; 259 | buildPhases = ( 260 | 4B1F67CC1A70F397007A07DD /* Sources */, 261 | 4B1F67CD1A70F397007A07DD /* Frameworks */, 262 | 4B1F67CE1A70F397007A07DD /* Resources */, 263 | 4B1F682C1A70F4C0007A07DD /* Embed Frameworks */, 264 | ); 265 | buildRules = ( 266 | ); 267 | dependencies = ( 268 | 4B1F68241A70F4C0007A07DD /* PBXTargetDependency */, 269 | ); 270 | name = RandomColorSwiftDemo; 271 | productName = RandomColorSwift; 272 | productReference = 4B1F67D01A70F398007A07DD /* RandomColorSwiftDemo.app */; 273 | productType = "com.apple.product-type.application"; 274 | }; 275 | 4B1F67E41A70F398007A07DD /* RandomColorSwiftDemoTests */ = { 276 | isa = PBXNativeTarget; 277 | buildConfigurationList = 4B1F67F21A70F398007A07DD /* Build configuration list for PBXNativeTarget "RandomColorSwiftDemoTests" */; 278 | buildPhases = ( 279 | 4B1F67E11A70F398007A07DD /* Sources */, 280 | 4B1F67E21A70F398007A07DD /* Frameworks */, 281 | 4B1F67E31A70F398007A07DD /* Resources */, 282 | ); 283 | buildRules = ( 284 | ); 285 | dependencies = ( 286 | 4B1F67E71A70F398007A07DD /* PBXTargetDependency */, 287 | ); 288 | name = RandomColorSwiftDemoTests; 289 | productName = RandomColorSwiftTests; 290 | productReference = 4B1F67E51A70F398007A07DD /* RandomColorSwiftDemoTests.xctest */; 291 | productType = "com.apple.product-type.bundle.unit-test"; 292 | }; 293 | 4B1F680D1A70F4BF007A07DD /* RandomColor */ = { 294 | isa = PBXNativeTarget; 295 | buildConfigurationList = 4B1F682B1A70F4C0007A07DD /* Build configuration list for PBXNativeTarget "RandomColor" */; 296 | buildPhases = ( 297 | 4B1F68091A70F4BF007A07DD /* Sources */, 298 | 4B1F680A1A70F4BF007A07DD /* Frameworks */, 299 | 4B1F680B1A70F4BF007A07DD /* Headers */, 300 | 4B1F680C1A70F4BF007A07DD /* Resources */, 301 | ); 302 | buildRules = ( 303 | ); 304 | dependencies = ( 305 | ); 306 | name = RandomColor; 307 | productName = RandomColor; 308 | productReference = 4B1F680E1A70F4BF007A07DD /* RandomColor.framework */; 309 | productType = "com.apple.product-type.framework"; 310 | }; 311 | 4B1F68171A70F4BF007A07DD /* RandomColorTests */ = { 312 | isa = PBXNativeTarget; 313 | buildConfigurationList = 4B1F682D1A70F4C0007A07DD /* Build configuration list for PBXNativeTarget "RandomColorTests" */; 314 | buildPhases = ( 315 | 4B1F68141A70F4BF007A07DD /* Sources */, 316 | 4B1F68151A70F4BF007A07DD /* Frameworks */, 317 | 4B1F68161A70F4BF007A07DD /* Resources */, 318 | ); 319 | buildRules = ( 320 | ); 321 | dependencies = ( 322 | 4B1F681B1A70F4BF007A07DD /* PBXTargetDependency */, 323 | 4B1F681D1A70F4C0007A07DD /* PBXTargetDependency */, 324 | ); 325 | name = RandomColorTests; 326 | productName = RandomColorTests; 327 | productReference = 4B1F68181A70F4BF007A07DD /* RandomColorTests.xctest */; 328 | productType = "com.apple.product-type.bundle.unit-test"; 329 | }; 330 | /* End PBXNativeTarget section */ 331 | 332 | /* Begin PBXProject section */ 333 | 4B1F67C81A70F397007A07DD /* Project object */ = { 334 | isa = PBXProject; 335 | attributes = { 336 | LastSwiftUpdateCheck = 0700; 337 | LastUpgradeCheck = 1030; 338 | ORGANIZATIONNAME = "OneV's Den"; 339 | TargetAttributes = { 340 | 4B1F67CF1A70F397007A07DD = { 341 | CreatedOnToolsVersion = 6.1.1; 342 | LastSwiftMigration = 0800; 343 | }; 344 | 4B1F67E41A70F398007A07DD = { 345 | CreatedOnToolsVersion = 6.1.1; 346 | LastSwiftMigration = 0800; 347 | TestTargetID = 4B1F67CF1A70F397007A07DD; 348 | }; 349 | 4B1F680D1A70F4BF007A07DD = { 350 | CreatedOnToolsVersion = 6.1.1; 351 | LastSwiftMigration = 1020; 352 | }; 353 | 4B1F68171A70F4BF007A07DD = { 354 | CreatedOnToolsVersion = 6.1.1; 355 | LastSwiftMigration = 0800; 356 | TestTargetID = 4B1F67CF1A70F397007A07DD; 357 | }; 358 | }; 359 | }; 360 | buildConfigurationList = 4B1F67CB1A70F397007A07DD /* Build configuration list for PBXProject "RandomColorSwift" */; 361 | compatibilityVersion = "Xcode 3.2"; 362 | developmentRegion = en; 363 | hasScannedForEncodings = 0; 364 | knownRegions = ( 365 | en, 366 | Base, 367 | ); 368 | mainGroup = 4B1F67C71A70F397007A07DD; 369 | productRefGroup = 4B1F67D11A70F398007A07DD /* Products */; 370 | projectDirPath = ""; 371 | projectRoot = ""; 372 | targets = ( 373 | 4B1F67CF1A70F397007A07DD /* RandomColorSwiftDemo */, 374 | 4B1F67E41A70F398007A07DD /* RandomColorSwiftDemoTests */, 375 | 4B1F680D1A70F4BF007A07DD /* RandomColor */, 376 | 4B1F68171A70F4BF007A07DD /* RandomColorTests */, 377 | ); 378 | }; 379 | /* End PBXProject section */ 380 | 381 | /* Begin PBXResourcesBuildPhase section */ 382 | 4B1F67CE1A70F397007A07DD /* Resources */ = { 383 | isa = PBXResourcesBuildPhase; 384 | buildActionMask = 2147483647; 385 | files = ( 386 | 4B1F68071A70F46C007A07DD /* LaunchScreen.xib in Resources */, 387 | 4B1F68081A70F46C007A07DD /* Main.storyboard in Resources */, 388 | 4BF134FD1A72427200915038 /* ntc.js in Resources */, 389 | 4B1F68041A70F3D2007A07DD /* Images.xcassets in Resources */, 390 | ); 391 | runOnlyForDeploymentPostprocessing = 0; 392 | }; 393 | 4B1F67E31A70F398007A07DD /* Resources */ = { 394 | isa = PBXResourcesBuildPhase; 395 | buildActionMask = 2147483647; 396 | files = ( 397 | ); 398 | runOnlyForDeploymentPostprocessing = 0; 399 | }; 400 | 4B1F680C1A70F4BF007A07DD /* Resources */ = { 401 | isa = PBXResourcesBuildPhase; 402 | buildActionMask = 2147483647; 403 | files = ( 404 | ); 405 | runOnlyForDeploymentPostprocessing = 0; 406 | }; 407 | 4B1F68161A70F4BF007A07DD /* Resources */ = { 408 | isa = PBXResourcesBuildPhase; 409 | buildActionMask = 2147483647; 410 | files = ( 411 | ); 412 | runOnlyForDeploymentPostprocessing = 0; 413 | }; 414 | /* End PBXResourcesBuildPhase section */ 415 | 416 | /* Begin PBXSourcesBuildPhase section */ 417 | 4B1F67CC1A70F397007A07DD /* Sources */ = { 418 | isa = PBXSourcesBuildPhase; 419 | buildActionMask = 2147483647; 420 | files = ( 421 | 4BA3C5D61A72081100CC3CBA /* HueExtension.swift in Sources */, 422 | 4BC981F91A72244400D35704 /* NameOfColor.swift in Sources */, 423 | 4B1F68061A70F3D2007A07DD /* ViewController.swift in Sources */, 424 | 4BC981EE1A72199600D35704 /* DetailViewController.swift in Sources */, 425 | 4B1F68011A70F3D2007A07DD /* AppDelegate.swift in Sources */, 426 | 4BD46D0A1A71FA5B00469BDD /* SettingViewController.swift in Sources */, 427 | ); 428 | runOnlyForDeploymentPostprocessing = 0; 429 | }; 430 | 4B1F67E11A70F398007A07DD /* Sources */ = { 431 | isa = PBXSourcesBuildPhase; 432 | buildActionMask = 2147483647; 433 | files = ( 434 | 4B1F67EC1A70F398007A07DD /* RandomColorSwiftTests.swift in Sources */, 435 | ); 436 | runOnlyForDeploymentPostprocessing = 0; 437 | }; 438 | 4B1F68091A70F4BF007A07DD /* Sources */ = { 439 | isa = PBXSourcesBuildPhase; 440 | buildActionMask = 2147483647; 441 | files = ( 442 | 4B1F68351A71013B007A07DD /* ColorDefinition.swift in Sources */, 443 | 4B1F68331A7100A0007A07DD /* Luminosity.swift in Sources */, 444 | 4B1F68311A710067007A07DD /* Hue.swift in Sources */, 445 | 4B1F682F1A70F4F4007A07DD /* RandomColor.swift in Sources */, 446 | ); 447 | runOnlyForDeploymentPostprocessing = 0; 448 | }; 449 | 4B1F68141A70F4BF007A07DD /* Sources */ = { 450 | isa = PBXSourcesBuildPhase; 451 | buildActionMask = 2147483647; 452 | files = ( 453 | 4B1F68221A70F4C0007A07DD /* RandomColorTests.swift in Sources */, 454 | ); 455 | runOnlyForDeploymentPostprocessing = 0; 456 | }; 457 | /* End PBXSourcesBuildPhase section */ 458 | 459 | /* Begin PBXTargetDependency section */ 460 | 4B1F67E71A70F398007A07DD /* PBXTargetDependency */ = { 461 | isa = PBXTargetDependency; 462 | target = 4B1F67CF1A70F397007A07DD /* RandomColorSwiftDemo */; 463 | targetProxy = 4B1F67E61A70F398007A07DD /* PBXContainerItemProxy */; 464 | }; 465 | 4B1F681B1A70F4BF007A07DD /* PBXTargetDependency */ = { 466 | isa = PBXTargetDependency; 467 | target = 4B1F680D1A70F4BF007A07DD /* RandomColor */; 468 | targetProxy = 4B1F681A1A70F4BF007A07DD /* PBXContainerItemProxy */; 469 | }; 470 | 4B1F681D1A70F4C0007A07DD /* PBXTargetDependency */ = { 471 | isa = PBXTargetDependency; 472 | target = 4B1F67CF1A70F397007A07DD /* RandomColorSwiftDemo */; 473 | targetProxy = 4B1F681C1A70F4C0007A07DD /* PBXContainerItemProxy */; 474 | }; 475 | 4B1F68241A70F4C0007A07DD /* PBXTargetDependency */ = { 476 | isa = PBXTargetDependency; 477 | target = 4B1F680D1A70F4BF007A07DD /* RandomColor */; 478 | targetProxy = 4B1F68231A70F4C0007A07DD /* PBXContainerItemProxy */; 479 | }; 480 | /* End PBXTargetDependency section */ 481 | 482 | /* Begin PBXVariantGroup section */ 483 | 4B1F67FA1A70F3D2007A07DD /* LaunchScreen.xib */ = { 484 | isa = PBXVariantGroup; 485 | children = ( 486 | 4B1F67FB1A70F3D2007A07DD /* Base */, 487 | ); 488 | name = LaunchScreen.xib; 489 | sourceTree = ""; 490 | }; 491 | 4B1F67FC1A70F3D2007A07DD /* Main.storyboard */ = { 492 | isa = PBXVariantGroup; 493 | children = ( 494 | 4B1F67FD1A70F3D2007A07DD /* Base */, 495 | ); 496 | name = Main.storyboard; 497 | sourceTree = ""; 498 | }; 499 | /* End PBXVariantGroup section */ 500 | 501 | /* Begin XCBuildConfiguration section */ 502 | 4B1F67ED1A70F398007A07DD /* Debug */ = { 503 | isa = XCBuildConfiguration; 504 | buildSettings = { 505 | ALWAYS_SEARCH_USER_PATHS = NO; 506 | CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES; 507 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 508 | CLANG_CXX_LIBRARY = "libc++"; 509 | CLANG_ENABLE_MODULES = YES; 510 | CLANG_ENABLE_OBJC_ARC = YES; 511 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; 512 | CLANG_WARN_BOOL_CONVERSION = YES; 513 | CLANG_WARN_COMMA = YES; 514 | CLANG_WARN_CONSTANT_CONVERSION = YES; 515 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; 516 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 517 | CLANG_WARN_EMPTY_BODY = YES; 518 | CLANG_WARN_ENUM_CONVERSION = YES; 519 | CLANG_WARN_INFINITE_RECURSION = YES; 520 | CLANG_WARN_INT_CONVERSION = YES; 521 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; 522 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; 523 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; 524 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 525 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; 526 | CLANG_WARN_STRICT_PROTOTYPES = YES; 527 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 528 | CLANG_WARN_UNREACHABLE_CODE = YES; 529 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 530 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 531 | COPY_PHASE_STRIP = NO; 532 | ENABLE_STRICT_OBJC_MSGSEND = YES; 533 | ENABLE_TESTABILITY = YES; 534 | GCC_C_LANGUAGE_STANDARD = gnu99; 535 | GCC_DYNAMIC_NO_PIC = NO; 536 | GCC_NO_COMMON_BLOCKS = YES; 537 | GCC_OPTIMIZATION_LEVEL = 0; 538 | GCC_PREPROCESSOR_DEFINITIONS = ( 539 | "DEBUG=1", 540 | "$(inherited)", 541 | ); 542 | GCC_SYMBOLS_PRIVATE_EXTERN = NO; 543 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 544 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 545 | GCC_WARN_UNDECLARED_SELECTOR = YES; 546 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 547 | GCC_WARN_UNUSED_FUNCTION = YES; 548 | GCC_WARN_UNUSED_VARIABLE = YES; 549 | IPHONEOS_DEPLOYMENT_TARGET = 8.1; 550 | MTL_ENABLE_DEBUG_INFO = YES; 551 | ONLY_ACTIVE_ARCH = YES; 552 | SDKROOT = iphoneos; 553 | SWIFT_OPTIMIZATION_LEVEL = "-Onone"; 554 | SWIFT_VERSION = 5.0; 555 | TARGETED_DEVICE_FAMILY = "1,2"; 556 | }; 557 | name = Debug; 558 | }; 559 | 4B1F67EE1A70F398007A07DD /* Release */ = { 560 | isa = XCBuildConfiguration; 561 | buildSettings = { 562 | ALWAYS_SEARCH_USER_PATHS = NO; 563 | CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES; 564 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 565 | CLANG_CXX_LIBRARY = "libc++"; 566 | CLANG_ENABLE_MODULES = YES; 567 | CLANG_ENABLE_OBJC_ARC = YES; 568 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; 569 | CLANG_WARN_BOOL_CONVERSION = YES; 570 | CLANG_WARN_COMMA = YES; 571 | CLANG_WARN_CONSTANT_CONVERSION = YES; 572 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; 573 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 574 | CLANG_WARN_EMPTY_BODY = YES; 575 | CLANG_WARN_ENUM_CONVERSION = YES; 576 | CLANG_WARN_INFINITE_RECURSION = YES; 577 | CLANG_WARN_INT_CONVERSION = YES; 578 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; 579 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; 580 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; 581 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 582 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; 583 | CLANG_WARN_STRICT_PROTOTYPES = YES; 584 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 585 | CLANG_WARN_UNREACHABLE_CODE = YES; 586 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 587 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 588 | COPY_PHASE_STRIP = YES; 589 | ENABLE_NS_ASSERTIONS = NO; 590 | ENABLE_STRICT_OBJC_MSGSEND = YES; 591 | GCC_C_LANGUAGE_STANDARD = gnu99; 592 | GCC_NO_COMMON_BLOCKS = YES; 593 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 594 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 595 | GCC_WARN_UNDECLARED_SELECTOR = YES; 596 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 597 | GCC_WARN_UNUSED_FUNCTION = YES; 598 | GCC_WARN_UNUSED_VARIABLE = YES; 599 | IPHONEOS_DEPLOYMENT_TARGET = 8.1; 600 | MTL_ENABLE_DEBUG_INFO = NO; 601 | SDKROOT = iphoneos; 602 | SWIFT_VERSION = 5.0; 603 | TARGETED_DEVICE_FAMILY = "1,2"; 604 | VALIDATE_PRODUCT = YES; 605 | }; 606 | name = Release; 607 | }; 608 | 4B1F67F01A70F398007A07DD /* Debug */ = { 609 | isa = XCBuildConfiguration; 610 | buildSettings = { 611 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 612 | INFOPLIST_FILE = "$(SRCROOT)/Demo/Info.plist"; 613 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 614 | PRODUCT_BUNDLE_IDENTIFIER = "com.onevcat.$(PRODUCT_NAME:rfc1034identifier)"; 615 | PRODUCT_NAME = "$(TARGET_NAME)"; 616 | SWIFT_VERSION = 5.0; 617 | }; 618 | name = Debug; 619 | }; 620 | 4B1F67F11A70F398007A07DD /* Release */ = { 621 | isa = XCBuildConfiguration; 622 | buildSettings = { 623 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 624 | INFOPLIST_FILE = "$(SRCROOT)/Demo/Info.plist"; 625 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 626 | PRODUCT_BUNDLE_IDENTIFIER = "com.onevcat.$(PRODUCT_NAME:rfc1034identifier)"; 627 | PRODUCT_NAME = "$(TARGET_NAME)"; 628 | SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule"; 629 | SWIFT_VERSION = 5.0; 630 | }; 631 | name = Release; 632 | }; 633 | 4B1F67F31A70F398007A07DD /* Debug */ = { 634 | isa = XCBuildConfiguration; 635 | buildSettings = { 636 | BUNDLE_LOADER = "$(TEST_HOST)"; 637 | GCC_PREPROCESSOR_DEFINITIONS = ( 638 | "DEBUG=1", 639 | "$(inherited)", 640 | ); 641 | INFOPLIST_FILE = RandomColorSwiftTests/Info.plist; 642 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; 643 | PRODUCT_BUNDLE_IDENTIFIER = "com.onevcat.$(PRODUCT_NAME:rfc1034identifier)"; 644 | PRODUCT_NAME = "$(TARGET_NAME)"; 645 | SWIFT_VERSION = 5.0; 646 | TEST_HOST = "$(BUILT_PRODUCTS_DIR)/RandomColorSwiftDemo.app/RandomColorSwiftDemo"; 647 | }; 648 | name = Debug; 649 | }; 650 | 4B1F67F41A70F398007A07DD /* Release */ = { 651 | isa = XCBuildConfiguration; 652 | buildSettings = { 653 | BUNDLE_LOADER = "$(TEST_HOST)"; 654 | INFOPLIST_FILE = RandomColorSwiftTests/Info.plist; 655 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; 656 | PRODUCT_BUNDLE_IDENTIFIER = "com.onevcat.$(PRODUCT_NAME:rfc1034identifier)"; 657 | PRODUCT_NAME = "$(TARGET_NAME)"; 658 | SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule"; 659 | SWIFT_VERSION = 5.0; 660 | TEST_HOST = "$(BUILT_PRODUCTS_DIR)/RandomColorSwiftDemo.app/RandomColorSwiftDemo"; 661 | }; 662 | name = Release; 663 | }; 664 | 4B1F68271A70F4C0007A07DD /* Debug */ = { 665 | isa = XCBuildConfiguration; 666 | buildSettings = { 667 | CLANG_ENABLE_MODULES = YES; 668 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = ""; 669 | CURRENT_PROJECT_VERSION = 1; 670 | DEFINES_MODULE = YES; 671 | DYLIB_COMPATIBILITY_VERSION = 1; 672 | DYLIB_CURRENT_VERSION = 1; 673 | DYLIB_INSTALL_NAME_BASE = "@rpath"; 674 | GCC_PREPROCESSOR_DEFINITIONS = ( 675 | "DEBUG=1", 676 | "$(inherited)", 677 | ); 678 | INFOPLIST_FILE = RandomColor/Info.plist; 679 | INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; 680 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; 681 | PRODUCT_BUNDLE_IDENTIFIER = "com.onevcat.$(PRODUCT_NAME:rfc1034identifier)"; 682 | PRODUCT_NAME = "$(TARGET_NAME)"; 683 | SKIP_INSTALL = YES; 684 | SWIFT_OPTIMIZATION_LEVEL = "-Onone"; 685 | SWIFT_VERSION = 4.0; 686 | VERSIONING_SYSTEM = "apple-generic"; 687 | VERSION_INFO_PREFIX = ""; 688 | }; 689 | name = Debug; 690 | }; 691 | 4B1F68281A70F4C0007A07DD /* Release */ = { 692 | isa = XCBuildConfiguration; 693 | buildSettings = { 694 | CLANG_ENABLE_MODULES = YES; 695 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = ""; 696 | CURRENT_PROJECT_VERSION = 1; 697 | DEFINES_MODULE = YES; 698 | DYLIB_COMPATIBILITY_VERSION = 1; 699 | DYLIB_CURRENT_VERSION = 1; 700 | DYLIB_INSTALL_NAME_BASE = "@rpath"; 701 | INFOPLIST_FILE = RandomColor/Info.plist; 702 | INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; 703 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; 704 | PRODUCT_BUNDLE_IDENTIFIER = "com.onevcat.$(PRODUCT_NAME:rfc1034identifier)"; 705 | PRODUCT_NAME = "$(TARGET_NAME)"; 706 | SKIP_INSTALL = YES; 707 | SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule"; 708 | SWIFT_VERSION = 4.0; 709 | VERSIONING_SYSTEM = "apple-generic"; 710 | VERSION_INFO_PREFIX = ""; 711 | }; 712 | name = Release; 713 | }; 714 | 4B1F68291A70F4C0007A07DD /* Debug */ = { 715 | isa = XCBuildConfiguration; 716 | buildSettings = { 717 | GCC_PREPROCESSOR_DEFINITIONS = ( 718 | "DEBUG=1", 719 | "$(inherited)", 720 | ); 721 | INFOPLIST_FILE = RandomColorTests/Info.plist; 722 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; 723 | PRODUCT_BUNDLE_IDENTIFIER = "com.onevcat.$(PRODUCT_NAME:rfc1034identifier)"; 724 | PRODUCT_NAME = "$(TARGET_NAME)"; 725 | SWIFT_VERSION = 5.0; 726 | TEST_HOST = "$(BUILT_PRODUCTS_DIR)/RandomColorSwiftDemo.app/RandomColorSwiftDemo"; 727 | }; 728 | name = Debug; 729 | }; 730 | 4B1F682A1A70F4C0007A07DD /* Release */ = { 731 | isa = XCBuildConfiguration; 732 | buildSettings = { 733 | INFOPLIST_FILE = RandomColorTests/Info.plist; 734 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; 735 | PRODUCT_BUNDLE_IDENTIFIER = "com.onevcat.$(PRODUCT_NAME:rfc1034identifier)"; 736 | PRODUCT_NAME = "$(TARGET_NAME)"; 737 | SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule"; 738 | SWIFT_VERSION = 5.0; 739 | TEST_HOST = "$(BUILT_PRODUCTS_DIR)/RandomColorSwiftDemo.app/RandomColorSwiftDemo"; 740 | }; 741 | name = Release; 742 | }; 743 | /* End XCBuildConfiguration section */ 744 | 745 | /* Begin XCConfigurationList section */ 746 | 4B1F67CB1A70F397007A07DD /* Build configuration list for PBXProject "RandomColorSwift" */ = { 747 | isa = XCConfigurationList; 748 | buildConfigurations = ( 749 | 4B1F67ED1A70F398007A07DD /* Debug */, 750 | 4B1F67EE1A70F398007A07DD /* Release */, 751 | ); 752 | defaultConfigurationIsVisible = 0; 753 | defaultConfigurationName = Release; 754 | }; 755 | 4B1F67EF1A70F398007A07DD /* Build configuration list for PBXNativeTarget "RandomColorSwiftDemo" */ = { 756 | isa = XCConfigurationList; 757 | buildConfigurations = ( 758 | 4B1F67F01A70F398007A07DD /* Debug */, 759 | 4B1F67F11A70F398007A07DD /* Release */, 760 | ); 761 | defaultConfigurationIsVisible = 0; 762 | defaultConfigurationName = Release; 763 | }; 764 | 4B1F67F21A70F398007A07DD /* Build configuration list for PBXNativeTarget "RandomColorSwiftDemoTests" */ = { 765 | isa = XCConfigurationList; 766 | buildConfigurations = ( 767 | 4B1F67F31A70F398007A07DD /* Debug */, 768 | 4B1F67F41A70F398007A07DD /* Release */, 769 | ); 770 | defaultConfigurationIsVisible = 0; 771 | defaultConfigurationName = Release; 772 | }; 773 | 4B1F682B1A70F4C0007A07DD /* Build configuration list for PBXNativeTarget "RandomColor" */ = { 774 | isa = XCConfigurationList; 775 | buildConfigurations = ( 776 | 4B1F68271A70F4C0007A07DD /* Debug */, 777 | 4B1F68281A70F4C0007A07DD /* Release */, 778 | ); 779 | defaultConfigurationIsVisible = 0; 780 | defaultConfigurationName = Release; 781 | }; 782 | 4B1F682D1A70F4C0007A07DD /* Build configuration list for PBXNativeTarget "RandomColorTests" */ = { 783 | isa = XCConfigurationList; 784 | buildConfigurations = ( 785 | 4B1F68291A70F4C0007A07DD /* Debug */, 786 | 4B1F682A1A70F4C0007A07DD /* Release */, 787 | ); 788 | defaultConfigurationIsVisible = 0; 789 | defaultConfigurationName = Release; 790 | }; 791 | /* End XCConfigurationList section */ 792 | }; 793 | rootObject = 4B1F67C81A70F397007A07DD /* Project object */; 794 | } 795 | -------------------------------------------------------------------------------- /RandomColorSwift.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /RandomColorSwift.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDEDidComputeMac32BitWarning 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /RandomColorSwift.xcodeproj/project.xcworkspace/xcshareddata/RandomColorSwift.xcscmblueprint: -------------------------------------------------------------------------------- 1 | { 2 | "DVTSourceControlWorkspaceBlueprintPrimaryRemoteRepositoryKey" : "CB7125A4ADA41B167DDE5DB0E9C68C826064550E", 3 | "DVTSourceControlWorkspaceBlueprintWorkingCopyRepositoryLocationsKey" : { 4 | 5 | }, 6 | "DVTSourceControlWorkspaceBlueprintWorkingCopyStatesKey" : { 7 | "CB7125A4ADA41B167DDE5DB0E9C68C826064550E" : 0, 8 | "D68E8727ACCA31E3C05F0E30ECD84945E4806784" : 0 9 | }, 10 | "DVTSourceControlWorkspaceBlueprintIdentifierKey" : "4ADA76A9-15AE-4B18-835F-A7627A77B6A7", 11 | "DVTSourceControlWorkspaceBlueprintWorkingCopyPathsKey" : { 12 | "CB7125A4ADA41B167DDE5DB0E9C68C826064550E" : "RandomColorSwift\/", 13 | "D68E8727ACCA31E3C05F0E30ECD84945E4806784" : "Easy-Cal-Swift" 14 | }, 15 | "DVTSourceControlWorkspaceBlueprintNameKey" : "RandomColorSwift", 16 | "DVTSourceControlWorkspaceBlueprintVersion" : 204, 17 | "DVTSourceControlWorkspaceBlueprintRelativePathToProjectKey" : "RandomColorSwift.xcodeproj", 18 | "DVTSourceControlWorkspaceBlueprintRemoteRepositoriesKey" : [ 19 | { 20 | "DVTSourceControlWorkspaceBlueprintRemoteRepositoryURLKey" : "github.com:onevcat\/RandomColorSwift.git", 21 | "DVTSourceControlWorkspaceBlueprintRemoteRepositorySystemKey" : "com.apple.dt.Xcode.sourcecontrol.Git", 22 | "DVTSourceControlWorkspaceBlueprintRemoteRepositoryIdentifierKey" : "CB7125A4ADA41B167DDE5DB0E9C68C826064550E" 23 | }, 24 | { 25 | "DVTSourceControlWorkspaceBlueprintRemoteRepositoryURLKey" : "github.com:onevcat\/Easy-Cal-Swift.git", 26 | "DVTSourceControlWorkspaceBlueprintRemoteRepositorySystemKey" : "com.apple.dt.Xcode.sourcecontrol.Git", 27 | "DVTSourceControlWorkspaceBlueprintRemoteRepositoryIdentifierKey" : "D68E8727ACCA31E3C05F0E30ECD84945E4806784" 28 | } 29 | ] 30 | } -------------------------------------------------------------------------------- /RandomColorSwift.xcodeproj/xcshareddata/xcschemes/RandomColor.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 24 | 25 | 30 | 31 | 32 | 33 | 34 | 35 | 45 | 46 | 52 | 53 | 54 | 55 | 56 | 57 | 63 | 64 | 70 | 71 | 72 | 73 | 75 | 76 | 79 | 80 | 81 | -------------------------------------------------------------------------------- /RandomColorSwiftTests/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 | -------------------------------------------------------------------------------- /RandomColorSwiftTests/RandomColorSwiftTests.swift: -------------------------------------------------------------------------------- 1 | // 2 | // RandomColorSwiftTests.swift 3 | // RandomColorSwiftTests 4 | // 5 | // Created by WANG WEI on 2015/01/22. 6 | // Copyright (c) 2020年 OneV's Den. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | import XCTest 11 | 12 | class RandomColorSwiftTests: XCTestCase { 13 | 14 | override func setUp() { 15 | super.setUp() 16 | // Put setup code here. This method is called before the invocation of each test method in the class. 17 | } 18 | 19 | override func tearDown() { 20 | // Put teardown code here. This method is called after the invocation of each test method in the class. 21 | super.tearDown() 22 | } 23 | 24 | func testExample() { 25 | // This is an example of a functional test case. 26 | XCTAssert(true, "Pass") 27 | } 28 | 29 | func testPerformanceExample() { 30 | // This is an example of a performance test case. 31 | self.measure() { 32 | // Put the code you want to measure the time of here. 33 | } 34 | } 35 | 36 | } 37 | -------------------------------------------------------------------------------- /RandomColorTests/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 | -------------------------------------------------------------------------------- /RandomColorTests/RandomColorTests.swift: -------------------------------------------------------------------------------- 1 | // 2 | // RandomColorTests.swift 3 | // RandomColorTests 4 | // 5 | // Created by WANG WEI on 2015/01/22. 6 | // Copyright (c) 2020年 OneV's Den. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | import XCTest 11 | 12 | class RandomColorTests: XCTestCase { 13 | 14 | override func setUp() { 15 | super.setUp() 16 | // Put setup code here. This method is called before the invocation of each test method in the class. 17 | } 18 | 19 | override func tearDown() { 20 | // Put teardown code here. This method is called after the invocation of each test method in the class. 21 | super.tearDown() 22 | } 23 | 24 | func testExample() { 25 | // This is an example of a functional test case. 26 | XCTAssert(true, "Pass") 27 | } 28 | 29 | func testPerformanceExample() { 30 | // This is an example of a performance test case. 31 | self.measure() { 32 | // Put the code you want to measure the time of here. 33 | } 34 | } 35 | 36 | } 37 | -------------------------------------------------------------------------------- /demo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/onevcat/RandomColorSwift/ab01c6eff99f40c5e23ffcb957eb3971f937f106/demo.png --------------------------------------------------------------------------------