├── .gitignore ├── .swiftlint.yml ├── Design ├── Assets.sketch ├── Example.gif ├── Logo@2x.png └── Title@2x.png ├── LICENSE ├── MaterialDesignColorPicker.xcodeproj ├── project.pbxproj ├── project.xcworkspace │ └── contents.xcworkspacedata └── xcshareddata │ └── xcschemes │ └── MaterialDesignColorPicker.xcscheme ├── MaterialDesignColorPicker.xcworkspace └── contents.xcworkspacedata ├── MaterialDesignColorPicker ├── Assets.xcassets │ ├── ButtonImage.imageset │ │ ├── ButtonImage.png │ │ ├── ButtonImage@2x.png │ │ ├── ButtonImage@3x.png │ │ └── Contents.json │ └── Contents.json ├── Fonts │ ├── Roboto-Black.ttf │ ├── Roboto-BlackItalic.ttf │ ├── Roboto-Bold.ttf │ ├── Roboto-BoldItalic.ttf │ ├── Roboto-Italic.ttf │ ├── Roboto-Light.ttf │ ├── Roboto-LightItalic.ttf │ ├── Roboto-Medium.ttf │ ├── Roboto-MediumItalic.ttf │ ├── Roboto-Regular.ttf │ ├── Roboto-Thin.ttf │ └── Roboto-ThinItalic.ttf ├── Info.plist ├── MaterialDesignColorPalette.swift ├── MaterialDesignColorPaletteView.swift ├── MaterialDesignColorPicker.swift ├── MaterialDesignColorPicker.xib ├── MaterialDesignColorSwatchCollectionViewHeaderView.swift ├── MaterialDesignColorSwatchCollectionViewHeaderView.xib ├── MaterialDesignColorSwatchCollectionViewItem.swift ├── MaterialDesignColorSwatchCollectionViewItem.xib ├── MaterialDesignEasingCurves.swift ├── NSBezierPath+cgPath.swift ├── NSColor+hex.swift ├── NSView+ripple.swift └── RippleView.swift ├── MaterialDesignColorPickerFramework ├── Info.plist └── MaterialDesignColorPickerFramework.h ├── Playground.playground ├── Contents.swift └── contents.xcplayground └── README.md /.gitignore: -------------------------------------------------------------------------------- 1 | ## Build generated 2 | build/ 3 | DerivedData 4 | 5 | ## Various settings 6 | *.pbxuser 7 | !default.pbxuser 8 | *.mode1v3 9 | !default.mode1v3 10 | *.mode2v3 11 | !default.mode2v3 12 | *.perspectivev3 13 | !default.perspectivev3 14 | xcuserdata/ 15 | 16 | ## Other 17 | *.xccheckout 18 | *.moved-aside 19 | *.xcuserstate 20 | *.xcscmblueprint 21 | 22 | ## Obj-C/Swift specific 23 | *.hmap 24 | *.ipa 25 | 26 | ## Playgrounds 27 | timeline.xctimeline 28 | playground.xcworkspace 29 | 30 | ## Carthage 31 | Carthage/Checkouts 32 | Carthage/Build 33 | -------------------------------------------------------------------------------- /.swiftlint.yml: -------------------------------------------------------------------------------- 1 | disabled_rules: 2 | - file_length 3 | - line_length 4 | - todo 5 | - type_name 6 | - type_body_length 7 | excluded: 8 | - Carthage 9 | - Design 10 | variable_name: 11 | min_length: 12 | warning: 2 13 | -------------------------------------------------------------------------------- /Design/Assets.sketch: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/johnyanarella/MaterialDesignColorPicker/fefc212430bb7b0ac0666735c842cff7b224d382/Design/Assets.sketch -------------------------------------------------------------------------------- /Design/Example.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/johnyanarella/MaterialDesignColorPicker/fefc212430bb7b0ac0666735c842cff7b224d382/Design/Example.gif -------------------------------------------------------------------------------- /Design/Logo@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/johnyanarella/MaterialDesignColorPicker/fefc212430bb7b0ac0666735c842cff7b224d382/Design/Logo@2x.png -------------------------------------------------------------------------------- /Design/Title@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/johnyanarella/MaterialDesignColorPicker/fefc212430bb7b0ac0666735c842cff7b224d382/Design/Title@2x.png -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2017-2020 John Yanarella 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining 4 | a copy of this software and associated documentation files (the 5 | "Software"), to deal in the Software without restriction, including 6 | without limitation the rights to use, copy, modify, merge, publish, 7 | distribute, sublicense, and/or sell copies of the Software, and to 8 | permit persons to whom the Software is furnished to do so, subject to 9 | the following conditions: 10 | 11 | The above copyright notice and this permission notice shall be 12 | included in all copies or substantial portions of the Software. 13 | 14 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 15 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 16 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 17 | NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE 18 | LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 19 | OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION 20 | WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 21 | -------------------------------------------------------------------------------- /MaterialDesignColorPicker.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 46; 7 | objects = { 8 | 9 | /* Begin PBXBuildFile section */ 10 | FC1901C41E5261560039E379 /* Fonts in Resources */ = {isa = PBXBuildFile; fileRef = FC1901C31E5261560039E379 /* Fonts */; }; 11 | FC1901C51E5261560039E379 /* Fonts in Resources */ = {isa = PBXBuildFile; fileRef = FC1901C31E5261560039E379 /* Fonts */; }; 12 | FC2EE82A1E631FA400838B99 /* LICENSE in Resources */ = {isa = PBXBuildFile; fileRef = FC2EE8291E631F9A00838B99 /* LICENSE */; }; 13 | FC3CA52E1E3B0E7200B72C7D /* MaterialDesignColorSwatchCollectionViewItem.swift in Sources */ = {isa = PBXBuildFile; fileRef = FC3CA52C1E3B0E7200B72C7D /* MaterialDesignColorSwatchCollectionViewItem.swift */; }; 14 | FC3CA52F1E3B0E7200B72C7D /* MaterialDesignColorSwatchCollectionViewItem.swift in Sources */ = {isa = PBXBuildFile; fileRef = FC3CA52C1E3B0E7200B72C7D /* MaterialDesignColorSwatchCollectionViewItem.swift */; }; 15 | FC3CA5301E3B0E7200B72C7D /* MaterialDesignColorSwatchCollectionViewItem.xib in Resources */ = {isa = PBXBuildFile; fileRef = FC3CA52D1E3B0E7200B72C7D /* MaterialDesignColorSwatchCollectionViewItem.xib */; }; 16 | FC3CA5311E3B0E7200B72C7D /* MaterialDesignColorSwatchCollectionViewItem.xib in Resources */ = {isa = PBXBuildFile; fileRef = FC3CA52D1E3B0E7200B72C7D /* MaterialDesignColorSwatchCollectionViewItem.xib */; }; 17 | FC5CE1891E1F4AE200C2743F /* MaterialDesignColorPicker.swift in Sources */ = {isa = PBXBuildFile; fileRef = FC5CE1881E1F4AE200C2743F /* MaterialDesignColorPicker.swift */; }; 18 | FC5CE1971E229F8700C2743F /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = FC5CE1961E229F8700C2743F /* Assets.xcassets */; }; 19 | FC5CE19B1E22BC7800C2743F /* MaterialDesignColorPalette.swift in Sources */ = {isa = PBXBuildFile; fileRef = FC5CE19A1E22BC7800C2743F /* MaterialDesignColorPalette.swift */; }; 20 | FC5CE19D1E22BCBF00C2743F /* NSColor+hex.swift in Sources */ = {isa = PBXBuildFile; fileRef = FC5CE19C1E22BCBF00C2743F /* NSColor+hex.swift */; }; 21 | FC6F68F11E31C6570021749C /* MaterialDesignColorPickerFramework.h in Headers */ = {isa = PBXBuildFile; fileRef = FC6F68EF1E31C6570021749C /* MaterialDesignColorPickerFramework.h */; settings = {ATTRIBUTES = (Public, ); }; }; 22 | FC6F68F51E31C65E0021749C /* NSView+ripple.swift in Sources */ = {isa = PBXBuildFile; fileRef = FC7FC3C61E31BE90006C2AEC /* NSView+ripple.swift */; }; 23 | FC6F68F61E31C6610021749C /* NSColor+hex.swift in Sources */ = {isa = PBXBuildFile; fileRef = FC5CE19C1E22BCBF00C2743F /* NSColor+hex.swift */; }; 24 | FC6F68F71E31C6640021749C /* NSBezierPath+cgPath.swift in Sources */ = {isa = PBXBuildFile; fileRef = FC7FC3C41E31BE4C006C2AEC /* NSBezierPath+cgPath.swift */; }; 25 | FC6F68F81E31C6640021749C /* NSBezierPath+cgPath.swift in Sources */ = {isa = PBXBuildFile; fileRef = FC7FC3C41E31BE4C006C2AEC /* NSBezierPath+cgPath.swift */; }; 26 | FC6F68F91E31C6670021749C /* MaterialDesignEasingCurves.swift in Sources */ = {isa = PBXBuildFile; fileRef = FC7FC3C81E31BEF9006C2AEC /* MaterialDesignEasingCurves.swift */; }; 27 | FC6F68FC1E31C6740021749C /* MaterialDesignColorPalette.swift in Sources */ = {isa = PBXBuildFile; fileRef = FC5CE19A1E22BC7800C2743F /* MaterialDesignColorPalette.swift */; }; 28 | FC7308CC1E53B557007FFFA1 /* MaterialDesignColorPicker.swift in Sources */ = {isa = PBXBuildFile; fileRef = FC5CE1881E1F4AE200C2743F /* MaterialDesignColorPicker.swift */; }; 29 | FC7FC3C71E31BE90006C2AEC /* NSView+ripple.swift in Sources */ = {isa = PBXBuildFile; fileRef = FC7FC3C61E31BE90006C2AEC /* NSView+ripple.swift */; }; 30 | FC7FC3C91E31BEF9006C2AEC /* MaterialDesignEasingCurves.swift in Sources */ = {isa = PBXBuildFile; fileRef = FC7FC3C81E31BEF9006C2AEC /* MaterialDesignEasingCurves.swift */; }; 31 | FC8A70651E32FFBE0074F427 /* MaterialDesignColorPaletteView.swift in Sources */ = {isa = PBXBuildFile; fileRef = FC8A70641E32FFBE0074F427 /* MaterialDesignColorPaletteView.swift */; }; 32 | FC8A70751E346FF70074F427 /* MaterialDesignColorPaletteView.swift in Sources */ = {isa = PBXBuildFile; fileRef = FC8A70641E32FFBE0074F427 /* MaterialDesignColorPaletteView.swift */; }; 33 | FC9A3E6A1E47CFA300165FFB /* MaterialDesignColorSwatchCollectionViewHeaderView.xib in Resources */ = {isa = PBXBuildFile; fileRef = FC9A3E691E47CFA300165FFB /* MaterialDesignColorSwatchCollectionViewHeaderView.xib */; }; 34 | FC9A3E6C1E47D0F000165FFB /* MaterialDesignColorSwatchCollectionViewHeaderView.swift in Sources */ = {isa = PBXBuildFile; fileRef = FC9A3E6B1E47D0F000165FFB /* MaterialDesignColorSwatchCollectionViewHeaderView.swift */; }; 35 | FC9A3E6D1E47D29A00165FFB /* MaterialDesignColorSwatchCollectionViewHeaderView.swift in Sources */ = {isa = PBXBuildFile; fileRef = FC9A3E6B1E47D0F000165FFB /* MaterialDesignColorSwatchCollectionViewHeaderView.swift */; }; 36 | FC9A3E6E1E47D65700165FFB /* MaterialDesignColorSwatchCollectionViewHeaderView.xib in Resources */ = {isa = PBXBuildFile; fileRef = FC9A3E691E47CFA300165FFB /* MaterialDesignColorSwatchCollectionViewHeaderView.xib */; }; 37 | FC9A3E701E47D9A300165FFB /* RippleView.swift in Sources */ = {isa = PBXBuildFile; fileRef = FC9A3E6F1E47D9A300165FFB /* RippleView.swift */; }; 38 | FC9A3E711E47D9A300165FFB /* RippleView.swift in Sources */ = {isa = PBXBuildFile; fileRef = FC9A3E6F1E47D9A300165FFB /* RippleView.swift */; }; 39 | FCE0E67F1E4B86B90015974C /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = FC5CE1961E229F8700C2743F /* Assets.xcassets */; }; 40 | FCE618001E5398B700D49B4D /* MaterialDesignColorPicker.xib in Resources */ = {isa = PBXBuildFile; fileRef = FCE617FF1E5398B700D49B4D /* MaterialDesignColorPicker.xib */; }; 41 | FCE618011E5398B700D49B4D /* MaterialDesignColorPicker.xib in Resources */ = {isa = PBXBuildFile; fileRef = FCE617FF1E5398B700D49B4D /* MaterialDesignColorPicker.xib */; }; 42 | /* End PBXBuildFile section */ 43 | 44 | /* Begin PBXFileReference section */ 45 | FC1901C31E5261560039E379 /* Fonts */ = {isa = PBXFileReference; lastKnownFileType = folder; path = Fonts; sourceTree = ""; }; 46 | FC2EE8281E631F9100838B99 /* README.md */ = {isa = PBXFileReference; lastKnownFileType = net.daringfireball.markdown; path = README.md; sourceTree = ""; }; 47 | FC2EE8291E631F9A00838B99 /* LICENSE */ = {isa = PBXFileReference; lastKnownFileType = text; path = LICENSE; sourceTree = ""; }; 48 | FC3CA52C1E3B0E7200B72C7D /* MaterialDesignColorSwatchCollectionViewItem.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = MaterialDesignColorSwatchCollectionViewItem.swift; sourceTree = ""; }; 49 | FC3CA52D1E3B0E7200B72C7D /* MaterialDesignColorSwatchCollectionViewItem.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = MaterialDesignColorSwatchCollectionViewItem.xib; sourceTree = ""; }; 50 | FC5CE17F1E1F4A8F00C2743F /* MaterialDesignColorPicker.colorPicker */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = MaterialDesignColorPicker.colorPicker; sourceTree = BUILT_PRODUCTS_DIR; }; 51 | FC5CE1821E1F4A8F00C2743F /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 52 | FC5CE1881E1F4AE200C2743F /* MaterialDesignColorPicker.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = MaterialDesignColorPicker.swift; sourceTree = ""; }; 53 | FC5CE1901E229E3B00C2743F /* .swiftlint.yml */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = .swiftlint.yml; sourceTree = ""; }; 54 | FC5CE1921E229E7700C2743F /* .gitignore */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = .gitignore; sourceTree = ""; }; 55 | FC5CE1961E229F8700C2743F /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; 56 | FC5CE19A1E22BC7800C2743F /* MaterialDesignColorPalette.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = MaterialDesignColorPalette.swift; sourceTree = ""; }; 57 | FC5CE19C1E22BCBF00C2743F /* NSColor+hex.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "NSColor+hex.swift"; sourceTree = ""; }; 58 | FC6F68D41E31C3710021749C /* Playground.playground */ = {isa = PBXFileReference; lastKnownFileType = file.playground; path = Playground.playground; sourceTree = SOURCE_ROOT; xcLanguageSpecificationIdentifier = xcode.lang.swift; }; 59 | FC6F68ED1E31C6570021749C /* MaterialDesignColorPickerFramework.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = MaterialDesignColorPickerFramework.framework; sourceTree = BUILT_PRODUCTS_DIR; }; 60 | FC6F68EF1E31C6570021749C /* MaterialDesignColorPickerFramework.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = MaterialDesignColorPickerFramework.h; sourceTree = ""; }; 61 | FC6F68F01E31C6570021749C /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 62 | FC7FC3C41E31BE4C006C2AEC /* NSBezierPath+cgPath.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "NSBezierPath+cgPath.swift"; sourceTree = ""; }; 63 | FC7FC3C61E31BE90006C2AEC /* NSView+ripple.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "NSView+ripple.swift"; sourceTree = ""; }; 64 | FC7FC3C81E31BEF9006C2AEC /* MaterialDesignEasingCurves.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = MaterialDesignEasingCurves.swift; sourceTree = ""; }; 65 | FC8A70641E32FFBE0074F427 /* MaterialDesignColorPaletteView.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = MaterialDesignColorPaletteView.swift; sourceTree = ""; }; 66 | FC9A3E691E47CFA300165FFB /* MaterialDesignColorSwatchCollectionViewHeaderView.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = MaterialDesignColorSwatchCollectionViewHeaderView.xib; sourceTree = ""; }; 67 | FC9A3E6B1E47D0F000165FFB /* MaterialDesignColorSwatchCollectionViewHeaderView.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = MaterialDesignColorSwatchCollectionViewHeaderView.swift; sourceTree = ""; }; 68 | FC9A3E6F1E47D9A300165FFB /* RippleView.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = RippleView.swift; sourceTree = ""; }; 69 | FCE617FF1E5398B700D49B4D /* MaterialDesignColorPicker.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = MaterialDesignColorPicker.xib; sourceTree = ""; }; 70 | /* End PBXFileReference section */ 71 | 72 | /* Begin PBXFrameworksBuildPhase section */ 73 | FC5CE17C1E1F4A8F00C2743F /* Frameworks */ = { 74 | isa = PBXFrameworksBuildPhase; 75 | buildActionMask = 2147483647; 76 | files = ( 77 | ); 78 | runOnlyForDeploymentPostprocessing = 0; 79 | }; 80 | FC6F68E91E31C6570021749C /* Frameworks */ = { 81 | isa = PBXFrameworksBuildPhase; 82 | buildActionMask = 2147483647; 83 | files = ( 84 | ); 85 | runOnlyForDeploymentPostprocessing = 0; 86 | }; 87 | /* End PBXFrameworksBuildPhase section */ 88 | 89 | /* Begin PBXGroup section */ 90 | FC5CE1761E1F4A8F00C2743F = { 91 | isa = PBXGroup; 92 | children = ( 93 | FC5CE1921E229E7700C2743F /* .gitignore */, 94 | FC5CE1901E229E3B00C2743F /* .swiftlint.yml */, 95 | FC2EE8291E631F9A00838B99 /* LICENSE */, 96 | FC6F68D41E31C3710021749C /* Playground.playground */, 97 | FC2EE8281E631F9100838B99 /* README.md */, 98 | FC5CE1811E1F4A8F00C2743F /* MaterialDesignColorPicker */, 99 | FC6F68EE1E31C6570021749C /* MaterialDesignColorPickerFramework */, 100 | FC5CE1801E1F4A8F00C2743F /* Products */, 101 | ); 102 | sourceTree = ""; 103 | }; 104 | FC5CE1801E1F4A8F00C2743F /* Products */ = { 105 | isa = PBXGroup; 106 | children = ( 107 | FC5CE17F1E1F4A8F00C2743F /* MaterialDesignColorPicker.colorPicker */, 108 | FC6F68ED1E31C6570021749C /* MaterialDesignColorPickerFramework.framework */, 109 | ); 110 | name = Products; 111 | sourceTree = ""; 112 | }; 113 | FC5CE1811E1F4A8F00C2743F /* MaterialDesignColorPicker */ = { 114 | isa = PBXGroup; 115 | children = ( 116 | FC5CE1961E229F8700C2743F /* Assets.xcassets */, 117 | FC1901C31E5261560039E379 /* Fonts */, 118 | FC5CE1821E1F4A8F00C2743F /* Info.plist */, 119 | FC5CE19A1E22BC7800C2743F /* MaterialDesignColorPalette.swift */, 120 | FC8A70641E32FFBE0074F427 /* MaterialDesignColorPaletteView.swift */, 121 | FC5CE1881E1F4AE200C2743F /* MaterialDesignColorPicker.swift */, 122 | FCE617FF1E5398B700D49B4D /* MaterialDesignColorPicker.xib */, 123 | FC9A3E6B1E47D0F000165FFB /* MaterialDesignColorSwatchCollectionViewHeaderView.swift */, 124 | FC9A3E691E47CFA300165FFB /* MaterialDesignColorSwatchCollectionViewHeaderView.xib */, 125 | FC3CA52C1E3B0E7200B72C7D /* MaterialDesignColorSwatchCollectionViewItem.swift */, 126 | FC3CA52D1E3B0E7200B72C7D /* MaterialDesignColorSwatchCollectionViewItem.xib */, 127 | FC7FC3C81E31BEF9006C2AEC /* MaterialDesignEasingCurves.swift */, 128 | FC7FC3C41E31BE4C006C2AEC /* NSBezierPath+cgPath.swift */, 129 | FC5CE19C1E22BCBF00C2743F /* NSColor+hex.swift */, 130 | FC7FC3C61E31BE90006C2AEC /* NSView+ripple.swift */, 131 | FC9A3E6F1E47D9A300165FFB /* RippleView.swift */, 132 | ); 133 | path = MaterialDesignColorPicker; 134 | sourceTree = ""; 135 | }; 136 | FC6F68EE1E31C6570021749C /* MaterialDesignColorPickerFramework */ = { 137 | isa = PBXGroup; 138 | children = ( 139 | FC6F68EF1E31C6570021749C /* MaterialDesignColorPickerFramework.h */, 140 | FC6F68F01E31C6570021749C /* Info.plist */, 141 | ); 142 | path = MaterialDesignColorPickerFramework; 143 | sourceTree = ""; 144 | }; 145 | /* End PBXGroup section */ 146 | 147 | /* Begin PBXHeadersBuildPhase section */ 148 | FC6F68EA1E31C6570021749C /* Headers */ = { 149 | isa = PBXHeadersBuildPhase; 150 | buildActionMask = 2147483647; 151 | files = ( 152 | FC6F68F11E31C6570021749C /* MaterialDesignColorPickerFramework.h in Headers */, 153 | ); 154 | runOnlyForDeploymentPostprocessing = 0; 155 | }; 156 | /* End PBXHeadersBuildPhase section */ 157 | 158 | /* Begin PBXNativeTarget section */ 159 | FC5CE17E1E1F4A8F00C2743F /* MaterialDesignColorPicker */ = { 160 | isa = PBXNativeTarget; 161 | buildConfigurationList = FC5CE1851E1F4A8F00C2743F /* Build configuration list for PBXNativeTarget "MaterialDesignColorPicker" */; 162 | buildPhases = ( 163 | FC5CE17B1E1F4A8F00C2743F /* Sources */, 164 | FC5CE18E1E229DC600C2743F /* ShellScript */, 165 | FC5CE18F1E229DF600C2743F /* ShellScript */, 166 | FC5CE17C1E1F4A8F00C2743F /* Frameworks */, 167 | FC5CE17D1E1F4A8F00C2743F /* Resources */, 168 | ); 169 | buildRules = ( 170 | ); 171 | dependencies = ( 172 | ); 173 | name = MaterialDesignColorPicker; 174 | productName = MaterialDesignColorPicker; 175 | productReference = FC5CE17F1E1F4A8F00C2743F /* MaterialDesignColorPicker.colorPicker */; 176 | productType = "com.apple.product-type.bundle"; 177 | }; 178 | FC6F68EC1E31C6570021749C /* MaterialDesignColorPickerFramework */ = { 179 | isa = PBXNativeTarget; 180 | buildConfigurationList = FC6F68F21E31C6570021749C /* Build configuration list for PBXNativeTarget "MaterialDesignColorPickerFramework" */; 181 | buildPhases = ( 182 | FC6F68E81E31C6570021749C /* Sources */, 183 | FCE0E67E1E4AA0540015974C /* ShellScript */, 184 | FCE0E67D1E4AA0300015974C /* ShellScript */, 185 | FC6F68E91E31C6570021749C /* Frameworks */, 186 | FC6F68EA1E31C6570021749C /* Headers */, 187 | FC6F68EB1E31C6570021749C /* Resources */, 188 | ); 189 | buildRules = ( 190 | ); 191 | dependencies = ( 192 | ); 193 | name = MaterialDesignColorPickerFramework; 194 | productName = MaterialDesignColorPickerFramework; 195 | productReference = FC6F68ED1E31C6570021749C /* MaterialDesignColorPickerFramework.framework */; 196 | productType = "com.apple.product-type.framework"; 197 | }; 198 | /* End PBXNativeTarget section */ 199 | 200 | /* Begin PBXProject section */ 201 | FC5CE1771E1F4A8F00C2743F /* Project object */ = { 202 | isa = PBXProject; 203 | attributes = { 204 | LastUpgradeCheck = 1160; 205 | ORGANIZATIONNAME = CodeCatalyst; 206 | TargetAttributes = { 207 | FC5CE17E1E1F4A8F00C2743F = { 208 | CreatedOnToolsVersion = 8.2.1; 209 | DevelopmentTeam = 2DS7W7NX9T; 210 | LastSwiftMigration = 0820; 211 | ProvisioningStyle = Automatic; 212 | }; 213 | FC6F68EC1E31C6570021749C = { 214 | CreatedOnToolsVersion = 8.2.1; 215 | LastSwiftMigration = 0820; 216 | ProvisioningStyle = Automatic; 217 | }; 218 | }; 219 | }; 220 | buildConfigurationList = FC5CE17A1E1F4A8F00C2743F /* Build configuration list for PBXProject "MaterialDesignColorPicker" */; 221 | compatibilityVersion = "Xcode 3.2"; 222 | developmentRegion = en; 223 | hasScannedForEncodings = 0; 224 | knownRegions = ( 225 | en, 226 | Base, 227 | ); 228 | mainGroup = FC5CE1761E1F4A8F00C2743F; 229 | productRefGroup = FC5CE1801E1F4A8F00C2743F /* Products */; 230 | projectDirPath = ""; 231 | projectRoot = ""; 232 | targets = ( 233 | FC5CE17E1E1F4A8F00C2743F /* MaterialDesignColorPicker */, 234 | FC6F68EC1E31C6570021749C /* MaterialDesignColorPickerFramework */, 235 | ); 236 | }; 237 | /* End PBXProject section */ 238 | 239 | /* Begin PBXResourcesBuildPhase section */ 240 | FC5CE17D1E1F4A8F00C2743F /* Resources */ = { 241 | isa = PBXResourcesBuildPhase; 242 | buildActionMask = 2147483647; 243 | files = ( 244 | FC2EE82A1E631FA400838B99 /* LICENSE in Resources */, 245 | FC1901C41E5261560039E379 /* Fonts in Resources */, 246 | FC9A3E6A1E47CFA300165FFB /* MaterialDesignColorSwatchCollectionViewHeaderView.xib in Resources */, 247 | FC3CA5301E3B0E7200B72C7D /* MaterialDesignColorSwatchCollectionViewItem.xib in Resources */, 248 | FC5CE1971E229F8700C2743F /* Assets.xcassets in Resources */, 249 | FCE618001E5398B700D49B4D /* MaterialDesignColorPicker.xib in Resources */, 250 | ); 251 | runOnlyForDeploymentPostprocessing = 0; 252 | }; 253 | FC6F68EB1E31C6570021749C /* Resources */ = { 254 | isa = PBXResourcesBuildPhase; 255 | buildActionMask = 2147483647; 256 | files = ( 257 | FC1901C51E5261560039E379 /* Fonts in Resources */, 258 | FC3CA5311E3B0E7200B72C7D /* MaterialDesignColorSwatchCollectionViewItem.xib in Resources */, 259 | FC9A3E6E1E47D65700165FFB /* MaterialDesignColorSwatchCollectionViewHeaderView.xib in Resources */, 260 | FCE0E67F1E4B86B90015974C /* Assets.xcassets in Resources */, 261 | FCE618011E5398B700D49B4D /* MaterialDesignColorPicker.xib in Resources */, 262 | ); 263 | runOnlyForDeploymentPostprocessing = 0; 264 | }; 265 | /* End PBXResourcesBuildPhase section */ 266 | 267 | /* Begin PBXShellScriptBuildPhase section */ 268 | FC5CE18E1E229DC600C2743F /* ShellScript */ = { 269 | isa = PBXShellScriptBuildPhase; 270 | buildActionMask = 2147483647; 271 | files = ( 272 | ); 273 | inputPaths = ( 274 | ); 275 | outputPaths = ( 276 | ); 277 | runOnlyForDeploymentPostprocessing = 0; 278 | shellPath = /bin/sh; 279 | shellScript = "TAGS=\"TODO:|FIXME:\"\nfind \"${SRCROOT}\" \\( -name \"*.h\" -or -name \"*.m\" -or -name \"*.swift\" \\) -print0 | xargs -0 egrep --with-filename --line-number --only-matching \"($TAGS).*\\$\" | perl -p -e \"s/($TAGS)/ warning: \\$1/\"\n"; 280 | }; 281 | FC5CE18F1E229DF600C2743F /* ShellScript */ = { 282 | isa = PBXShellScriptBuildPhase; 283 | buildActionMask = 2147483647; 284 | files = ( 285 | ); 286 | inputPaths = ( 287 | ); 288 | outputPaths = ( 289 | ); 290 | runOnlyForDeploymentPostprocessing = 0; 291 | shellPath = /bin/sh; 292 | shellScript = "if which swiftlint >/dev/null; then\nswiftlint\nelse\necho \"warning: SwiftLint does not exist, download it from: https://github.com/realm/SwiftLint\"\nfi\n"; 293 | }; 294 | FCE0E67D1E4AA0300015974C /* ShellScript */ = { 295 | isa = PBXShellScriptBuildPhase; 296 | buildActionMask = 2147483647; 297 | files = ( 298 | ); 299 | inputPaths = ( 300 | ); 301 | outputPaths = ( 302 | ); 303 | runOnlyForDeploymentPostprocessing = 0; 304 | shellPath = /bin/sh; 305 | shellScript = "if which swiftlint >/dev/null; then\nswiftlint\nelse\necho \"warning: SwiftLint does not exist, download it from: https://github.com/realm/SwiftLint\"\nfi"; 306 | }; 307 | FCE0E67E1E4AA0540015974C /* ShellScript */ = { 308 | isa = PBXShellScriptBuildPhase; 309 | buildActionMask = 2147483647; 310 | files = ( 311 | ); 312 | inputPaths = ( 313 | ); 314 | outputPaths = ( 315 | ); 316 | runOnlyForDeploymentPostprocessing = 0; 317 | shellPath = /bin/sh; 318 | shellScript = "TAGS=\"TODO:|FIXME:\"\nfind \"${SRCROOT}\" \\( -name \"*.h\" -or -name \"*.m\" -or -name \"*.swift\" \\) -print0 | xargs -0 egrep --with-filename --line-number --only-matching \"($TAGS).*\\$\" | perl -p -e \"s/($TAGS)/ warning: \\$1/\""; 319 | }; 320 | /* End PBXShellScriptBuildPhase section */ 321 | 322 | /* Begin PBXSourcesBuildPhase section */ 323 | FC5CE17B1E1F4A8F00C2743F /* Sources */ = { 324 | isa = PBXSourcesBuildPhase; 325 | buildActionMask = 2147483647; 326 | files = ( 327 | FC8A70651E32FFBE0074F427 /* MaterialDesignColorPaletteView.swift in Sources */, 328 | FC9A3E6C1E47D0F000165FFB /* MaterialDesignColorSwatchCollectionViewHeaderView.swift in Sources */, 329 | FC5CE19D1E22BCBF00C2743F /* NSColor+hex.swift in Sources */, 330 | FC7FC3C91E31BEF9006C2AEC /* MaterialDesignEasingCurves.swift in Sources */, 331 | FC6F68F71E31C6640021749C /* NSBezierPath+cgPath.swift in Sources */, 332 | FC9A3E701E47D9A300165FFB /* RippleView.swift in Sources */, 333 | FC5CE19B1E22BC7800C2743F /* MaterialDesignColorPalette.swift in Sources */, 334 | FC7FC3C71E31BE90006C2AEC /* NSView+ripple.swift in Sources */, 335 | FC3CA52E1E3B0E7200B72C7D /* MaterialDesignColorSwatchCollectionViewItem.swift in Sources */, 336 | FC5CE1891E1F4AE200C2743F /* MaterialDesignColorPicker.swift in Sources */, 337 | ); 338 | runOnlyForDeploymentPostprocessing = 0; 339 | }; 340 | FC6F68E81E31C6570021749C /* Sources */ = { 341 | isa = PBXSourcesBuildPhase; 342 | buildActionMask = 2147483647; 343 | files = ( 344 | FC9A3E711E47D9A300165FFB /* RippleView.swift in Sources */, 345 | FC9A3E6D1E47D29A00165FFB /* MaterialDesignColorSwatchCollectionViewHeaderView.swift in Sources */, 346 | FC7308CC1E53B557007FFFA1 /* MaterialDesignColorPicker.swift in Sources */, 347 | FC6F68F61E31C6610021749C /* NSColor+hex.swift in Sources */, 348 | FC8A70751E346FF70074F427 /* MaterialDesignColorPaletteView.swift in Sources */, 349 | FC6F68F81E31C6640021749C /* NSBezierPath+cgPath.swift in Sources */, 350 | FC6F68FC1E31C6740021749C /* MaterialDesignColorPalette.swift in Sources */, 351 | FC3CA52F1E3B0E7200B72C7D /* MaterialDesignColorSwatchCollectionViewItem.swift in Sources */, 352 | FC6F68F91E31C6670021749C /* MaterialDesignEasingCurves.swift in Sources */, 353 | FC6F68F51E31C65E0021749C /* NSView+ripple.swift in Sources */, 354 | ); 355 | runOnlyForDeploymentPostprocessing = 0; 356 | }; 357 | /* End PBXSourcesBuildPhase section */ 358 | 359 | /* Begin XCBuildConfiguration section */ 360 | FC5CE1831E1F4A8F00C2743F /* Debug */ = { 361 | isa = XCBuildConfiguration; 362 | buildSettings = { 363 | ALWAYS_SEARCH_USER_PATHS = NO; 364 | CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES; 365 | CLANG_ANALYZER_NONNULL = YES; 366 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 367 | CLANG_CXX_LIBRARY = "libc++"; 368 | CLANG_ENABLE_MODULES = YES; 369 | CLANG_ENABLE_OBJC_ARC = YES; 370 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; 371 | CLANG_WARN_BOOL_CONVERSION = YES; 372 | CLANG_WARN_COMMA = YES; 373 | CLANG_WARN_CONSTANT_CONVERSION = YES; 374 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; 375 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 376 | CLANG_WARN_DOCUMENTATION_COMMENTS = YES; 377 | CLANG_WARN_EMPTY_BODY = YES; 378 | CLANG_WARN_ENUM_CONVERSION = YES; 379 | CLANG_WARN_INFINITE_RECURSION = YES; 380 | CLANG_WARN_INT_CONVERSION = YES; 381 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; 382 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; 383 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; 384 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 385 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; 386 | CLANG_WARN_STRICT_PROTOTYPES = YES; 387 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 388 | CLANG_WARN_UNREACHABLE_CODE = YES; 389 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 390 | CODE_SIGN_IDENTITY = "-"; 391 | COPY_PHASE_STRIP = NO; 392 | DEBUG_INFORMATION_FORMAT = dwarf; 393 | ENABLE_STRICT_OBJC_MSGSEND = YES; 394 | ENABLE_TESTABILITY = YES; 395 | GCC_C_LANGUAGE_STANDARD = gnu99; 396 | GCC_DYNAMIC_NO_PIC = NO; 397 | GCC_NO_COMMON_BLOCKS = YES; 398 | GCC_OPTIMIZATION_LEVEL = 0; 399 | GCC_PREPROCESSOR_DEFINITIONS = ( 400 | "DEBUG=1", 401 | "$(inherited)", 402 | ); 403 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 404 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 405 | GCC_WARN_UNDECLARED_SELECTOR = YES; 406 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 407 | GCC_WARN_UNUSED_FUNCTION = YES; 408 | GCC_WARN_UNUSED_VARIABLE = YES; 409 | MACOSX_DEPLOYMENT_TARGET = 10.13; 410 | MTL_ENABLE_DEBUG_INFO = YES; 411 | ONLY_ACTIVE_ARCH = YES; 412 | PRODUCT_NAME = "Material Design"; 413 | SDKROOT = macosx; 414 | }; 415 | name = Debug; 416 | }; 417 | FC5CE1841E1F4A8F00C2743F /* Release */ = { 418 | isa = XCBuildConfiguration; 419 | buildSettings = { 420 | ALWAYS_SEARCH_USER_PATHS = NO; 421 | CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES; 422 | CLANG_ANALYZER_NONNULL = YES; 423 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 424 | CLANG_CXX_LIBRARY = "libc++"; 425 | CLANG_ENABLE_MODULES = YES; 426 | CLANG_ENABLE_OBJC_ARC = YES; 427 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; 428 | CLANG_WARN_BOOL_CONVERSION = YES; 429 | CLANG_WARN_COMMA = YES; 430 | CLANG_WARN_CONSTANT_CONVERSION = YES; 431 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; 432 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 433 | CLANG_WARN_DOCUMENTATION_COMMENTS = YES; 434 | CLANG_WARN_EMPTY_BODY = YES; 435 | CLANG_WARN_ENUM_CONVERSION = YES; 436 | CLANG_WARN_INFINITE_RECURSION = YES; 437 | CLANG_WARN_INT_CONVERSION = YES; 438 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; 439 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; 440 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; 441 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 442 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; 443 | CLANG_WARN_STRICT_PROTOTYPES = YES; 444 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 445 | CLANG_WARN_UNREACHABLE_CODE = YES; 446 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 447 | CODE_SIGN_IDENTITY = "-"; 448 | COPY_PHASE_STRIP = NO; 449 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; 450 | ENABLE_NS_ASSERTIONS = NO; 451 | ENABLE_STRICT_OBJC_MSGSEND = YES; 452 | GCC_C_LANGUAGE_STANDARD = gnu99; 453 | GCC_NO_COMMON_BLOCKS = YES; 454 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 455 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 456 | GCC_WARN_UNDECLARED_SELECTOR = YES; 457 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 458 | GCC_WARN_UNUSED_FUNCTION = YES; 459 | GCC_WARN_UNUSED_VARIABLE = YES; 460 | MACOSX_DEPLOYMENT_TARGET = 10.13; 461 | MTL_ENABLE_DEBUG_INFO = NO; 462 | PRODUCT_NAME = "Material Design"; 463 | SDKROOT = macosx; 464 | }; 465 | name = Release; 466 | }; 467 | FC5CE1861E1F4A8F00C2743F /* Debug */ = { 468 | isa = XCBuildConfiguration; 469 | buildSettings = { 470 | ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = NO; 471 | CLANG_ENABLE_MODULES = YES; 472 | CODE_SIGN_IDENTITY = ""; 473 | COMBINE_HIDPI_IMAGES = YES; 474 | INFOPLIST_FILE = MaterialDesignColorPicker/Info.plist; 475 | INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Bundles"; 476 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks @loader_path/../Frameworks"; 477 | MACOSX_DEPLOYMENT_TARGET = 10.13; 478 | PRODUCT_BUNDLE_IDENTIFIER = com.codecatalyst.MaterialDesignColorPicker; 479 | PRODUCT_NAME = "$(TARGET_NAME)"; 480 | SKIP_INSTALL = NO; 481 | SWIFT_OBJC_BRIDGING_HEADER = ""; 482 | SWIFT_OPTIMIZATION_LEVEL = "-Onone"; 483 | SWIFT_VERSION = 5.0; 484 | WRAPPER_EXTENSION = colorPicker; 485 | }; 486 | name = Debug; 487 | }; 488 | FC5CE1871E1F4A8F00C2743F /* Release */ = { 489 | isa = XCBuildConfiguration; 490 | buildSettings = { 491 | ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = NO; 492 | CLANG_ENABLE_MODULES = YES; 493 | CODE_SIGN_IDENTITY = ""; 494 | COMBINE_HIDPI_IMAGES = YES; 495 | INFOPLIST_FILE = MaterialDesignColorPicker/Info.plist; 496 | INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Bundles"; 497 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks @loader_path/../Frameworks"; 498 | MACOSX_DEPLOYMENT_TARGET = 10.13; 499 | PRODUCT_BUNDLE_IDENTIFIER = com.codecatalyst.MaterialDesignColorPicker; 500 | PRODUCT_NAME = "$(TARGET_NAME)"; 501 | SKIP_INSTALL = NO; 502 | SWIFT_OBJC_BRIDGING_HEADER = ""; 503 | SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule"; 504 | SWIFT_VERSION = 5.0; 505 | WRAPPER_EXTENSION = colorPicker; 506 | }; 507 | name = Release; 508 | }; 509 | FC6F68F31E31C6570021749C /* Debug */ = { 510 | isa = XCBuildConfiguration; 511 | buildSettings = { 512 | CLANG_ENABLE_MODULES = YES; 513 | CODE_SIGN_IDENTITY = ""; 514 | COMBINE_HIDPI_IMAGES = YES; 515 | CURRENT_PROJECT_VERSION = 1; 516 | DEFINES_MODULE = YES; 517 | DEVELOPMENT_TEAM = ""; 518 | DYLIB_COMPATIBILITY_VERSION = 1; 519 | DYLIB_CURRENT_VERSION = 1; 520 | DYLIB_INSTALL_NAME_BASE = "@rpath"; 521 | FRAMEWORK_VERSION = A; 522 | INFOPLIST_FILE = MaterialDesignColorPickerFramework/Info.plist; 523 | INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; 524 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks @loader_path/Frameworks"; 525 | MACOSX_DEPLOYMENT_TARGET = 10.13; 526 | PRODUCT_BUNDLE_IDENTIFIER = com.codecatalyst.MaterialDesignColorPickerFramework; 527 | PRODUCT_NAME = "$(TARGET_NAME)"; 528 | SKIP_INSTALL = YES; 529 | SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG; 530 | SWIFT_OPTIMIZATION_LEVEL = "-Onone"; 531 | SWIFT_VERSION = 5.0; 532 | VERSIONING_SYSTEM = "apple-generic"; 533 | VERSION_INFO_PREFIX = ""; 534 | }; 535 | name = Debug; 536 | }; 537 | FC6F68F41E31C6570021749C /* Release */ = { 538 | isa = XCBuildConfiguration; 539 | buildSettings = { 540 | CLANG_ENABLE_MODULES = YES; 541 | CODE_SIGN_IDENTITY = ""; 542 | COMBINE_HIDPI_IMAGES = YES; 543 | CURRENT_PROJECT_VERSION = 1; 544 | DEFINES_MODULE = YES; 545 | DEVELOPMENT_TEAM = ""; 546 | DYLIB_COMPATIBILITY_VERSION = 1; 547 | DYLIB_CURRENT_VERSION = 1; 548 | DYLIB_INSTALL_NAME_BASE = "@rpath"; 549 | FRAMEWORK_VERSION = A; 550 | INFOPLIST_FILE = MaterialDesignColorPickerFramework/Info.plist; 551 | INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; 552 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks @loader_path/Frameworks"; 553 | MACOSX_DEPLOYMENT_TARGET = 10.13; 554 | PRODUCT_BUNDLE_IDENTIFIER = com.codecatalyst.MaterialDesignColorPickerFramework; 555 | PRODUCT_NAME = "$(TARGET_NAME)"; 556 | SKIP_INSTALL = YES; 557 | SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule"; 558 | SWIFT_VERSION = 5.0; 559 | VERSIONING_SYSTEM = "apple-generic"; 560 | VERSION_INFO_PREFIX = ""; 561 | }; 562 | name = Release; 563 | }; 564 | /* End XCBuildConfiguration section */ 565 | 566 | /* Begin XCConfigurationList section */ 567 | FC5CE17A1E1F4A8F00C2743F /* Build configuration list for PBXProject "MaterialDesignColorPicker" */ = { 568 | isa = XCConfigurationList; 569 | buildConfigurations = ( 570 | FC5CE1831E1F4A8F00C2743F /* Debug */, 571 | FC5CE1841E1F4A8F00C2743F /* Release */, 572 | ); 573 | defaultConfigurationIsVisible = 0; 574 | defaultConfigurationName = Release; 575 | }; 576 | FC5CE1851E1F4A8F00C2743F /* Build configuration list for PBXNativeTarget "MaterialDesignColorPicker" */ = { 577 | isa = XCConfigurationList; 578 | buildConfigurations = ( 579 | FC5CE1861E1F4A8F00C2743F /* Debug */, 580 | FC5CE1871E1F4A8F00C2743F /* Release */, 581 | ); 582 | defaultConfigurationIsVisible = 0; 583 | defaultConfigurationName = Release; 584 | }; 585 | FC6F68F21E31C6570021749C /* Build configuration list for PBXNativeTarget "MaterialDesignColorPickerFramework" */ = { 586 | isa = XCConfigurationList; 587 | buildConfigurations = ( 588 | FC6F68F31E31C6570021749C /* Debug */, 589 | FC6F68F41E31C6570021749C /* Release */, 590 | ); 591 | defaultConfigurationIsVisible = 0; 592 | defaultConfigurationName = Release; 593 | }; 594 | /* End XCConfigurationList section */ 595 | }; 596 | rootObject = FC5CE1771E1F4A8F00C2743F /* Project object */; 597 | } 598 | -------------------------------------------------------------------------------- /MaterialDesignColorPicker.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /MaterialDesignColorPicker.xcodeproj/xcshareddata/xcschemes/MaterialDesignColorPicker.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 24 | 25 | 30 | 31 | 32 | 33 | 43 | 44 | 50 | 51 | 52 | 53 | 59 | 60 | 66 | 67 | 68 | 69 | 71 | 72 | 75 | 76 | 77 | -------------------------------------------------------------------------------- /MaterialDesignColorPicker.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /MaterialDesignColorPicker/Assets.xcassets/ButtonImage.imageset/ButtonImage.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/johnyanarella/MaterialDesignColorPicker/fefc212430bb7b0ac0666735c842cff7b224d382/MaterialDesignColorPicker/Assets.xcassets/ButtonImage.imageset/ButtonImage.png -------------------------------------------------------------------------------- /MaterialDesignColorPicker/Assets.xcassets/ButtonImage.imageset/ButtonImage@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/johnyanarella/MaterialDesignColorPicker/fefc212430bb7b0ac0666735c842cff7b224d382/MaterialDesignColorPicker/Assets.xcassets/ButtonImage.imageset/ButtonImage@2x.png -------------------------------------------------------------------------------- /MaterialDesignColorPicker/Assets.xcassets/ButtonImage.imageset/ButtonImage@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/johnyanarella/MaterialDesignColorPicker/fefc212430bb7b0ac0666735c842cff7b224d382/MaterialDesignColorPicker/Assets.xcassets/ButtonImage.imageset/ButtonImage@3x.png -------------------------------------------------------------------------------- /MaterialDesignColorPicker/Assets.xcassets/ButtonImage.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "ButtonImage.png", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "filename" : "ButtonImage@2x.png", 11 | "scale" : "2x" 12 | }, 13 | { 14 | "idiom" : "universal", 15 | "filename" : "ButtonImage@3x.png", 16 | "scale" : "3x" 17 | } 18 | ], 19 | "info" : { 20 | "version" : 1, 21 | "author" : "xcode" 22 | } 23 | } -------------------------------------------------------------------------------- /MaterialDesignColorPicker/Assets.xcassets/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "info" : { 3 | "version" : 1, 4 | "author" : "xcode" 5 | } 6 | } -------------------------------------------------------------------------------- /MaterialDesignColorPicker/Fonts/Roboto-Black.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/johnyanarella/MaterialDesignColorPicker/fefc212430bb7b0ac0666735c842cff7b224d382/MaterialDesignColorPicker/Fonts/Roboto-Black.ttf -------------------------------------------------------------------------------- /MaterialDesignColorPicker/Fonts/Roboto-BlackItalic.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/johnyanarella/MaterialDesignColorPicker/fefc212430bb7b0ac0666735c842cff7b224d382/MaterialDesignColorPicker/Fonts/Roboto-BlackItalic.ttf -------------------------------------------------------------------------------- /MaterialDesignColorPicker/Fonts/Roboto-Bold.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/johnyanarella/MaterialDesignColorPicker/fefc212430bb7b0ac0666735c842cff7b224d382/MaterialDesignColorPicker/Fonts/Roboto-Bold.ttf -------------------------------------------------------------------------------- /MaterialDesignColorPicker/Fonts/Roboto-BoldItalic.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/johnyanarella/MaterialDesignColorPicker/fefc212430bb7b0ac0666735c842cff7b224d382/MaterialDesignColorPicker/Fonts/Roboto-BoldItalic.ttf -------------------------------------------------------------------------------- /MaterialDesignColorPicker/Fonts/Roboto-Italic.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/johnyanarella/MaterialDesignColorPicker/fefc212430bb7b0ac0666735c842cff7b224d382/MaterialDesignColorPicker/Fonts/Roboto-Italic.ttf -------------------------------------------------------------------------------- /MaterialDesignColorPicker/Fonts/Roboto-Light.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/johnyanarella/MaterialDesignColorPicker/fefc212430bb7b0ac0666735c842cff7b224d382/MaterialDesignColorPicker/Fonts/Roboto-Light.ttf -------------------------------------------------------------------------------- /MaterialDesignColorPicker/Fonts/Roboto-LightItalic.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/johnyanarella/MaterialDesignColorPicker/fefc212430bb7b0ac0666735c842cff7b224d382/MaterialDesignColorPicker/Fonts/Roboto-LightItalic.ttf -------------------------------------------------------------------------------- /MaterialDesignColorPicker/Fonts/Roboto-Medium.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/johnyanarella/MaterialDesignColorPicker/fefc212430bb7b0ac0666735c842cff7b224d382/MaterialDesignColorPicker/Fonts/Roboto-Medium.ttf -------------------------------------------------------------------------------- /MaterialDesignColorPicker/Fonts/Roboto-MediumItalic.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/johnyanarella/MaterialDesignColorPicker/fefc212430bb7b0ac0666735c842cff7b224d382/MaterialDesignColorPicker/Fonts/Roboto-MediumItalic.ttf -------------------------------------------------------------------------------- /MaterialDesignColorPicker/Fonts/Roboto-Regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/johnyanarella/MaterialDesignColorPicker/fefc212430bb7b0ac0666735c842cff7b224d382/MaterialDesignColorPicker/Fonts/Roboto-Regular.ttf -------------------------------------------------------------------------------- /MaterialDesignColorPicker/Fonts/Roboto-Thin.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/johnyanarella/MaterialDesignColorPicker/fefc212430bb7b0ac0666735c842cff7b224d382/MaterialDesignColorPicker/Fonts/Roboto-Thin.ttf -------------------------------------------------------------------------------- /MaterialDesignColorPicker/Fonts/Roboto-ThinItalic.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/johnyanarella/MaterialDesignColorPicker/fefc212430bb7b0ac0666735c842cff7b224d382/MaterialDesignColorPicker/Fonts/Roboto-ThinItalic.ttf -------------------------------------------------------------------------------- /MaterialDesignColorPicker/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | ATSApplicationFontsPath 6 | Fonts/ 7 | CFBundleDevelopmentRegion 8 | en 9 | CFBundleExecutable 10 | $(EXECUTABLE_NAME) 11 | CFBundleIdentifier 12 | $(PRODUCT_BUNDLE_IDENTIFIER) 13 | CFBundleInfoDictionaryVersion 14 | 6.0 15 | CFBundleName 16 | $(PRODUCT_NAME) 17 | CFBundlePackageType 18 | BNDL 19 | CFBundleShortVersionString 20 | 2.0.0 21 | CFBundleVersion 22 | $(CURRENT_PROJECT_VERSION) 23 | NSHumanReadableCopyright 24 | Copyright © 2017-2020 John Yanarella 25 | NSPrincipalClass 26 | MaterialDesignColorPicker.MaterialDesignColorPicker 27 | 28 | 29 | -------------------------------------------------------------------------------- /MaterialDesignColorPicker/MaterialDesignColorPalette.swift: -------------------------------------------------------------------------------- 1 | // 2 | // MaterialDesignColorPalette.swift 3 | // MaterialDesignColorPicker 4 | // 5 | // Created by John Yanarella on 1/8/17. 6 | // Copyright © 2017-2020 John Yanarella. 7 | // 8 | 9 | import Cocoa 10 | 11 | enum MaterialDesignColorKind { 12 | case dark 13 | case light 14 | } 15 | 16 | struct MaterialDesignColor: Equatable { 17 | let hex: UInt 18 | let label: String 19 | var kind: MaterialDesignColorKind 20 | 21 | let color: NSColor 22 | 23 | init(hex: UInt, label: String, kind: MaterialDesignColorKind) { 24 | self.hex = hex 25 | self.label = label 26 | self.kind = kind 27 | 28 | self.color = NSColor(hex: hex)! 29 | } 30 | } 31 | 32 | func == (lhs: MaterialDesignColor, rhs: MaterialDesignColor) -> Bool { 33 | return lhs.hex == rhs.hex 34 | && lhs.label == rhs.label 35 | && lhs.kind == rhs.kind 36 | } 37 | 38 | struct MaterialDesignColorGroup: Equatable { 39 | let name: String 40 | let colors: [MaterialDesignColor] 41 | 42 | var primaryColor: MaterialDesignColor 43 | 44 | init(name: String, colors: [MaterialDesignColor]) { 45 | self.name = name 46 | self.colors = colors 47 | 48 | if let primaryColor = colors.first(where: { $0.label == "500" }) { 49 | self.primaryColor = primaryColor 50 | } else { 51 | self.primaryColor = colors[0] 52 | } 53 | } 54 | } 55 | 56 | func == (lhs: MaterialDesignColorGroup, rhs: MaterialDesignColorGroup) -> Bool { 57 | return lhs.name == rhs.name 58 | && lhs.colors == rhs.colors 59 | } 60 | 61 | extension MaterialDesignColorGroup { 62 | func color(for arbitraryColor: NSColor) -> MaterialDesignColor? { 63 | guard let srgbColor = arbitraryColor.usingColorSpace(.sRGB) else { 64 | return nil 65 | } 66 | 67 | return colors.first(where: {$0.hex == srgbColor.hex}) 68 | } 69 | } 70 | 71 | extension MaterialDesignColor { 72 | private static let labelAlpha = CGFloat(0.87) 73 | 74 | private static let darkLabelColor = NSColor(hex: 0xffffff, alpha: MaterialDesignColor.labelAlpha) 75 | private static let lightLabelColor = NSColor(hex: 0x000000, alpha: MaterialDesignColor.labelAlpha) 76 | 77 | var labelColor: NSColor? { 78 | switch kind { 79 | case .dark: 80 | return MaterialDesignColor.darkLabelColor 81 | case .light: 82 | return MaterialDesignColor.lightLabelColor 83 | } 84 | } 85 | 86 | static let rippleAlpha = CGFloat(0.20) 87 | 88 | static let darkRippleColor = NSColor(hex: 0xffffff, alpha: rippleAlpha) 89 | static let lightRippleColor = NSColor(hex: 0x000000, alpha: rippleAlpha) 90 | 91 | var rippleColor: NSColor? { 92 | switch kind { 93 | case .dark: 94 | return MaterialDesignColor.darkRippleColor 95 | case .light: 96 | return MaterialDesignColor.lightRippleColor 97 | } 98 | } 99 | } 100 | 101 | // swiftlint:disable colon 102 | struct MaterialDesignPalette { 103 | static let colorGroups = [ 104 | MaterialDesignColorGroup( 105 | name: "Red", 106 | colors: [ 107 | MaterialDesignColor(hex: 0xffebee, label: "50", kind: .light), 108 | MaterialDesignColor(hex: 0xffcdd2, label: "100", kind: .light), 109 | MaterialDesignColor(hex: 0xef9a9a, label: "200", kind: .light), 110 | MaterialDesignColor(hex: 0xe57373, label: "300", kind: .light), 111 | MaterialDesignColor(hex: 0xef5350, label: "400", kind: .dark), 112 | MaterialDesignColor(hex: 0xf44336, label: "500", kind: .dark), 113 | MaterialDesignColor(hex: 0xe53935, label: "600", kind: .dark), 114 | MaterialDesignColor(hex: 0xd32f2f, label: "700", kind: .dark), 115 | MaterialDesignColor(hex: 0xc62828, label: "800", kind: .dark), 116 | MaterialDesignColor(hex: 0xb71c1c, label: "900", kind: .dark), 117 | MaterialDesignColor(hex: 0xff8a80, label: "A100", kind: .light), 118 | MaterialDesignColor(hex: 0xff5252, label: "A200", kind: .dark), 119 | MaterialDesignColor(hex: 0xff1744, label: "A400", kind: .dark), 120 | MaterialDesignColor(hex: 0xd50000, label: "A700", kind: .dark) 121 | ] 122 | ), 123 | MaterialDesignColorGroup( 124 | name: "Pink", 125 | colors: [ 126 | MaterialDesignColor(hex: 0xfce4ec, label: "50", kind: .light), 127 | MaterialDesignColor(hex: 0xf8bbd0, label: "100", kind: .light), 128 | MaterialDesignColor(hex: 0xf48fb1, label: "200", kind: .light), 129 | MaterialDesignColor(hex: 0xf06292, label: "300", kind: .dark), 130 | MaterialDesignColor(hex: 0xec407a, label: "400", kind: .dark), 131 | MaterialDesignColor(hex: 0xe91e63, label: "500", kind: .dark), 132 | MaterialDesignColor(hex: 0xd81b60, label: "600", kind: .dark), 133 | MaterialDesignColor(hex: 0xc2185b, label: "700", kind: .dark), 134 | MaterialDesignColor(hex: 0xad1457, label: "800", kind: .dark), 135 | MaterialDesignColor(hex: 0x880e4f, label: "900", kind: .dark), 136 | MaterialDesignColor(hex: 0xff80ab, label: "A100", kind: .light), 137 | MaterialDesignColor(hex: 0xff4081, label: "A200", kind: .dark), 138 | MaterialDesignColor(hex: 0xf50057, label: "A400", kind: .dark), 139 | MaterialDesignColor(hex: 0xc51162, label: "A700", kind: .dark) 140 | ] 141 | ), 142 | MaterialDesignColorGroup( 143 | name: "Purple", 144 | colors: [ 145 | MaterialDesignColor(hex: 0xf3e5f5, label: "50", kind: .light), 146 | MaterialDesignColor(hex: 0xe1bee7, label: "100", kind: .light), 147 | MaterialDesignColor(hex: 0xce93d8, label: "200", kind: .light), 148 | MaterialDesignColor(hex: 0xba68c8, label: "300", kind: .dark), 149 | MaterialDesignColor(hex: 0xab47bc, label: "400", kind: .dark), 150 | MaterialDesignColor(hex: 0x9c27b0, label: "500", kind: .dark), 151 | MaterialDesignColor(hex: 0x8e24aa, label: "600", kind: .dark), 152 | MaterialDesignColor(hex: 0x7b1fa2, label: "700", kind: .dark), 153 | MaterialDesignColor(hex: 0x6a1b9a, label: "800", kind: .dark), 154 | MaterialDesignColor(hex: 0x4a148c, label: "900", kind: .dark), 155 | MaterialDesignColor(hex: 0xea80fc, label: "A100", kind: .light), 156 | MaterialDesignColor(hex: 0xe040fb, label: "A200", kind: .dark), 157 | MaterialDesignColor(hex: 0xd500f9, label: "A400", kind: .dark), 158 | MaterialDesignColor(hex: 0xaa00ff, label: "A700", kind: .dark) 159 | ] 160 | ), 161 | MaterialDesignColorGroup( 162 | name: "Deep Purple", 163 | colors: [ 164 | MaterialDesignColor(hex: 0xede7f6, label: "50", kind: .light), 165 | MaterialDesignColor(hex: 0xd1c4e9, label: "100", kind: .light), 166 | MaterialDesignColor(hex: 0xb39ddb, label: "200", kind: .light), 167 | MaterialDesignColor(hex: 0x9575cd, label: "300", kind: .dark), 168 | MaterialDesignColor(hex: 0x7e57c2, label: "400", kind: .dark), 169 | MaterialDesignColor(hex: 0x673ab7, label: "500", kind: .dark), 170 | MaterialDesignColor(hex: 0x5e35b1, label: "600", kind: .dark), 171 | MaterialDesignColor(hex: 0x512da8, label: "700", kind: .dark), 172 | MaterialDesignColor(hex: 0x4527a0, label: "800", kind: .dark), 173 | MaterialDesignColor(hex: 0x311b92, label: "900", kind: .dark), 174 | MaterialDesignColor(hex: 0xb388ff, label: "A100", kind: .light), 175 | MaterialDesignColor(hex: 0x7c4dff, label: "A200", kind: .dark), 176 | MaterialDesignColor(hex: 0x651fff, label: "A400", kind: .dark), 177 | MaterialDesignColor(hex: 0x6200ea, label: "A700", kind: .dark) 178 | ] 179 | ), 180 | MaterialDesignColorGroup( 181 | name: "Indigo", 182 | colors: [ 183 | MaterialDesignColor(hex: 0xe8eaf6, label: "50", kind: .light), 184 | MaterialDesignColor(hex: 0xc5cae9, label: "100", kind: .light), 185 | MaterialDesignColor(hex: 0x9fa8da, label: "200", kind: .light), 186 | MaterialDesignColor(hex: 0x7986cb, label: "300", kind: .dark), 187 | MaterialDesignColor(hex: 0x5c6bc0, label: "400", kind: .dark), 188 | MaterialDesignColor(hex: 0x3f51b5, label: "500", kind: .dark), 189 | MaterialDesignColor(hex: 0x3949ab, label: "600", kind: .dark), 190 | MaterialDesignColor(hex: 0x303f9f, label: "700", kind: .dark), 191 | MaterialDesignColor(hex: 0x283593, label: "800", kind: .dark), 192 | MaterialDesignColor(hex: 0x1a237e, label: "900", kind: .dark), 193 | MaterialDesignColor(hex: 0x8c9eff, label: "A100", kind: .light), 194 | MaterialDesignColor(hex: 0x536dfe, label: "A200", kind: .dark), 195 | MaterialDesignColor(hex: 0x3d5afe, label: "A400", kind: .dark), 196 | MaterialDesignColor(hex: 0x304ffe, label: "A700", kind: .dark) 197 | ] 198 | ), 199 | MaterialDesignColorGroup( 200 | name: "Blue", 201 | colors: [ 202 | MaterialDesignColor(hex: 0xe3f2fd, label: "50", kind: .light), 203 | MaterialDesignColor(hex: 0xbbdefb, label: "100", kind: .light), 204 | MaterialDesignColor(hex: 0x90caf9, label: "200", kind: .light), 205 | MaterialDesignColor(hex: 0x64b5f6, label: "300", kind: .light), 206 | MaterialDesignColor(hex: 0x42a5f5, label: "400", kind: .light), 207 | MaterialDesignColor(hex: 0x2196f3, label: "500", kind: .dark), 208 | MaterialDesignColor(hex: 0x1e88e5, label: "600", kind: .dark), 209 | MaterialDesignColor(hex: 0x1976d2, label: "700", kind: .dark), 210 | MaterialDesignColor(hex: 0x1565c0, label: "800", kind: .dark), 211 | MaterialDesignColor(hex: 0x0d47a1, label: "900", kind: .dark), 212 | MaterialDesignColor(hex: 0x82b1ff, label: "A100", kind: .light), 213 | MaterialDesignColor(hex: 0x448aff, label: "A200", kind: .dark), 214 | MaterialDesignColor(hex: 0x2979ff, label: "A400", kind: .dark), 215 | MaterialDesignColor(hex: 0x2962ff, label: "A700", kind: .dark) 216 | ] 217 | ), 218 | MaterialDesignColorGroup( 219 | name: "Light Blue", 220 | colors: [ 221 | MaterialDesignColor(hex: 0xe1f5fe, label: "50", kind: .light), 222 | MaterialDesignColor(hex: 0xb3e5fc, label: "100", kind: .light), 223 | MaterialDesignColor(hex: 0x81d4fa, label: "200", kind: .light), 224 | MaterialDesignColor(hex: 0x4fc3f7, label: "300", kind: .light), 225 | MaterialDesignColor(hex: 0x29b6f6, label: "400", kind: .light), 226 | MaterialDesignColor(hex: 0x03a9f4, label: "500", kind: .light), 227 | MaterialDesignColor(hex: 0x039be5, label: "600", kind: .dark), 228 | MaterialDesignColor(hex: 0x0288d1, label: "700", kind: .dark), 229 | MaterialDesignColor(hex: 0x0277bd, label: "800", kind: .dark), 230 | MaterialDesignColor(hex: 0x01579b, label: "900", kind: .dark), 231 | MaterialDesignColor(hex: 0x80d8ff, label: "A100", kind: .light), 232 | MaterialDesignColor(hex: 0x40c4ff, label: "A200", kind: .light), 233 | MaterialDesignColor(hex: 0x00b0ff, label: "A400", kind: .light), 234 | MaterialDesignColor(hex: 0x0091ea, label: "A700", kind: .dark) 235 | ] 236 | ), 237 | MaterialDesignColorGroup( 238 | name: "Cyan", 239 | colors: [ 240 | MaterialDesignColor(hex: 0xe0f7fa, label: "50", kind: .light), 241 | MaterialDesignColor(hex: 0xb2ebf2, label: "100", kind: .light), 242 | MaterialDesignColor(hex: 0x80deea, label: "200", kind: .light), 243 | MaterialDesignColor(hex: 0x4dd0e1, label: "300", kind: .light), 244 | MaterialDesignColor(hex: 0x26c6da, label: "400", kind: .light), 245 | MaterialDesignColor(hex: 0x00bcd4, label: "500", kind: .light), 246 | MaterialDesignColor(hex: 0x00acc1, label: "600", kind: .light), 247 | MaterialDesignColor(hex: 0x0097a7, label: "700", kind: .dark), 248 | MaterialDesignColor(hex: 0x00838f, label: "800", kind: .dark), 249 | MaterialDesignColor(hex: 0x006064, label: "900", kind: .dark), 250 | MaterialDesignColor(hex: 0x84ffff, label: "A100", kind: .light), 251 | MaterialDesignColor(hex: 0x18ffff, label: "A200", kind: .light), 252 | MaterialDesignColor(hex: 0x00e5ff, label: "A400", kind: .light), 253 | MaterialDesignColor(hex: 0x00b8d4, label: "A700", kind: .light) 254 | ] 255 | ), 256 | MaterialDesignColorGroup( 257 | name: "Teal", 258 | colors: [ 259 | MaterialDesignColor(hex: 0xe0f2f1, label: "50", kind: .light), 260 | MaterialDesignColor(hex: 0xb2dfdb, label: "100", kind: .light), 261 | MaterialDesignColor(hex: 0x80cbc4, label: "200", kind: .light), 262 | MaterialDesignColor(hex: 0x4db6ac, label: "300", kind: .light), 263 | MaterialDesignColor(hex: 0x26a69a, label: "400", kind: .light), 264 | MaterialDesignColor(hex: 0x009688, label: "500", kind: .dark), 265 | MaterialDesignColor(hex: 0x00897b, label: "600", kind: .dark), 266 | MaterialDesignColor(hex: 0x00796b, label: "700", kind: .dark), 267 | MaterialDesignColor(hex: 0x00695c, label: "800", kind: .dark), 268 | MaterialDesignColor(hex: 0x004d40, label: "900", kind: .dark), 269 | MaterialDesignColor(hex: 0xa7ffeb, label: "A100", kind: .light), 270 | MaterialDesignColor(hex: 0x64ffda, label: "A200", kind: .light), 271 | MaterialDesignColor(hex: 0x1de9b6, label: "A400", kind: .light), 272 | MaterialDesignColor(hex: 0x00bfa5, label: "A700", kind: .light) 273 | ] 274 | ), 275 | MaterialDesignColorGroup( 276 | name: "Green", 277 | colors: [ 278 | MaterialDesignColor(hex: 0xe8f5e9, label: "50", kind: .light), 279 | MaterialDesignColor(hex: 0xc8e6c9, label: "100", kind: .light), 280 | MaterialDesignColor(hex: 0xa5d6a7, label: "200", kind: .light), 281 | MaterialDesignColor(hex: 0x81c784, label: "300", kind: .light), 282 | MaterialDesignColor(hex: 0x66bb6a, label: "400", kind: .light), 283 | MaterialDesignColor(hex: 0x4caf50, label: "500", kind: .light), 284 | MaterialDesignColor(hex: 0x43a047, label: "600", kind: .dark), 285 | MaterialDesignColor(hex: 0x388e3c, label: "700", kind: .dark), 286 | MaterialDesignColor(hex: 0x2e7d32, label: "800", kind: .dark), 287 | MaterialDesignColor(hex: 0x1b5e20, label: "900", kind: .dark), 288 | MaterialDesignColor(hex: 0xb9f6ca, label: "A100", kind: .light), 289 | MaterialDesignColor(hex: 0x69f0ae, label: "A200", kind: .light), 290 | MaterialDesignColor(hex: 0x00e676, label: "A400", kind: .light), 291 | MaterialDesignColor(hex: 0x00c853, label: "A700", kind: .light) 292 | ] 293 | ), 294 | MaterialDesignColorGroup( 295 | name: "Light Green", 296 | colors: [ 297 | MaterialDesignColor(hex: 0xf1f8e9, label: "50", kind: .light), 298 | MaterialDesignColor(hex: 0xdcedc8, label: "100", kind: .light), 299 | MaterialDesignColor(hex: 0xc5e1a5, label: "200", kind: .light), 300 | MaterialDesignColor(hex: 0xaed581, label: "300", kind: .light), 301 | MaterialDesignColor(hex: 0x9ccc65, label: "400", kind: .light), 302 | MaterialDesignColor(hex: 0x8bc34a, label: "500", kind: .light), 303 | MaterialDesignColor(hex: 0x7cb342, label: "600", kind: .light), 304 | MaterialDesignColor(hex: 0x689f38, label: "700", kind: .dark), 305 | MaterialDesignColor(hex: 0x558b2f, label: "800", kind: .dark), 306 | MaterialDesignColor(hex: 0x33691e, label: "900", kind: .dark), 307 | MaterialDesignColor(hex: 0xccff90, label: "A100", kind: .light), 308 | MaterialDesignColor(hex: 0xb2ff59, label: "A200", kind: .light), 309 | MaterialDesignColor(hex: 0x76ff03, label: "A400", kind: .light), 310 | MaterialDesignColor(hex: 0x64dd17, label: "A700", kind: .light) 311 | ] 312 | ), 313 | MaterialDesignColorGroup( 314 | name: "Lime", 315 | colors: [ 316 | MaterialDesignColor(hex: 0xf9fbe7, label: "50", kind: .light), 317 | MaterialDesignColor(hex: 0xf0f4c3, label: "100", kind: .light), 318 | MaterialDesignColor(hex: 0xe6ee9c, label: "200", kind: .light), 319 | MaterialDesignColor(hex: 0xdce775, label: "300", kind: .light), 320 | MaterialDesignColor(hex: 0xd4e157, label: "400", kind: .light), 321 | MaterialDesignColor(hex: 0xcddc39, label: "500", kind: .light), 322 | MaterialDesignColor(hex: 0xc0ca33, label: "600", kind: .light), 323 | MaterialDesignColor(hex: 0xafb42b, label: "700", kind: .light), 324 | MaterialDesignColor(hex: 0x9e9d24, label: "800", kind: .light), 325 | MaterialDesignColor(hex: 0x827717, label: "900", kind: .dark), 326 | MaterialDesignColor(hex: 0xf4ff81, label: "A100", kind: .light), 327 | MaterialDesignColor(hex: 0xeeff41, label: "A200", kind: .light), 328 | MaterialDesignColor(hex: 0xc6ff00, label: "A400", kind: .light), 329 | MaterialDesignColor(hex: 0xaeea00, label: "A700", kind: .light) 330 | ] 331 | ), 332 | MaterialDesignColorGroup( 333 | name: "Yellow", 334 | colors: [ 335 | MaterialDesignColor(hex: 0xfffde7, label: "50", kind: .light), 336 | MaterialDesignColor(hex: 0xfff9c4, label: "100", kind: .light), 337 | MaterialDesignColor(hex: 0xfff59d, label: "200", kind: .light), 338 | MaterialDesignColor(hex: 0xfff176, label: "300", kind: .light), 339 | MaterialDesignColor(hex: 0xffee58, label: "400", kind: .light), 340 | MaterialDesignColor(hex: 0xffeb3b, label: "500", kind: .light), 341 | MaterialDesignColor(hex: 0xfdd835, label: "600", kind: .light), 342 | MaterialDesignColor(hex: 0xfbc02d, label: "700", kind: .light), 343 | MaterialDesignColor(hex: 0xf9a825, label: "800", kind: .light), 344 | MaterialDesignColor(hex: 0xf57f17, label: "900", kind: .light), 345 | MaterialDesignColor(hex: 0xffff8d, label: "A100", kind: .light), 346 | MaterialDesignColor(hex: 0xffff00, label: "A200", kind: .light), 347 | MaterialDesignColor(hex: 0xffea00, label: "A400", kind: .light), 348 | MaterialDesignColor(hex: 0xffd600, label: "A700", kind: .light) 349 | ] 350 | ), 351 | MaterialDesignColorGroup( 352 | name: "Amber", 353 | colors: [ 354 | MaterialDesignColor(hex: 0xfff8e1, label: "50", kind: .light), 355 | MaterialDesignColor(hex: 0xffecb3, label: "100", kind: .light), 356 | MaterialDesignColor(hex: 0xffe082, label: "200", kind: .light), 357 | MaterialDesignColor(hex: 0xffd54f, label: "300", kind: .light), 358 | MaterialDesignColor(hex: 0xffca28, label: "400", kind: .light), 359 | MaterialDesignColor(hex: 0xffc107, label: "500", kind: .light), 360 | MaterialDesignColor(hex: 0xffb300, label: "600", kind: .light), 361 | MaterialDesignColor(hex: 0xffa000, label: "700", kind: .light), 362 | MaterialDesignColor(hex: 0xff8f00, label: "800", kind: .light), 363 | MaterialDesignColor(hex: 0xff6f00, label: "900", kind: .light), 364 | MaterialDesignColor(hex: 0xffe57f, label: "A100", kind: .light), 365 | MaterialDesignColor(hex: 0xffd740, label: "A200", kind: .light), 366 | MaterialDesignColor(hex: 0xffc400, label: "A400", kind: .light), 367 | MaterialDesignColor(hex: 0xffab00, label: "A700", kind: .light) 368 | ] 369 | ), 370 | MaterialDesignColorGroup( 371 | name: "Orange", 372 | colors: [ 373 | MaterialDesignColor(hex: 0xfff3e0, label: "50", kind: .light), 374 | MaterialDesignColor(hex: 0xffe0b2, label: "100", kind: .light), 375 | MaterialDesignColor(hex: 0xffcc80, label: "200", kind: .light), 376 | MaterialDesignColor(hex: 0xffb74d, label: "300", kind: .light), 377 | MaterialDesignColor(hex: 0xffa726, label: "400", kind: .light), 378 | MaterialDesignColor(hex: 0xff9800, label: "500", kind: .light), 379 | MaterialDesignColor(hex: 0xfb8c00, label: "600", kind: .light), 380 | MaterialDesignColor(hex: 0xf57c00, label: "700", kind: .light), 381 | MaterialDesignColor(hex: 0xef6c00, label: "800", kind: .dark), 382 | MaterialDesignColor(hex: 0xe65100, label: "900", kind: .dark), 383 | MaterialDesignColor(hex: 0xffd180, label: "A100", kind: .light), 384 | MaterialDesignColor(hex: 0xffab40, label: "A200", kind: .light), 385 | MaterialDesignColor(hex: 0xff9100, label: "A400", kind: .light), 386 | MaterialDesignColor(hex: 0xff6d00, label: "A700", kind: .light) 387 | ] 388 | ), 389 | MaterialDesignColorGroup( 390 | name: "Deep Orange", 391 | colors: [ 392 | MaterialDesignColor(hex: 0xfbe9e7, label: "50", kind: .light), 393 | MaterialDesignColor(hex: 0xffccbc, label: "100", kind: .light), 394 | MaterialDesignColor(hex: 0xffab91, label: "200", kind: .light), 395 | MaterialDesignColor(hex: 0xff8a65, label: "300", kind: .light), 396 | MaterialDesignColor(hex: 0xff7043, label: "400", kind: .light), 397 | MaterialDesignColor(hex: 0xff5722, label: "500", kind: .dark), 398 | MaterialDesignColor(hex: 0xf4511e, label: "600", kind: .dark), 399 | MaterialDesignColor(hex: 0xe64a19, label: "700", kind: .dark), 400 | MaterialDesignColor(hex: 0xd84315, label: "800", kind: .dark), 401 | MaterialDesignColor(hex: 0xbf360c, label: "900", kind: .dark), 402 | MaterialDesignColor(hex: 0xff9e80, label: "A100", kind: .light), 403 | MaterialDesignColor(hex: 0xff6e40, label: "A200", kind: .light), 404 | MaterialDesignColor(hex: 0xff3d00, label: "A400", kind: .dark), 405 | MaterialDesignColor(hex: 0xdd2c00, label: "A700", kind: .dark) 406 | ] 407 | ), 408 | MaterialDesignColorGroup( 409 | name: "Brown", 410 | colors: [ 411 | MaterialDesignColor(hex: 0xefebe9, label: "50", kind: .light), 412 | MaterialDesignColor(hex: 0xd7ccc8, label: "100", kind: .light), 413 | MaterialDesignColor(hex: 0xbcaaa4, label: "200", kind: .light), 414 | MaterialDesignColor(hex: 0xa1887f, label: "300", kind: .dark), 415 | MaterialDesignColor(hex: 0x8d6e63, label: "400", kind: .dark), 416 | MaterialDesignColor(hex: 0x795548, label: "500", kind: .dark), 417 | MaterialDesignColor(hex: 0x6d4c41, label: "600", kind: .dark), 418 | MaterialDesignColor(hex: 0x5d4037, label: "700", kind: .dark), 419 | MaterialDesignColor(hex: 0x4e342e, label: "800", kind: .dark), 420 | MaterialDesignColor(hex: 0x3e2723, label: "900", kind: .dark) 421 | ] 422 | ), 423 | MaterialDesignColorGroup( 424 | name: "Grey", 425 | colors: [ 426 | MaterialDesignColor(hex: 0xfafafa, label: "50", kind: .light), 427 | MaterialDesignColor(hex: 0xf5f5f5, label: "100", kind: .light), 428 | MaterialDesignColor(hex: 0xeeeeee, label: "200", kind: .light), 429 | MaterialDesignColor(hex: 0xe0e0e0, label: "300", kind: .light), 430 | MaterialDesignColor(hex: 0xbdbdbd, label: "400", kind: .light), 431 | MaterialDesignColor(hex: 0x9e9e9e, label: "500", kind: .light), 432 | MaterialDesignColor(hex: 0x757575, label: "600", kind: .dark), 433 | MaterialDesignColor(hex: 0x616161, label: "700", kind: .dark), 434 | MaterialDesignColor(hex: 0x424242, label: "800", kind: .dark), 435 | MaterialDesignColor(hex: 0x212121, label: "900", kind: .dark) 436 | ] 437 | ), 438 | MaterialDesignColorGroup( 439 | name: "Blue Grey", 440 | colors: [ 441 | MaterialDesignColor(hex: 0xeceff1, label: "50", kind: .light), 442 | MaterialDesignColor(hex: 0xcfd8dc, label: "100", kind: .light), 443 | MaterialDesignColor(hex: 0xb0bec5, label: "200", kind: .light), 444 | MaterialDesignColor(hex: 0x90a4ae, label: "300", kind: .light), 445 | MaterialDesignColor(hex: 0x78909c, label: "400", kind: .dark), 446 | MaterialDesignColor(hex: 0x607d8b, label: "500", kind: .dark), 447 | MaterialDesignColor(hex: 0x546e7a, label: "600", kind: .dark), 448 | MaterialDesignColor(hex: 0x455a64, label: "700", kind: .dark), 449 | MaterialDesignColor(hex: 0x37474f, label: "800", kind: .dark), 450 | MaterialDesignColor(hex: 0x263238, label: "900", kind: .dark) 451 | ] 452 | ), 453 | MaterialDesignColorGroup( 454 | name: "Black", 455 | colors: [ 456 | MaterialDesignColor(hex: 0x000000, label: "Black", kind: .dark), 457 | MaterialDesignColor(hex: 0xffffff, label: "White", kind: .light) 458 | ] 459 | ) 460 | ] 461 | } 462 | 463 | extension MaterialDesignPalette { 464 | static func colorGroup(for arbitraryColor: NSColor) -> MaterialDesignColorGroup? { 465 | guard let srgbColor = arbitraryColor.usingColorSpace(.sRGB) else { 466 | return nil 467 | } 468 | 469 | for colorGroup in MaterialDesignPalette.colorGroups { 470 | if colorGroup.colors.first(where: {$0.hex == srgbColor.hex}) != nil { 471 | return colorGroup 472 | } 473 | } 474 | return nil 475 | } 476 | } 477 | -------------------------------------------------------------------------------- /MaterialDesignColorPicker/MaterialDesignColorPaletteView.swift: -------------------------------------------------------------------------------- 1 | // 2 | // MaterialDesignColorPaletteView.swift 3 | // MaterialDesignColorPicker 4 | // 5 | // Created by John Yanarella on 1/21/17. 6 | // Copyright © 2017-2020 John Yanarella. 7 | // 8 | 9 | import Cocoa 10 | 11 | protocol MaterialDesignColorPaletteViewDelegate: class { 12 | func didSelect(_ colorPaletteView: MaterialDesignColorPaletteView, colorGroup: MaterialDesignColorGroup, at: NSPoint) 13 | } 14 | 15 | class MaterialDesignColorPaletteView: NSView { 16 | weak var delegate: MaterialDesignColorPaletteViewDelegate? 17 | 18 | override var isFlipped: Bool { 19 | return true 20 | } 21 | 22 | override var isOpaque: Bool { 23 | return true 24 | } 25 | 26 | private static let rowCount = 2 27 | 28 | private var cellCount: Int { 29 | return MaterialDesignPalette.colorGroups.count 30 | } 31 | 32 | private var cellCountPerRow: Int { 33 | return Int(ceil(Double(cellCount) / Double(MaterialDesignColorPaletteView.rowCount))) 34 | } 35 | 36 | private var cellWidth: CGFloat { 37 | return bounds.width / CGFloat(cellCountPerRow) 38 | } 39 | 40 | private var cellHeight: CGFloat { 41 | return cellWidth 42 | } 43 | 44 | var selectedColorGroup: MaterialDesignColorGroup? { 45 | didSet { 46 | if oldValue != selectedColorGroup { 47 | needsDisplay = true 48 | } 49 | } 50 | } 51 | 52 | override init(frame: NSRect) { 53 | super.init(frame: frame) 54 | 55 | initialize() 56 | } 57 | 58 | required init?(coder aDecoder: NSCoder) { 59 | super.init(coder: aDecoder) 60 | 61 | initialize() 62 | } 63 | 64 | private func initialize() { 65 | wantsLayer = true 66 | layerContentsRedrawPolicy = .duringViewResize 67 | } 68 | 69 | override func draw(_ dirtyRect: NSRect) { 70 | let cellSize = CGSize(width: cellWidth, height: cellHeight) 71 | for (colorIndex, colorGroup) in MaterialDesignPalette.colorGroups.enumerated() { 72 | let cellRow = Int(floor(Double(colorIndex) / Double(cellCountPerRow))) 73 | let cellColumn = colorIndex % cellCountPerRow 74 | 75 | let cellOrigin = CGPoint(x: cellWidth * CGFloat(cellColumn), y: cellHeight * CGFloat(cellRow)) 76 | 77 | let cellFrame = NSRect(origin: cellOrigin, size: cellSize) 78 | let cellColor = colorGroup.primaryColor.color 79 | let isSelected = (selectedColorGroup == colorGroup) 80 | 81 | drawPaletteCell(frame: cellFrame, fillColor: cellColor, isSelected: isSelected) 82 | } 83 | } 84 | 85 | func drawPaletteCell(frame: NSRect, fillColor: NSColor, isSelected: Bool = false) { 86 | NSGraphicsContext.saveGraphicsState() 87 | 88 | let path = NSBezierPath(rect: frame) 89 | 90 | fillColor.set() 91 | path.fill() 92 | 93 | if isSelected { 94 | let strokeWidth = CGFloat(2.0) 95 | let strokePath = NSBezierPath(rect: frame.insetBy(dx: strokeWidth - 1.0, dy: strokeWidth - 1.0)) 96 | let strokeColor = NSColor.white 97 | 98 | strokeColor.set() 99 | strokePath.lineWidth = strokeWidth 100 | strokePath.stroke() 101 | } 102 | 103 | NSGraphicsContext.restoreGraphicsState() 104 | } 105 | 106 | func colorGroup(at point: NSPoint) -> MaterialDesignColorGroup { 107 | let column = Int(floor(point.x / cellWidth)) 108 | let row = Int(floor(point.y / cellHeight)) 109 | let colorGroupIndex = (row * cellCountPerRow) + column 110 | 111 | return MaterialDesignPalette.colorGroups[colorGroupIndex] 112 | } 113 | 114 | override func acceptsFirstMouse(for event: NSEvent?) -> Bool { 115 | return true 116 | } 117 | 118 | override func mouseDown(with event: NSEvent) { 119 | super.mouseDown(with: event) 120 | 121 | let mouseDownPoint = convert(event.locationInWindow, from: nil) 122 | let colorGroupAtPoint = colorGroup(at: mouseDownPoint) 123 | selectedColorGroup = colorGroupAtPoint 124 | delegate?.didSelect(self, colorGroup: colorGroupAtPoint, at: event.locationInWindow) 125 | } 126 | } 127 | -------------------------------------------------------------------------------- /MaterialDesignColorPicker/MaterialDesignColorPicker.swift: -------------------------------------------------------------------------------- 1 | // 2 | // MaterialDesignColorPicker.swift 3 | // MaterialDesignColorPicker 4 | // 5 | // Created by John Yanarella on 1/7/17. 6 | // Copyright © 2017-2020 John Yanarella. 7 | // 8 | 9 | import Cocoa 10 | 11 | func log(_ message: String) { 12 | NSLog("MaterialDesignColorPicker - \(message)") 13 | } 14 | 15 | public final class MaterialDesignColorPicker: NSColorPicker { 16 | private static let backgroundColor = NSColor.windowBackgroundColor 17 | 18 | fileprivate static let swatchCollectionViewHeaderIdentifier = NSUserInterfaceItemIdentifier(rawValue: "MaterialDesignColorSwatchCollectionViewHeaderView") 19 | fileprivate static let swatchCollectionViewItemIdentifier = NSUserInterfaceItemIdentifier(rawValue: "MaterialDesignColorSwatchCollectionViewItem") 20 | 21 | @IBOutlet fileprivate var view: NSView! { 22 | didSet { 23 | view.wantsLayer = true 24 | view.layer?.backgroundColor = MaterialDesignColorPicker.backgroundColor.cgColor 25 | } 26 | } 27 | 28 | @IBOutlet fileprivate weak var paletteView: MaterialDesignColorPaletteView! { 29 | didSet { 30 | paletteView.delegate = self 31 | paletteView.selectedColorGroup = selectedColorGroup 32 | } 33 | } 34 | 35 | @IBOutlet fileprivate weak var scrollView: NSScrollView! { 36 | didSet { 37 | scrollView.wantsLayer = true 38 | scrollView.layer?.backgroundColor = MaterialDesignColorPicker.backgroundColor.cgColor 39 | } 40 | } 41 | 42 | @IBOutlet fileprivate weak var swatchCollectionView: NSCollectionView! { 43 | didSet { 44 | swatchCollectionView.wantsLayer = true 45 | swatchCollectionView.layer?.backgroundColor = MaterialDesignColorPicker.backgroundColor.cgColor 46 | 47 | swatchCollectionView.backgroundColors = [MaterialDesignColorPicker.backgroundColor] 48 | 49 | swatchCollectionView.delegate = self 50 | swatchCollectionView.dataSource = self 51 | 52 | let headerNib = NSNib(nibNamed: "MaterialDesignColorSwatchCollectionViewHeaderView", bundle: bundle) 53 | swatchCollectionView.register(headerNib, forSupplementaryViewOfKind: NSCollectionView.elementKindSectionHeader, withIdentifier: MaterialDesignColorPicker.swatchCollectionViewHeaderIdentifier) 54 | 55 | let itemNib = NSNib(nibNamed: "MaterialDesignColorSwatchCollectionViewItem", bundle: bundle) 56 | swatchCollectionView.register(itemNib, forItemWithIdentifier: MaterialDesignColorPicker.swatchCollectionViewItemIdentifier) 57 | } 58 | } 59 | 60 | fileprivate let bundle = Bundle(for: MaterialDesignColorPicker.self) 61 | 62 | fileprivate var selectedColorGroup: MaterialDesignColorGroup = MaterialDesignPalette.colorGroups[0] 63 | 64 | fileprivate var loadedColorGroup: MaterialDesignColorGroup = MaterialDesignPalette.colorGroups[0] 65 | 66 | fileprivate var selectedColor: MaterialDesignColor? 67 | 68 | fileprivate var initialColorSet: Bool = false 69 | 70 | fileprivate var initialSizeSet: Bool = false 71 | 72 | public override init() { 73 | super.init() 74 | } 75 | 76 | public required init?(pickerMask mask: Int, colorPanel owningColorPanel: NSColorPanel) { 77 | let version = bundle.object(forInfoDictionaryKey: "CFBundleShortVersionString")! 78 | let hostAppKitVersion = NSVersionOfLinkTimeLibrary("AppKit") >> 16 79 | log("Version: \(version) - Host App Linked SDK: \(hostAppKitVersion)") 80 | 81 | super.init(pickerMask: mask, colorPanel: owningColorPanel) 82 | } 83 | 84 | public override var provideNewButtonImage: NSImage { 85 | let icon = bundle.image(forResource: "ButtonImage")! 86 | return icon 87 | } 88 | 89 | public override var buttonToolTip: String { 90 | return NSLocalizedString("Material Design", comment: "Tooltip for the Material Design color picker button in the color panel") 91 | } 92 | 93 | public override func viewSizeChanged(_ sender: Any?) { 94 | super.viewSizeChanged(sender) 95 | 96 | if swatchCollectionView != nil { 97 | if !initialSizeSet { 98 | DispatchQueue.main.async { 99 | self.swatchCollectionView.reloadData() 100 | } 101 | initialSizeSet = true 102 | } else { 103 | swatchCollectionView.collectionViewLayout?.invalidateLayout() 104 | } 105 | } 106 | } 107 | 108 | public override var minContentSize: NSSize { 109 | return NSSize(width: 280, height: 448) 110 | } 111 | 112 | fileprivate func loadFonts() { 113 | let paths = bundle.paths(forResourcesOfType: "ttf", inDirectory: "Fonts") 114 | for path in paths { 115 | let url = NSURL(fileURLWithPath: path as String) 116 | 117 | var errorRef: Unmanaged? 118 | CTFontManagerRegisterFontsForURL(url, .process, &errorRef) 119 | } 120 | } 121 | 122 | fileprivate func loadView() { 123 | guard bundle.loadNibNamed("MaterialDesignColorPicker", owner: self, topLevelObjects: nil) else { 124 | fatalError() 125 | } 126 | } 127 | 128 | fileprivate func load(colorGroup: MaterialDesignColorGroup) { 129 | loadedColorGroup = colorGroup 130 | swatchCollectionView.reloadData() 131 | updateSelection() 132 | } 133 | 134 | fileprivate func select(colorGroup: MaterialDesignColorGroup, at locationInWindow: NSPoint, animated: Bool) { 135 | if selectedColorGroup != colorGroup { 136 | selectedColorGroup = colorGroup 137 | paletteView.selectedColorGroup = colorGroup 138 | 139 | if animated { 140 | let rippleColor = colorGroup.primaryColor.color 141 | let startingPoint = scrollView.convert(locationInWindow, from: nil) 142 | scrollView.ripple(color: rippleColor, from: startingPoint, transition: { 143 | self.load(colorGroup: colorGroup) 144 | }) 145 | } else { 146 | load(colorGroup: colorGroup) 147 | } 148 | } 149 | } 150 | 151 | fileprivate func select(color: MaterialDesignColor?) { 152 | selectedColor = color 153 | updateSelection() 154 | } 155 | 156 | fileprivate func apply(color: MaterialDesignColor) { 157 | let transparentColor = color.color.withAlphaComponent(colorPanel.alpha) 158 | log("Applying color: \(transparentColor.debugDescription)") 159 | colorPanel.color = transparentColor 160 | } 161 | 162 | fileprivate func updateSelection() { 163 | swatchCollectionView.deselectItems(at: swatchCollectionView.selectionIndexPaths) 164 | if let selectedColor = selectedColor, let itemIndex = loadedColorGroup.colors.firstIndex(of: selectedColor) { 165 | let indexPath = IndexPath(item: itemIndex, section: 0) 166 | swatchCollectionView.selectItems(at: [indexPath], scrollPosition: .nearestHorizontalEdge) 167 | } 168 | } 169 | } 170 | 171 | // MARK: - NSColorPickingCustom 172 | extension MaterialDesignColorPicker: NSColorPickingCustom { 173 | public func supportsMode(_ mode: NSColorPanel.Mode) -> Bool { 174 | return (mode == .RGB) 175 | } 176 | 177 | public func currentMode() -> NSColorPanel.Mode { 178 | return .RGB 179 | } 180 | 181 | public func provideNewView(_ initialRequest: Bool) -> NSView { 182 | if initialRequest { 183 | loadFonts() 184 | loadView() 185 | } 186 | return view 187 | } 188 | 189 | public func setColor(_ newColor: NSColor) { 190 | log("Received color: \(newColor.debugDescription)") 191 | let opaqueColor = newColor.withAlphaComponent(1.0) 192 | if let colorGroup = MaterialDesignPalette.colorGroup(for: opaqueColor) { 193 | let startingLocation = colorPanel.showsAlpha ? NSPoint(x: 24.0, y: 76.0) : NSPoint(x: 24.0, y: 24.0) 194 | select(colorGroup: colorGroup, at: startingLocation, animated: initialColorSet) 195 | select(color: colorGroup.color(for: opaqueColor)) 196 | } else { 197 | select(color: selectedColor) 198 | } 199 | initialColorSet = true 200 | } 201 | } 202 | 203 | // MARK: - MaterialDesignColorPaletteViewDelegate 204 | extension MaterialDesignColorPicker: MaterialDesignColorPaletteViewDelegate { 205 | func didSelect(_ colorPaletteView: MaterialDesignColorPaletteView, colorGroup: MaterialDesignColorGroup, at locationInWindow: NSPoint) { 206 | select(colorGroup: colorGroup, at: locationInWindow, animated: true) 207 | select(color: colorGroup.primaryColor) 208 | apply(color: colorGroup.primaryColor) 209 | } 210 | } 211 | 212 | // MARK: - NSCollectionViewDelegate 213 | extension MaterialDesignColorPicker: NSCollectionViewDelegate { 214 | public func collectionView(_ collectionView: NSCollectionView, didSelectItemsAt indexPaths: Set) { 215 | guard let indexPath = indexPaths.first else { 216 | return 217 | } 218 | 219 | let color = loadedColorGroup.colors[indexPath.item] 220 | select(color: color) 221 | apply(color: color) 222 | } 223 | } 224 | 225 | // MARK: - NSCollectionViewDelegateFlowLayout 226 | extension MaterialDesignColorPicker: NSCollectionViewDelegateFlowLayout { 227 | public func collectionView(_ collectionView: NSCollectionView, layout collectionViewLayout: NSCollectionViewLayout, sizeForItemAt indexPath: IndexPath) -> NSSize { 228 | return NSSize(width: collectionView.bounds.width, height: 32.0) 229 | } 230 | 231 | public func collectionView(_ collectionView: NSCollectionView, layout collectionViewLayout: NSCollectionViewLayout, minimumLineSpacingForSectionAt section: Int) -> CGFloat { 232 | return 0 233 | } 234 | 235 | public func collectionView(_ collectionView: NSCollectionView, layout collectionViewLayout: NSCollectionViewLayout, minimumInteritemSpacingForSectionAt section: Int) -> CGFloat { 236 | return 0 237 | } 238 | 239 | public func collectionView(_ collectionView: NSCollectionView, layout collectionViewLayout: NSCollectionViewLayout, insetForSectionAt section: Int) -> NSEdgeInsets { 240 | return NSEdgeInsets(top: 0, left: 0, bottom: 0, right: 0) 241 | } 242 | 243 | public func collectionView(_ collectionView: NSCollectionView, layout collectionViewLayout: NSCollectionViewLayout, referenceSizeForHeaderInSection section: Int) -> NSSize { 244 | return loadedColorGroup.colors.count >= 10 ? NSSize(width: collectionView.bounds.width, height: 72.0) : .zero 245 | } 246 | } 247 | 248 | // MARK: - NSCollectionViewDataSource 249 | extension MaterialDesignColorPicker: NSCollectionViewDataSource { 250 | public func numberOfSections(in collectionView: NSCollectionView) -> Int { 251 | return 1 252 | } 253 | 254 | public func collectionView(_ collectionView: NSCollectionView, numberOfItemsInSection section: Int) -> Int { 255 | return loadedColorGroup.colors.count 256 | } 257 | 258 | public func collectionView(_ collectionView: NSCollectionView, itemForRepresentedObjectAt indexPath: IndexPath) -> NSCollectionViewItem { 259 | let item = collectionView.makeItem(withIdentifier: MaterialDesignColorPicker.swatchCollectionViewItemIdentifier, for: indexPath as IndexPath) 260 | 261 | guard let collectionViewItem = item as? MaterialDesignColorSwatchCollectionViewItem else { 262 | return item 263 | } 264 | 265 | let color = loadedColorGroup.colors[indexPath.item] 266 | collectionViewItem.color = color 267 | 268 | return item 269 | } 270 | 271 | public func collectionView(_ collectionView: NSCollectionView, viewForSupplementaryElementOfKind kind: String, at indexPath: IndexPath) -> NSView { 272 | let view = swatchCollectionView.makeSupplementaryView(ofKind: NSCollectionView.elementKindSectionHeader, withIdentifier: MaterialDesignColorPicker.swatchCollectionViewHeaderIdentifier, for: indexPath) 273 | 274 | guard let collectionViewSection = view as? MaterialDesignColorSwatchCollectionViewHeaderView else { 275 | return view 276 | } 277 | 278 | collectionViewSection.colorGroup = loadedColorGroup 279 | 280 | return view 281 | } 282 | } 283 | -------------------------------------------------------------------------------- /MaterialDesignColorPicker/MaterialDesignColorPicker.xib: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | -------------------------------------------------------------------------------- /MaterialDesignColorPicker/MaterialDesignColorSwatchCollectionViewHeaderView.swift: -------------------------------------------------------------------------------- 1 | // 2 | // MaterialDesignColorSwatchCollectionViewHeaderView.swift 3 | // MaterialDesignColorPicker 4 | // 5 | // Created by John Yanarella on 2/5/17. 6 | // Copyright © 2017-2020 John Yanarella. 7 | // 8 | 9 | import Cocoa 10 | 11 | class MaterialDesignColorSwatchCollectionViewHeaderView: NSView { 12 | @IBOutlet fileprivate weak var nameLabel: NSTextField! 13 | 14 | override init(frame: NSRect) { 15 | super.init(frame: frame) 16 | 17 | initialize() 18 | } 19 | 20 | required init?(coder aDecoder: NSCoder) { 21 | super.init(coder: aDecoder) 22 | 23 | initialize() 24 | } 25 | 26 | private func initialize() { 27 | wantsLayer = true 28 | layerContentsRedrawPolicy = .duringViewResize 29 | } 30 | 31 | var colorGroup: MaterialDesignColorGroup? { 32 | didSet { 33 | guard let colorGroup = colorGroup else { 34 | return 35 | } 36 | 37 | let color = colorGroup.primaryColor 38 | 39 | nameLabel.stringValue = colorGroup.name 40 | nameLabel.textColor = color.labelColor 41 | 42 | layer?.backgroundColor = color.color.cgColor 43 | } 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /MaterialDesignColorPicker/MaterialDesignColorSwatchCollectionViewHeaderView.xib: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | -------------------------------------------------------------------------------- /MaterialDesignColorPicker/MaterialDesignColorSwatchCollectionViewItem.swift: -------------------------------------------------------------------------------- 1 | // 2 | // MaterialDesignColorSwatchCollectionViewItem.swift 3 | // MaterialDesignColorPicker 4 | // 5 | // Created by John Yanarella on 1/28/17. 6 | // Copyright © 2017-2020 John Yanarella. 7 | // 8 | 9 | import Cocoa 10 | 11 | class MaterialDesignColorSwatchCollectionViewItem: NSCollectionViewItem { 12 | @IBOutlet fileprivate weak var label: NSTextField! 13 | @IBOutlet fileprivate weak var hexLabel: NSTextField! 14 | @IBOutlet fileprivate weak var selectionIndicator: NSView! 15 | 16 | var color: MaterialDesignColor? { 17 | didSet { 18 | guard isViewLoaded else { 19 | return 20 | } 21 | guard let color = color else { 22 | return 23 | } 24 | guard let view = view as? RippleView else { 25 | return 26 | } 27 | 28 | label.stringValue = color.label 29 | label.textColor = color.labelColor 30 | 31 | hexLabel.stringValue = String(format: "#%06x", color.hex).uppercased() 32 | hexLabel.textColor = color.labelColor 33 | 34 | selectionIndicator.wantsLayer = true 35 | selectionIndicator.layer?.backgroundColor = color.labelColor?.cgColor 36 | 37 | view.wantsLayer = true 38 | view.layer?.backgroundColor = color.color.cgColor 39 | view.rippleColor = color.rippleColor 40 | } 41 | } 42 | 43 | override var isSelected: Bool { 44 | didSet { 45 | selectionIndicator.isHidden = !isSelected 46 | } 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /MaterialDesignColorPicker/MaterialDesignColorSwatchCollectionViewItem.xib: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 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 | -------------------------------------------------------------------------------- /MaterialDesignColorPicker/MaterialDesignEasingCurves.swift: -------------------------------------------------------------------------------- 1 | // 2 | // MaterialDesignEasingCurves.swift 3 | // MaterialDesignColorPicker 4 | // 5 | // Created by John Yanarella on 1/21/17. 6 | // Copyright © 2017-2020 John Yanarella. 7 | // 8 | 9 | import Cocoa 10 | 11 | struct MaterialDesignEasingCurves { 12 | static let fastOutSlowIn = CAMediaTimingFunction(controlPoints: 0.4, 0.0, 0.2, 1.0) 13 | static let linearOutSlow = CAMediaTimingFunction(controlPoints: 0.0, 0.0, 0.2, 1.0) 14 | static let fastOutLinearIn = CAMediaTimingFunction(controlPoints: 0.4, 0.0, 1.0, 1.0) 15 | } 16 | -------------------------------------------------------------------------------- /MaterialDesignColorPicker/NSBezierPath+cgPath.swift: -------------------------------------------------------------------------------- 1 | // 2 | // NSBezierPath+cgPath.swift 3 | // MaterialDesignColorPicker 4 | // 5 | // Created by John Yanarella on 1/21/17. 6 | // Copyright © 2017-2020 John Yanarella. 7 | // 8 | 9 | import Cocoa 10 | 11 | public extension NSBezierPath { 12 | var cgPath: CGPath { 13 | let path = CGMutablePath() 14 | var points = [CGPoint](repeating: .zero, count: 3) 15 | for index in 0 ..< self.elementCount { 16 | let type = self.element(at: index, associatedPoints: &points) 17 | switch type { 18 | case .moveTo: 19 | path.move( 20 | to: CGPoint(x: points[0].x, y: points[0].y) 21 | ) 22 | case .lineTo: 23 | path.addLine( 24 | to: CGPoint(x: points[0].x, y: points[0].y) 25 | ) 26 | case .curveTo: 27 | path.addCurve( 28 | to: CGPoint(x: points[2].x, y: points[2].y), 29 | control1: CGPoint(x: points[0].x, y: points[0].y), 30 | control2: CGPoint(x: points[1].x, y: points[1].y) 31 | ) 32 | case .closePath: 33 | path.closeSubpath() 34 | @unknown default: 35 | break 36 | } 37 | } 38 | return path 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /MaterialDesignColorPicker/NSColor+hex.swift: -------------------------------------------------------------------------------- 1 | // 2 | // NSColor+hex.swift 3 | // MaterialDesignColorPicker 4 | // 5 | // Created by John Yanarella on 1/8/17. 6 | // Copyright © 2017-2020 John Yanarella. 7 | // 8 | 9 | import Cocoa 10 | 11 | public extension NSColor { 12 | convenience init?(hex: UInt, alpha: CGFloat) { 13 | // swiftlint:disable colon 14 | self.init(srgbRed: CGFloat( (hex & 0xFF0000) >> 16 ) / 255.0, 15 | green: CGFloat( (hex & 0x00FF00) >> 8 ) / 255.0, 16 | blue: CGFloat( (hex & 0x0000FF) >> 0 ) / 255.0, 17 | alpha: alpha) 18 | } 19 | 20 | convenience init?(hex: UInt) { 21 | self.init(hex: hex, alpha: 1.0) 22 | } 23 | 24 | convenience init?(hexString: String, alpha: CGFloat) { 25 | var hexString = hexString.replacingOccurrences(of: "#", with: "") 26 | if hexString.count == 3 { 27 | hexString = hexString.reduce("") { (result, character) -> String in 28 | return result + String(character) + String(character) 29 | } 30 | } 31 | 32 | guard hexString.count == 6 else { 33 | return nil 34 | } 35 | guard let hex = UInt(hexString, radix: 16) else { 36 | return nil 37 | } 38 | 39 | self.init(hex: hex, alpha: alpha) 40 | } 41 | 42 | convenience init?(hexString: String) { 43 | self.init(hexString: hexString, alpha: 1.0) 44 | } 45 | 46 | var hex: UInt? { 47 | guard numberOfComponents == 4 else { 48 | return nil 49 | } 50 | 51 | let red = UInt(round(redComponent * 255)) 52 | let green = UInt(round(greenComponent * 255)) 53 | let blue = UInt(round(blueComponent * 255)) 54 | 55 | return red << 16 | green << 8 | blue 56 | } 57 | 58 | var hexString: String? { 59 | guard let hex = hex else { 60 | return nil 61 | } 62 | 63 | return String(format: "#%06x", hex) 64 | } 65 | } 66 | -------------------------------------------------------------------------------- /MaterialDesignColorPicker/NSView+ripple.swift: -------------------------------------------------------------------------------- 1 | // 2 | // NSView+ripple.swift 3 | // MaterialDesignColorPicker 4 | // 5 | // Created by John Yanarella on 1/21/17. 6 | // Copyright © 2017-2020 John Yanarella. 7 | // 8 | 9 | import Cocoa 10 | 11 | extension NSView { 12 | func ripple(color: NSColor, from: CGPoint, transition: (() -> Void)? = nil, completion: (() -> Void)? = nil) { 13 | guard let layer = layer else { 14 | return 15 | } 16 | 17 | let rippleLayer = RippleLayer() 18 | rippleLayer.zPosition = .greatestFiniteMagnitude 19 | layer.addSublayer(rippleLayer) 20 | 21 | rippleLayer.ripple(color: color.cgColor, from: from, bounds: bounds, transition: transition, completion: completion) 22 | } 23 | } 24 | 25 | private func CGPointDistance(from: CGPoint, to: CGPoint) -> CGFloat { 26 | return hypot(from.x - to.x, from.y - to.y) 27 | } 28 | 29 | private class RippleLayer: CAShapeLayer { 30 | private func calculateRippleRadius(from: CGPoint, bounds: CGRect) -> CGFloat { 31 | return max( 32 | CGPointDistance(from: from, to: CGPoint(x: bounds.minX, y: bounds.minY)), 33 | CGPointDistance(from: from, to: CGPoint(x: bounds.maxX, y: bounds.minY)), 34 | CGPointDistance(from: from, to: CGPoint(x: bounds.maxX, y: bounds.maxY)), 35 | CGPointDistance(from: from, to: CGPoint(x: bounds.minX, y: bounds.maxY)) 36 | ) 37 | } 38 | 39 | fileprivate func ripple(color: CGColor, from: CGPoint, bounds: CGRect, transition: (() -> Void)?, completion: (() -> Void)?) { 40 | let radius = calculateRippleRadius(from: from, bounds: bounds) 41 | 42 | let circlePath = NSBezierPath() 43 | circlePath.appendArc(withCenter: CGPoint(x: 0, y: 0), radius: radius, startAngle: 0, endAngle: CGFloat.pi * 2, clockwise: true) 44 | 45 | fillColor = color 46 | path = circlePath.cgPath 47 | anchorPoint = CGPoint(x: 0.5, y: 0.5) 48 | position = from 49 | 50 | let scaleUpAnimationDuration = 0.375 51 | let fadeOutAnimationDuration = 0.195 52 | 53 | CATransaction.begin() 54 | CATransaction.setCompletionBlock({ 55 | self.removeFromSuperlayer() 56 | self.removeAllAnimations() 57 | completion?() 58 | }) 59 | 60 | CATransaction.begin() 61 | CATransaction.setCompletionBlock({ 62 | transition?() 63 | }) 64 | 65 | let scaleUpAnimation = CABasicAnimation(keyPath: "transform.scale.xy") 66 | scaleUpAnimation.fromValue = 0.0 67 | scaleUpAnimation.toValue = 1.0 68 | scaleUpAnimation.duration = scaleUpAnimationDuration 69 | scaleUpAnimation.timingFunction = MaterialDesignEasingCurves.fastOutSlowIn 70 | scaleUpAnimation.fillMode = CAMediaTimingFillMode.forwards 71 | scaleUpAnimation.isRemovedOnCompletion = false 72 | add(scaleUpAnimation, forKey: nil) 73 | 74 | CATransaction.commit() 75 | 76 | let fadeOutAnimation = CABasicAnimation(keyPath: "opacity") 77 | fadeOutAnimation.fromValue = 1.0 78 | fadeOutAnimation.toValue = 0.0 79 | fadeOutAnimation.duration = fadeOutAnimationDuration 80 | fadeOutAnimation.beginTime = CACurrentMediaTime() + scaleUpAnimationDuration 81 | fadeOutAnimation.timingFunction = MaterialDesignEasingCurves.fastOutLinearIn 82 | fadeOutAnimation.fillMode = CAMediaTimingFillMode.forwards 83 | fadeOutAnimation.isRemovedOnCompletion = false 84 | add(fadeOutAnimation, forKey: nil) 85 | 86 | CATransaction.commit() 87 | } 88 | } 89 | -------------------------------------------------------------------------------- /MaterialDesignColorPicker/RippleView.swift: -------------------------------------------------------------------------------- 1 | // 2 | // RippleView.swift 3 | // MaterialDesignColorPicker 4 | // 5 | // Created by John Yanarella on 2/5/17. 6 | // Copyright © 2017-2020 John Yanarella. 7 | // 8 | 9 | import Cocoa 10 | 11 | class RippleView: NSView { 12 | var rippleColor: NSColor? 13 | 14 | override init(frame: NSRect) { 15 | super.init(frame: frame) 16 | 17 | initialize() 18 | } 19 | 20 | required init?(coder aDecoder: NSCoder) { 21 | super.init(coder: aDecoder) 22 | 23 | initialize() 24 | } 25 | 26 | private func initialize() { 27 | wantsLayer = true 28 | } 29 | 30 | override func acceptsFirstMouse(for event: NSEvent?) -> Bool { 31 | return true 32 | } 33 | 34 | override func mouseDown(with event: NSEvent) { 35 | super.mouseDown(with: event) 36 | 37 | guard let color = rippleColor else { 38 | return 39 | } 40 | 41 | let mouseDownPoint = convert(event.locationInWindow, from: nil) 42 | 43 | ripple(color: color, from: mouseDownPoint) 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /MaterialDesignColorPickerFramework/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 | 2.0.0 19 | CFBundleVersion 20 | $(CURRENT_PROJECT_VERSION) 21 | NSHumanReadableCopyright 22 | Copyright © 2017-2020 John Yanarella. 23 | NSPrincipalClass 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /MaterialDesignColorPickerFramework/MaterialDesignColorPickerFramework.h: -------------------------------------------------------------------------------- 1 | // 2 | // MaterialDesignColorPickerFramework.h 3 | // MaterialDesignColorPickerFramework 4 | // 5 | // Created by John Yanarella on 1/21/17. 6 | // Copyright © 2017-2020 John Yanarella. 7 | // 8 | 9 | #import 10 | 11 | //! Project version number for MaterialDesignColorPickerFramework. 12 | FOUNDATION_EXPORT double MaterialDesignColorPickerFrameworkVersionNumber; 13 | 14 | //! Project version string for MaterialDesignColorPickerFramework. 15 | FOUNDATION_EXPORT const unsigned char MaterialDesignColorPickerFrameworkVersionString[]; 16 | 17 | // In this header, you should import all the public headers of your framework using statements like #import 18 | 19 | 20 | -------------------------------------------------------------------------------- /Playground.playground/Contents.swift: -------------------------------------------------------------------------------- 1 | /*: 2 | ## Material Design Color Picker Playground 3 | 4 | Use this playground in combination with the `MaterialDesignColorPickerFramework` target for rapid iterative experimentation during development. 5 | 6 | This approach reduces the tedium of reinstalling the color picker bundle and closing + reopening the host application after each build. 7 | 8 | Choose "Editor" > "Live View" to see a live preview. 9 | */ 10 | import Cocoa 11 | import PlaygroundSupport 12 | 13 | @testable import MaterialDesignColorPickerFramework 14 | 15 | let bundle = Bundle(identifier: "com.codecatalyst.MaterialDesignColorPickerFramework")! 16 | bundle.load() 17 | 18 | let colorPicker = MaterialDesignColorPicker() 19 | let view = colorPicker.provideNewView(true) 20 | 21 | colorPicker.viewSizeChanged(nil) 22 | 23 | colorPicker.setColor(NSColor(hex: 0x000000)!) 24 | 25 | PlaygroundPage.current.liveView = view 26 | -------------------------------------------------------------------------------- /Playground.playground/contents.xcplayground: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 |

2 | Icon 3 |

4 |

5 | Icon 6 |

7 | 8 |

9 | Version: 2.0 10 | Swift 5 11 | License: MIT 12 | Platform: macOS 10.13+ 13 |

14 | 15 |

16 | Animated Example 17 |

18 | 19 | ## About 20 | 21 | Material Design Color Picker is a custom color picker plugin for macOS that allows users to navigate color swatches and select colors from Google's [Material Design Color Palette](https://material.io/guidelines/style/color.html). 22 | 23 | 24 | Once installed, the color picker is available systemwide within any macOS application that utilizes the standard color panel (aka NSColorPanel) for color selection, including: 25 | 26 | * [Acorn 4.5+](http://www.flyingmeat.com/acorn/) 27 | * [Pixelmator 3.4+](http://www.pixelmator.com/mac/) 28 | * [iWork](http://www.apple.com/iwork/) 29 | * Keynote 30 | * Pages 31 | * Numbers 32 | * macOS System Apps 33 | * Mail 34 | * Preview 35 | * TextEdit 36 | * and many other third-party macOS applications. 37 | 38 | **Requires macOS 10.13 (or higher).** 39 | 40 | ## Installation 41 | 42 | Download the latest signed release build from the [releases](https://github.com/CodeCatalyst/MaterialDesignColorPicker/releases) page on GitHub. 43 | 44 | Expand the .zip file and copy the extracted `MaterialDesignColorPicker.colorPicker` file to the folder: 45 | 46 | ``` 47 | ~/Library/ColorPickers/ 48 | ``` 49 | 50 | **Tip:** You can open this folder quickly by selecting the "Go" | "Go to Folder..." (⇧⌘G) menu in Finder and typing in the path above. 51 | 52 | ## Building from Source Code 53 | 54 | Build the `MaterialDesignColorPicker` target and copy the resulting `MaterialDesignColorPicker.colorPicker` bundle to: 55 | 56 | ``` 57 | ~/Library/ColorPickers/ 58 | ``` 59 | 60 | The project workspace also includes an Xcode Playground which can be used in combination with the `MaterialDesignColorPickerFramework` target for rapid iterative experimentation during development. 61 | 62 | **Requires Xcode 11 (or higher) and macOS X 10.13 (or higher).** 63 | 64 | ## Contributors 65 | 66 | * [John Yanarella](http://twitter.com/johnyanarella) (Creator) 67 | 68 | ## Acknowledgements 69 | 70 | * Special thanks to: 71 | * [Maciek Grzybowski](http://www.n-created.com/) whose [article](http://macoscope.com/blog/how-to-extend-the-os-x-color-panel-with-a-custom-color-picker/) on custom color picker development was invaluable 72 | * [Matt Braun](http://www.magnateinteractive.com/) for beta testing and feedback 73 | * [Kevin Kazmeirczak](http://www.kevinkaz.com/) for beta testing and feedback 74 | 75 | ## License 76 | 77 | Copyright © 2017-2020 John Yanarella 78 | 79 | Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: 80 | 81 | The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. 82 | 83 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 84 | --------------------------------------------------------------------------------