├── .github └── workflows │ └── main.yml ├── .gitignore ├── .swift-version ├── Color.podspec ├── Color.xcodeproj ├── project.pbxproj └── xcshareddata │ └── xcschemes │ ├── Color-iOS.xcscheme │ ├── Color-macOS.xcscheme │ ├── Color-tvOS.xcscheme │ └── Color-watchOS.xcscheme ├── LICENSE ├── Package.swift ├── Readme.markdown ├── Sources └── Color │ ├── Sources │ ├── ConformanceLevel+CoreGraphics.swift │ ├── ConformanceLevel.swift │ ├── HSLColor+Manipulation.swift │ ├── HSLColor+NSColor.swift │ ├── HSLColor+SystemColor.swift │ ├── HSLColor+UIColor.swift │ ├── HSLColor.swift │ ├── RGBColor+CSS.swift │ ├── RGBColor+Hex.swift │ ├── RGBColor+NSColor.swift │ ├── RGBColor+SystemColor.swift │ ├── RGBColor+Temperature.swift │ ├── RGBColor+UIColor.swift │ ├── RGBColor+WCAG.swift │ ├── RGBColor+YIQ.swift │ ├── RGBColor.swift │ └── SystemColor.swift │ └── Support │ ├── Color.h │ ├── Info.plist │ └── Tests-Info.plist └── Tests ├── ColorTests ├── ColorTests.swift ├── TemperatureTests.swift ├── TestHelper.swift └── XCTestManifests.swift └── LinuxMain.swift /.github/workflows/main.yml: -------------------------------------------------------------------------------- 1 | name: Tests 2 | on: [push] 3 | jobs: 4 | test-swift-package: 5 | name: Test Swift Package 6 | runs-on: macos-latest 7 | timeout-minutes: 10 8 | steps: 9 | - uses: actions/checkout@v1 10 | - name: 'Select Xcode 11.2.1' 11 | run: sudo xcode-select -s /Applications/Xcode_11.2.1.app 12 | - name: 'Test' 13 | run: swift test 14 | test-macos: 15 | name: Test macOS 16 | runs-on: macos-latest 17 | timeout-minutes: 10 18 | steps: 19 | - uses: actions/checkout@v1 20 | - name: 'Select Xcode 11.2.1' 21 | run: sudo xcode-select -s /Applications/Xcode_11.2.1.app 22 | - name: 'Test' 23 | run: xcodebuild test -project Color.xcodeproj -scheme Color-macOS | xcpretty --color; exit ${PIPESTATUS[0]} 24 | test-ios: 25 | name: Test iOS 26 | runs-on: macos-latest 27 | timeout-minutes: 10 28 | steps: 29 | - uses: actions/checkout@v1 30 | - name: 'Select Xcode 11.2.1' 31 | run: sudo xcode-select -s /Applications/Xcode_11.2.1.app 32 | - name: 'Test' 33 | run: xcodebuild test -project Color.xcodeproj -scheme Color-iOS -destination "platform=iOS Simulator,name=iPhone 8" | xcpretty --color; exit ${PIPESTATUS[0]} 34 | test-tvos: 35 | name: Test tvOS 36 | runs-on: macos-latest 37 | timeout-minutes: 10 38 | steps: 39 | - uses: actions/checkout@v1 40 | - name: 'Select Xcode 11.2.1' 41 | run: sudo xcode-select -s /Applications/Xcode_11.2.1.app 42 | - name: 'Test' 43 | run: xcodebuild test -project Color.xcodeproj -scheme Color-tvOS -destination "platform=tvOS Simulator,name=Apple TV 4K (at 1080p)" | xcpretty --color; exit ${PIPESTATUS[0]} 44 | test-watchos: 45 | name: Build watchOS 46 | runs-on: macos-latest 47 | timeout-minutes: 10 48 | steps: 49 | - uses: actions/checkout@v1 50 | - name: 'Select Xcode 11.2.1' 51 | run: sudo xcode-select -s /Applications/Xcode_11.2.1.app 52 | - name: 'Build' 53 | run: xcodebuild build -project Color.xcodeproj -scheme Color-watchOS -destination "platform=watchOS Simulator,name=Apple Watch Series 4 - 40mm" | xcpretty --color; exit ${PIPESTATUS[0]} 54 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | .DS_Store 2 | .build 3 | *xcuserdata/ 4 | *.mode1v3 5 | *.pbxuser 6 | *.xcworkspace 7 | *.moved-aside/ 8 | *.zip 9 | .vagrant 10 | Vagrantfile 11 | -------------------------------------------------------------------------------- /.swift-version: -------------------------------------------------------------------------------- 1 | 5.1 2 | -------------------------------------------------------------------------------- /Color.podspec: -------------------------------------------------------------------------------- 1 | Pod::Spec.new do |spec| 2 | spec.name = 'Color' 3 | spec.version = '0.1.1' 4 | spec.authors = { 'Sam Soffes' => 'sam@soff.es' } 5 | spec.homepage = 'https://github.com/soffes/Color' 6 | spec.summary = 'Color utilities' 7 | spec.description = 'Color utilities in pure Swift.' 8 | spec.source = { :git => 'https://github.com/soffes/Color.git', :tag => "v#{spec.version}" } 9 | spec.license = { :type => 'MIT', :file => 'LICENSE' } 10 | 11 | spec.osx.deployment_target = '10.10' 12 | spec.ios.deployment_target = '8.0' 13 | spec.watchos.deployment_target = '2.0' 14 | spec.tvos.deployment_target = '9.0' 15 | 16 | spec.source_files = 'Sources/Color/**/*.{swift}' 17 | end 18 | -------------------------------------------------------------------------------- /Color.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 46; 7 | objects = { 8 | 9 | /* Begin PBXBuildFile section */ 10 | 2116D96723AB0CCC00FD77BD /* RGBColor+Temperature.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2116D96623AB0CCC00FD77BD /* RGBColor+Temperature.swift */; }; 11 | 2116D96823AB0CCC00FD77BD /* RGBColor+Temperature.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2116D96623AB0CCC00FD77BD /* RGBColor+Temperature.swift */; }; 12 | 2116D96923AB0CCC00FD77BD /* RGBColor+Temperature.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2116D96623AB0CCC00FD77BD /* RGBColor+Temperature.swift */; }; 13 | 2116D96A23AB0CCC00FD77BD /* RGBColor+Temperature.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2116D96623AB0CCC00FD77BD /* RGBColor+Temperature.swift */; }; 14 | 2116D96C23AB0D2E00FD77BD /* TemperatureTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2116D96B23AB0D2E00FD77BD /* TemperatureTests.swift */; }; 15 | 2116D96D23AB0D2E00FD77BD /* TemperatureTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2116D96B23AB0D2E00FD77BD /* TemperatureTests.swift */; }; 16 | 2116D96E23AB0D2E00FD77BD /* TemperatureTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2116D96B23AB0D2E00FD77BD /* TemperatureTests.swift */; }; 17 | 21292D401F1EB0C4000BC512 /* Color.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 21292D371F1EB0C4000BC512 /* Color.framework */; }; 18 | 21292D691F1EB0F3000BC512 /* Color.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 21292D601F1EB0F3000BC512 /* Color.framework */; }; 19 | 2169E17623AB0FD500AFDA6B /* TestHelper.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2169E17523AB0FD500AFDA6B /* TestHelper.swift */; }; 20 | 2169E17723AB0FD500AFDA6B /* TestHelper.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2169E17523AB0FD500AFDA6B /* TestHelper.swift */; }; 21 | 2169E17823AB0FD500AFDA6B /* TestHelper.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2169E17523AB0FD500AFDA6B /* TestHelper.swift */; }; 22 | 21BBCF0A1F1C833000AF9F14 /* Color.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 21BBCF001F1C833000AF9F14 /* Color.framework */; }; 23 | 21D2D501215361D5001C1D11 /* Color.h in Headers */ = {isa = PBXBuildFile; fileRef = 21D2D4EA215361D5001C1D11 /* Color.h */; settings = {ATTRIBUTES = (Public, ); }; }; 24 | 21D2D502215361D5001C1D11 /* Color.h in Headers */ = {isa = PBXBuildFile; fileRef = 21D2D4EA215361D5001C1D11 /* Color.h */; settings = {ATTRIBUTES = (Public, ); }; }; 25 | 21D2D503215361D5001C1D11 /* Color.h in Headers */ = {isa = PBXBuildFile; fileRef = 21D2D4EA215361D5001C1D11 /* Color.h */; settings = {ATTRIBUTES = (Public, ); }; }; 26 | 21D2D504215361D5001C1D11 /* Color.h in Headers */ = {isa = PBXBuildFile; fileRef = 21D2D4EA215361D5001C1D11 /* Color.h */; settings = {ATTRIBUTES = (Public, ); }; }; 27 | 21D2D509215361D5001C1D11 /* HSLColor.swift in Sources */ = {isa = PBXBuildFile; fileRef = 21D2D4ED215361D5001C1D11 /* HSLColor.swift */; }; 28 | 21D2D50A215361D5001C1D11 /* HSLColor.swift in Sources */ = {isa = PBXBuildFile; fileRef = 21D2D4ED215361D5001C1D11 /* HSLColor.swift */; }; 29 | 21D2D50B215361D5001C1D11 /* HSLColor.swift in Sources */ = {isa = PBXBuildFile; fileRef = 21D2D4ED215361D5001C1D11 /* HSLColor.swift */; }; 30 | 21D2D50C215361D5001C1D11 /* HSLColor.swift in Sources */ = {isa = PBXBuildFile; fileRef = 21D2D4ED215361D5001C1D11 /* HSLColor.swift */; }; 31 | 21D2D50D215361D5001C1D11 /* RGBColor+YIQ.swift in Sources */ = {isa = PBXBuildFile; fileRef = 21D2D4EE215361D5001C1D11 /* RGBColor+YIQ.swift */; }; 32 | 21D2D50E215361D5001C1D11 /* RGBColor+YIQ.swift in Sources */ = {isa = PBXBuildFile; fileRef = 21D2D4EE215361D5001C1D11 /* RGBColor+YIQ.swift */; }; 33 | 21D2D50F215361D5001C1D11 /* RGBColor+YIQ.swift in Sources */ = {isa = PBXBuildFile; fileRef = 21D2D4EE215361D5001C1D11 /* RGBColor+YIQ.swift */; }; 34 | 21D2D510215361D5001C1D11 /* RGBColor+YIQ.swift in Sources */ = {isa = PBXBuildFile; fileRef = 21D2D4EE215361D5001C1D11 /* RGBColor+YIQ.swift */; }; 35 | 21D2D511215361D5001C1D11 /* RGBColor+NSColor.swift in Sources */ = {isa = PBXBuildFile; fileRef = 21D2D4EF215361D5001C1D11 /* RGBColor+NSColor.swift */; }; 36 | 21D2D512215361D5001C1D11 /* RGBColor+NSColor.swift in Sources */ = {isa = PBXBuildFile; fileRef = 21D2D4EF215361D5001C1D11 /* RGBColor+NSColor.swift */; }; 37 | 21D2D513215361D5001C1D11 /* RGBColor+NSColor.swift in Sources */ = {isa = PBXBuildFile; fileRef = 21D2D4EF215361D5001C1D11 /* RGBColor+NSColor.swift */; }; 38 | 21D2D514215361D5001C1D11 /* RGBColor+NSColor.swift in Sources */ = {isa = PBXBuildFile; fileRef = 21D2D4EF215361D5001C1D11 /* RGBColor+NSColor.swift */; }; 39 | 21D2D515215361D5001C1D11 /* RGBColor+UIColor.swift in Sources */ = {isa = PBXBuildFile; fileRef = 21D2D4F0215361D5001C1D11 /* RGBColor+UIColor.swift */; }; 40 | 21D2D516215361D5001C1D11 /* RGBColor+UIColor.swift in Sources */ = {isa = PBXBuildFile; fileRef = 21D2D4F0215361D5001C1D11 /* RGBColor+UIColor.swift */; }; 41 | 21D2D517215361D5001C1D11 /* RGBColor+UIColor.swift in Sources */ = {isa = PBXBuildFile; fileRef = 21D2D4F0215361D5001C1D11 /* RGBColor+UIColor.swift */; }; 42 | 21D2D518215361D5001C1D11 /* RGBColor+UIColor.swift in Sources */ = {isa = PBXBuildFile; fileRef = 21D2D4F0215361D5001C1D11 /* RGBColor+UIColor.swift */; }; 43 | 21D2D519215361D5001C1D11 /* ConformanceLevel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 21D2D4F1215361D5001C1D11 /* ConformanceLevel.swift */; }; 44 | 21D2D51A215361D5001C1D11 /* ConformanceLevel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 21D2D4F1215361D5001C1D11 /* ConformanceLevel.swift */; }; 45 | 21D2D51B215361D5001C1D11 /* ConformanceLevel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 21D2D4F1215361D5001C1D11 /* ConformanceLevel.swift */; }; 46 | 21D2D51C215361D5001C1D11 /* ConformanceLevel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 21D2D4F1215361D5001C1D11 /* ConformanceLevel.swift */; }; 47 | 21D2D51D215361D5001C1D11 /* RGBColor+WCAG.swift in Sources */ = {isa = PBXBuildFile; fileRef = 21D2D4F2215361D5001C1D11 /* RGBColor+WCAG.swift */; }; 48 | 21D2D51E215361D5001C1D11 /* RGBColor+WCAG.swift in Sources */ = {isa = PBXBuildFile; fileRef = 21D2D4F2215361D5001C1D11 /* RGBColor+WCAG.swift */; }; 49 | 21D2D51F215361D5001C1D11 /* RGBColor+WCAG.swift in Sources */ = {isa = PBXBuildFile; fileRef = 21D2D4F2215361D5001C1D11 /* RGBColor+WCAG.swift */; }; 50 | 21D2D520215361D5001C1D11 /* RGBColor+WCAG.swift in Sources */ = {isa = PBXBuildFile; fileRef = 21D2D4F2215361D5001C1D11 /* RGBColor+WCAG.swift */; }; 51 | 21D2D521215361D5001C1D11 /* HSLColor+UIColor.swift in Sources */ = {isa = PBXBuildFile; fileRef = 21D2D4F3215361D5001C1D11 /* HSLColor+UIColor.swift */; }; 52 | 21D2D522215361D5001C1D11 /* HSLColor+UIColor.swift in Sources */ = {isa = PBXBuildFile; fileRef = 21D2D4F3215361D5001C1D11 /* HSLColor+UIColor.swift */; }; 53 | 21D2D523215361D5001C1D11 /* HSLColor+UIColor.swift in Sources */ = {isa = PBXBuildFile; fileRef = 21D2D4F3215361D5001C1D11 /* HSLColor+UIColor.swift */; }; 54 | 21D2D524215361D5001C1D11 /* HSLColor+UIColor.swift in Sources */ = {isa = PBXBuildFile; fileRef = 21D2D4F3215361D5001C1D11 /* HSLColor+UIColor.swift */; }; 55 | 21D2D525215361D5001C1D11 /* HSLColor+NSColor.swift in Sources */ = {isa = PBXBuildFile; fileRef = 21D2D4F4215361D5001C1D11 /* HSLColor+NSColor.swift */; }; 56 | 21D2D526215361D5001C1D11 /* HSLColor+NSColor.swift in Sources */ = {isa = PBXBuildFile; fileRef = 21D2D4F4215361D5001C1D11 /* HSLColor+NSColor.swift */; }; 57 | 21D2D527215361D5001C1D11 /* HSLColor+NSColor.swift in Sources */ = {isa = PBXBuildFile; fileRef = 21D2D4F4215361D5001C1D11 /* HSLColor+NSColor.swift */; }; 58 | 21D2D528215361D5001C1D11 /* HSLColor+NSColor.swift in Sources */ = {isa = PBXBuildFile; fileRef = 21D2D4F4215361D5001C1D11 /* HSLColor+NSColor.swift */; }; 59 | 21D2D529215361D5001C1D11 /* RGBColor+Hex.swift in Sources */ = {isa = PBXBuildFile; fileRef = 21D2D4F5215361D5001C1D11 /* RGBColor+Hex.swift */; }; 60 | 21D2D52A215361D5001C1D11 /* RGBColor+Hex.swift in Sources */ = {isa = PBXBuildFile; fileRef = 21D2D4F5215361D5001C1D11 /* RGBColor+Hex.swift */; }; 61 | 21D2D52B215361D5001C1D11 /* RGBColor+Hex.swift in Sources */ = {isa = PBXBuildFile; fileRef = 21D2D4F5215361D5001C1D11 /* RGBColor+Hex.swift */; }; 62 | 21D2D52C215361D5001C1D11 /* RGBColor+Hex.swift in Sources */ = {isa = PBXBuildFile; fileRef = 21D2D4F5215361D5001C1D11 /* RGBColor+Hex.swift */; }; 63 | 21D2D52D215361D5001C1D11 /* RGBColor+SystemColor.swift in Sources */ = {isa = PBXBuildFile; fileRef = 21D2D4F6215361D5001C1D11 /* RGBColor+SystemColor.swift */; }; 64 | 21D2D52E215361D5001C1D11 /* RGBColor+SystemColor.swift in Sources */ = {isa = PBXBuildFile; fileRef = 21D2D4F6215361D5001C1D11 /* RGBColor+SystemColor.swift */; }; 65 | 21D2D52F215361D5001C1D11 /* RGBColor+SystemColor.swift in Sources */ = {isa = PBXBuildFile; fileRef = 21D2D4F6215361D5001C1D11 /* RGBColor+SystemColor.swift */; }; 66 | 21D2D530215361D5001C1D11 /* RGBColor+SystemColor.swift in Sources */ = {isa = PBXBuildFile; fileRef = 21D2D4F6215361D5001C1D11 /* RGBColor+SystemColor.swift */; }; 67 | 21D2D531215361D5001C1D11 /* HSLColor+Manipulation.swift in Sources */ = {isa = PBXBuildFile; fileRef = 21D2D4F7215361D5001C1D11 /* HSLColor+Manipulation.swift */; }; 68 | 21D2D532215361D5001C1D11 /* HSLColor+Manipulation.swift in Sources */ = {isa = PBXBuildFile; fileRef = 21D2D4F7215361D5001C1D11 /* HSLColor+Manipulation.swift */; }; 69 | 21D2D533215361D5001C1D11 /* HSLColor+Manipulation.swift in Sources */ = {isa = PBXBuildFile; fileRef = 21D2D4F7215361D5001C1D11 /* HSLColor+Manipulation.swift */; }; 70 | 21D2D534215361D5001C1D11 /* HSLColor+Manipulation.swift in Sources */ = {isa = PBXBuildFile; fileRef = 21D2D4F7215361D5001C1D11 /* HSLColor+Manipulation.swift */; }; 71 | 21D2D535215361D5001C1D11 /* ConformanceLevel+CoreGraphics.swift in Sources */ = {isa = PBXBuildFile; fileRef = 21D2D4F8215361D5001C1D11 /* ConformanceLevel+CoreGraphics.swift */; }; 72 | 21D2D536215361D5001C1D11 /* ConformanceLevel+CoreGraphics.swift in Sources */ = {isa = PBXBuildFile; fileRef = 21D2D4F8215361D5001C1D11 /* ConformanceLevel+CoreGraphics.swift */; }; 73 | 21D2D537215361D5001C1D11 /* ConformanceLevel+CoreGraphics.swift in Sources */ = {isa = PBXBuildFile; fileRef = 21D2D4F8215361D5001C1D11 /* ConformanceLevel+CoreGraphics.swift */; }; 74 | 21D2D538215361D5001C1D11 /* ConformanceLevel+CoreGraphics.swift in Sources */ = {isa = PBXBuildFile; fileRef = 21D2D4F8215361D5001C1D11 /* ConformanceLevel+CoreGraphics.swift */; }; 75 | 21D2D539215361D5001C1D11 /* RGBColor+CSS.swift in Sources */ = {isa = PBXBuildFile; fileRef = 21D2D4F9215361D5001C1D11 /* RGBColor+CSS.swift */; }; 76 | 21D2D53A215361D5001C1D11 /* RGBColor+CSS.swift in Sources */ = {isa = PBXBuildFile; fileRef = 21D2D4F9215361D5001C1D11 /* RGBColor+CSS.swift */; }; 77 | 21D2D53B215361D5001C1D11 /* RGBColor+CSS.swift in Sources */ = {isa = PBXBuildFile; fileRef = 21D2D4F9215361D5001C1D11 /* RGBColor+CSS.swift */; }; 78 | 21D2D53C215361D5001C1D11 /* RGBColor+CSS.swift in Sources */ = {isa = PBXBuildFile; fileRef = 21D2D4F9215361D5001C1D11 /* RGBColor+CSS.swift */; }; 79 | 21D2D53D215361D5001C1D11 /* HSLColor+SystemColor.swift in Sources */ = {isa = PBXBuildFile; fileRef = 21D2D4FA215361D5001C1D11 /* HSLColor+SystemColor.swift */; }; 80 | 21D2D53E215361D5001C1D11 /* HSLColor+SystemColor.swift in Sources */ = {isa = PBXBuildFile; fileRef = 21D2D4FA215361D5001C1D11 /* HSLColor+SystemColor.swift */; }; 81 | 21D2D53F215361D5001C1D11 /* HSLColor+SystemColor.swift in Sources */ = {isa = PBXBuildFile; fileRef = 21D2D4FA215361D5001C1D11 /* HSLColor+SystemColor.swift */; }; 82 | 21D2D540215361D5001C1D11 /* HSLColor+SystemColor.swift in Sources */ = {isa = PBXBuildFile; fileRef = 21D2D4FA215361D5001C1D11 /* HSLColor+SystemColor.swift */; }; 83 | 21D2D541215361D5001C1D11 /* SystemColor.swift in Sources */ = {isa = PBXBuildFile; fileRef = 21D2D4FB215361D5001C1D11 /* SystemColor.swift */; }; 84 | 21D2D542215361D5001C1D11 /* SystemColor.swift in Sources */ = {isa = PBXBuildFile; fileRef = 21D2D4FB215361D5001C1D11 /* SystemColor.swift */; }; 85 | 21D2D543215361D5001C1D11 /* SystemColor.swift in Sources */ = {isa = PBXBuildFile; fileRef = 21D2D4FB215361D5001C1D11 /* SystemColor.swift */; }; 86 | 21D2D544215361D5001C1D11 /* SystemColor.swift in Sources */ = {isa = PBXBuildFile; fileRef = 21D2D4FB215361D5001C1D11 /* SystemColor.swift */; }; 87 | 21D2D545215361D5001C1D11 /* RGBColor.swift in Sources */ = {isa = PBXBuildFile; fileRef = 21D2D4FC215361D5001C1D11 /* RGBColor.swift */; }; 88 | 21D2D546215361D5001C1D11 /* RGBColor.swift in Sources */ = {isa = PBXBuildFile; fileRef = 21D2D4FC215361D5001C1D11 /* RGBColor.swift */; }; 89 | 21D2D547215361D5001C1D11 /* RGBColor.swift in Sources */ = {isa = PBXBuildFile; fileRef = 21D2D4FC215361D5001C1D11 /* RGBColor.swift */; }; 90 | 21D2D548215361D5001C1D11 /* RGBColor.swift in Sources */ = {isa = PBXBuildFile; fileRef = 21D2D4FC215361D5001C1D11 /* RGBColor.swift */; }; 91 | 21D2D550215361DD001C1D11 /* ColorTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 21D2D54C215361DD001C1D11 /* ColorTests.swift */; }; 92 | 21D2D551215361DD001C1D11 /* ColorTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 21D2D54C215361DD001C1D11 /* ColorTests.swift */; }; 93 | 21D2D552215361DD001C1D11 /* ColorTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 21D2D54C215361DD001C1D11 /* ColorTests.swift */; }; 94 | /* End PBXBuildFile section */ 95 | 96 | /* Begin PBXContainerItemProxy section */ 97 | 21292D411F1EB0C4000BC512 /* PBXContainerItemProxy */ = { 98 | isa = PBXContainerItemProxy; 99 | containerPortal = 21BBCEF71F1C833000AF9F14 /* Project object */; 100 | proxyType = 1; 101 | remoteGlobalIDString = 21292D361F1EB0C4000BC512; 102 | remoteInfo = "Color-iOS"; 103 | }; 104 | 21292D6A1F1EB0F3000BC512 /* PBXContainerItemProxy */ = { 105 | isa = PBXContainerItemProxy; 106 | containerPortal = 21BBCEF71F1C833000AF9F14 /* Project object */; 107 | proxyType = 1; 108 | remoteGlobalIDString = 21292D5F1F1EB0F3000BC512; 109 | remoteInfo = "Color-tvOS"; 110 | }; 111 | 21BBCF0B1F1C833000AF9F14 /* PBXContainerItemProxy */ = { 112 | isa = PBXContainerItemProxy; 113 | containerPortal = 21BBCEF71F1C833000AF9F14 /* Project object */; 114 | proxyType = 1; 115 | remoteGlobalIDString = 21BBCEFF1F1C833000AF9F14; 116 | remoteInfo = Color; 117 | }; 118 | /* End PBXContainerItemProxy section */ 119 | 120 | /* Begin PBXFileReference section */ 121 | 2116D96623AB0CCC00FD77BD /* RGBColor+Temperature.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "RGBColor+Temperature.swift"; sourceTree = ""; }; 122 | 2116D96B23AB0D2E00FD77BD /* TemperatureTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TemperatureTests.swift; sourceTree = ""; }; 123 | 21292D371F1EB0C4000BC512 /* Color.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Color.framework; sourceTree = BUILT_PRODUCTS_DIR; }; 124 | 21292D3F1F1EB0C4000BC512 /* ColorTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = ColorTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; 125 | 21292D531F1EB0E9000BC512 /* Color.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Color.framework; sourceTree = BUILT_PRODUCTS_DIR; }; 126 | 21292D601F1EB0F3000BC512 /* Color.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Color.framework; sourceTree = BUILT_PRODUCTS_DIR; }; 127 | 21292D681F1EB0F3000BC512 /* ColorTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = ColorTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; 128 | 2169E17523AB0FD500AFDA6B /* TestHelper.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TestHelper.swift; sourceTree = ""; }; 129 | 21BBCF001F1C833000AF9F14 /* Color.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Color.framework; sourceTree = BUILT_PRODUCTS_DIR; }; 130 | 21BBCF091F1C833000AF9F14 /* ColorTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = ColorTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; 131 | 21D2D4E9215361D5001C1D11 /* Tests-Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = "Tests-Info.plist"; sourceTree = ""; }; 132 | 21D2D4EA215361D5001C1D11 /* Color.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Color.h; sourceTree = ""; }; 133 | 21D2D4EB215361D5001C1D11 /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 134 | 21D2D4ED215361D5001C1D11 /* HSLColor.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = HSLColor.swift; sourceTree = ""; }; 135 | 21D2D4EE215361D5001C1D11 /* RGBColor+YIQ.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "RGBColor+YIQ.swift"; sourceTree = ""; }; 136 | 21D2D4EF215361D5001C1D11 /* RGBColor+NSColor.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "RGBColor+NSColor.swift"; sourceTree = ""; }; 137 | 21D2D4F0215361D5001C1D11 /* RGBColor+UIColor.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "RGBColor+UIColor.swift"; sourceTree = ""; }; 138 | 21D2D4F1215361D5001C1D11 /* ConformanceLevel.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ConformanceLevel.swift; sourceTree = ""; }; 139 | 21D2D4F2215361D5001C1D11 /* RGBColor+WCAG.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "RGBColor+WCAG.swift"; sourceTree = ""; }; 140 | 21D2D4F3215361D5001C1D11 /* HSLColor+UIColor.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "HSLColor+UIColor.swift"; sourceTree = ""; }; 141 | 21D2D4F4215361D5001C1D11 /* HSLColor+NSColor.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "HSLColor+NSColor.swift"; sourceTree = ""; }; 142 | 21D2D4F5215361D5001C1D11 /* RGBColor+Hex.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "RGBColor+Hex.swift"; sourceTree = ""; }; 143 | 21D2D4F6215361D5001C1D11 /* RGBColor+SystemColor.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "RGBColor+SystemColor.swift"; sourceTree = ""; }; 144 | 21D2D4F7215361D5001C1D11 /* HSLColor+Manipulation.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "HSLColor+Manipulation.swift"; sourceTree = ""; }; 145 | 21D2D4F8215361D5001C1D11 /* ConformanceLevel+CoreGraphics.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "ConformanceLevel+CoreGraphics.swift"; sourceTree = ""; }; 146 | 21D2D4F9215361D5001C1D11 /* RGBColor+CSS.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "RGBColor+CSS.swift"; sourceTree = ""; }; 147 | 21D2D4FA215361D5001C1D11 /* HSLColor+SystemColor.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "HSLColor+SystemColor.swift"; sourceTree = ""; }; 148 | 21D2D4FB215361D5001C1D11 /* SystemColor.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = SystemColor.swift; sourceTree = ""; }; 149 | 21D2D4FC215361D5001C1D11 /* RGBColor.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = RGBColor.swift; sourceTree = ""; }; 150 | 21D2D54C215361DD001C1D11 /* ColorTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ColorTests.swift; sourceTree = ""; }; 151 | /* End PBXFileReference section */ 152 | 153 | /* Begin PBXFrameworksBuildPhase section */ 154 | 21292D331F1EB0C4000BC512 /* Frameworks */ = { 155 | isa = PBXFrameworksBuildPhase; 156 | buildActionMask = 2147483647; 157 | files = ( 158 | ); 159 | runOnlyForDeploymentPostprocessing = 0; 160 | }; 161 | 21292D3C1F1EB0C4000BC512 /* Frameworks */ = { 162 | isa = PBXFrameworksBuildPhase; 163 | buildActionMask = 2147483647; 164 | files = ( 165 | 21292D401F1EB0C4000BC512 /* Color.framework in Frameworks */, 166 | ); 167 | runOnlyForDeploymentPostprocessing = 0; 168 | }; 169 | 21292D4F1F1EB0E9000BC512 /* Frameworks */ = { 170 | isa = PBXFrameworksBuildPhase; 171 | buildActionMask = 2147483647; 172 | files = ( 173 | ); 174 | runOnlyForDeploymentPostprocessing = 0; 175 | }; 176 | 21292D5C1F1EB0F3000BC512 /* Frameworks */ = { 177 | isa = PBXFrameworksBuildPhase; 178 | buildActionMask = 2147483647; 179 | files = ( 180 | ); 181 | runOnlyForDeploymentPostprocessing = 0; 182 | }; 183 | 21292D651F1EB0F3000BC512 /* Frameworks */ = { 184 | isa = PBXFrameworksBuildPhase; 185 | buildActionMask = 2147483647; 186 | files = ( 187 | 21292D691F1EB0F3000BC512 /* Color.framework in Frameworks */, 188 | ); 189 | runOnlyForDeploymentPostprocessing = 0; 190 | }; 191 | 21BBCEFC1F1C833000AF9F14 /* Frameworks */ = { 192 | isa = PBXFrameworksBuildPhase; 193 | buildActionMask = 2147483647; 194 | files = ( 195 | ); 196 | runOnlyForDeploymentPostprocessing = 0; 197 | }; 198 | 21BBCF061F1C833000AF9F14 /* Frameworks */ = { 199 | isa = PBXFrameworksBuildPhase; 200 | buildActionMask = 2147483647; 201 | files = ( 202 | 21BBCF0A1F1C833000AF9F14 /* Color.framework in Frameworks */, 203 | ); 204 | runOnlyForDeploymentPostprocessing = 0; 205 | }; 206 | /* End PBXFrameworksBuildPhase section */ 207 | 208 | /* Begin PBXGroup section */ 209 | 21BBCEF61F1C833000AF9F14 = { 210 | isa = PBXGroup; 211 | children = ( 212 | 21D2D4E6215361D5001C1D11 /* Sources */, 213 | 21D2D549215361DD001C1D11 /* Tests */, 214 | 21BBCF011F1C833000AF9F14 /* Products */, 215 | ); 216 | sourceTree = ""; 217 | }; 218 | 21BBCF011F1C833000AF9F14 /* Products */ = { 219 | isa = PBXGroup; 220 | children = ( 221 | 21BBCF001F1C833000AF9F14 /* Color.framework */, 222 | 21BBCF091F1C833000AF9F14 /* ColorTests.xctest */, 223 | 21292D371F1EB0C4000BC512 /* Color.framework */, 224 | 21292D3F1F1EB0C4000BC512 /* ColorTests.xctest */, 225 | 21292D531F1EB0E9000BC512 /* Color.framework */, 226 | 21292D601F1EB0F3000BC512 /* Color.framework */, 227 | 21292D681F1EB0F3000BC512 /* ColorTests.xctest */, 228 | ); 229 | name = Products; 230 | sourceTree = ""; 231 | }; 232 | 21D2D4E6215361D5001C1D11 /* Sources */ = { 233 | isa = PBXGroup; 234 | children = ( 235 | 21D2D4E7215361D5001C1D11 /* Color */, 236 | ); 237 | path = Sources; 238 | sourceTree = ""; 239 | }; 240 | 21D2D4E7215361D5001C1D11 /* Color */ = { 241 | isa = PBXGroup; 242 | children = ( 243 | 21D2D4E8215361D5001C1D11 /* Support */, 244 | 21D2D4EC215361D5001C1D11 /* Sources */, 245 | ); 246 | path = Color; 247 | sourceTree = ""; 248 | }; 249 | 21D2D4E8215361D5001C1D11 /* Support */ = { 250 | isa = PBXGroup; 251 | children = ( 252 | 21D2D4E9215361D5001C1D11 /* Tests-Info.plist */, 253 | 21D2D4EA215361D5001C1D11 /* Color.h */, 254 | 21D2D4EB215361D5001C1D11 /* Info.plist */, 255 | ); 256 | path = Support; 257 | sourceTree = ""; 258 | }; 259 | 21D2D4EC215361D5001C1D11 /* Sources */ = { 260 | isa = PBXGroup; 261 | children = ( 262 | 21D2D4F1215361D5001C1D11 /* ConformanceLevel.swift */, 263 | 21D2D4F8215361D5001C1D11 /* ConformanceLevel+CoreGraphics.swift */, 264 | 21D2D4ED215361D5001C1D11 /* HSLColor.swift */, 265 | 21D2D4F7215361D5001C1D11 /* HSLColor+Manipulation.swift */, 266 | 21D2D4F4215361D5001C1D11 /* HSLColor+NSColor.swift */, 267 | 21D2D4FA215361D5001C1D11 /* HSLColor+SystemColor.swift */, 268 | 21D2D4F3215361D5001C1D11 /* HSLColor+UIColor.swift */, 269 | 21D2D4FC215361D5001C1D11 /* RGBColor.swift */, 270 | 21D2D4F9215361D5001C1D11 /* RGBColor+CSS.swift */, 271 | 21D2D4F5215361D5001C1D11 /* RGBColor+Hex.swift */, 272 | 21D2D4EF215361D5001C1D11 /* RGBColor+NSColor.swift */, 273 | 21D2D4F6215361D5001C1D11 /* RGBColor+SystemColor.swift */, 274 | 21D2D4F0215361D5001C1D11 /* RGBColor+UIColor.swift */, 275 | 21D2D4F2215361D5001C1D11 /* RGBColor+WCAG.swift */, 276 | 21D2D4EE215361D5001C1D11 /* RGBColor+YIQ.swift */, 277 | 2116D96623AB0CCC00FD77BD /* RGBColor+Temperature.swift */, 278 | 21D2D4FB215361D5001C1D11 /* SystemColor.swift */, 279 | ); 280 | path = Sources; 281 | sourceTree = ""; 282 | }; 283 | 21D2D549215361DD001C1D11 /* Tests */ = { 284 | isa = PBXGroup; 285 | children = ( 286 | 21D2D54B215361DD001C1D11 /* ColorTests */, 287 | ); 288 | path = Tests; 289 | sourceTree = ""; 290 | }; 291 | 21D2D54B215361DD001C1D11 /* ColorTests */ = { 292 | isa = PBXGroup; 293 | children = ( 294 | 21D2D54C215361DD001C1D11 /* ColorTests.swift */, 295 | 2116D96B23AB0D2E00FD77BD /* TemperatureTests.swift */, 296 | 2169E17523AB0FD500AFDA6B /* TestHelper.swift */, 297 | ); 298 | path = ColorTests; 299 | sourceTree = ""; 300 | }; 301 | /* End PBXGroup section */ 302 | 303 | /* Begin PBXHeadersBuildPhase section */ 304 | 21292D341F1EB0C4000BC512 /* Headers */ = { 305 | isa = PBXHeadersBuildPhase; 306 | buildActionMask = 2147483647; 307 | files = ( 308 | 21D2D502215361D5001C1D11 /* Color.h in Headers */, 309 | ); 310 | runOnlyForDeploymentPostprocessing = 0; 311 | }; 312 | 21292D501F1EB0E9000BC512 /* Headers */ = { 313 | isa = PBXHeadersBuildPhase; 314 | buildActionMask = 2147483647; 315 | files = ( 316 | 21D2D503215361D5001C1D11 /* Color.h in Headers */, 317 | ); 318 | runOnlyForDeploymentPostprocessing = 0; 319 | }; 320 | 21292D5D1F1EB0F3000BC512 /* Headers */ = { 321 | isa = PBXHeadersBuildPhase; 322 | buildActionMask = 2147483647; 323 | files = ( 324 | 21D2D504215361D5001C1D11 /* Color.h in Headers */, 325 | ); 326 | runOnlyForDeploymentPostprocessing = 0; 327 | }; 328 | 21BBCEFD1F1C833000AF9F14 /* Headers */ = { 329 | isa = PBXHeadersBuildPhase; 330 | buildActionMask = 2147483647; 331 | files = ( 332 | 21D2D501215361D5001C1D11 /* Color.h in Headers */, 333 | ); 334 | runOnlyForDeploymentPostprocessing = 0; 335 | }; 336 | /* End PBXHeadersBuildPhase section */ 337 | 338 | /* Begin PBXNativeTarget section */ 339 | 21292D361F1EB0C4000BC512 /* Color-iOS */ = { 340 | isa = PBXNativeTarget; 341 | buildConfigurationList = 21292D4C1F1EB0C4000BC512 /* Build configuration list for PBXNativeTarget "Color-iOS" */; 342 | buildPhases = ( 343 | 21292D321F1EB0C4000BC512 /* Sources */, 344 | 21292D331F1EB0C4000BC512 /* Frameworks */, 345 | 21292D341F1EB0C4000BC512 /* Headers */, 346 | 21292D351F1EB0C4000BC512 /* Resources */, 347 | ); 348 | buildRules = ( 349 | ); 350 | dependencies = ( 351 | ); 352 | name = "Color-iOS"; 353 | productName = "Color-iOS"; 354 | productReference = 21292D371F1EB0C4000BC512 /* Color.framework */; 355 | productType = "com.apple.product-type.framework"; 356 | }; 357 | 21292D3E1F1EB0C4000BC512 /* ColorTests-iOS */ = { 358 | isa = PBXNativeTarget; 359 | buildConfigurationList = 21292D4D1F1EB0C4000BC512 /* Build configuration list for PBXNativeTarget "ColorTests-iOS" */; 360 | buildPhases = ( 361 | 21292D3B1F1EB0C4000BC512 /* Sources */, 362 | 21292D3C1F1EB0C4000BC512 /* Frameworks */, 363 | 21292D3D1F1EB0C4000BC512 /* Resources */, 364 | ); 365 | buildRules = ( 366 | ); 367 | dependencies = ( 368 | 21292D421F1EB0C4000BC512 /* PBXTargetDependency */, 369 | ); 370 | name = "ColorTests-iOS"; 371 | productName = "Color-iOSTests"; 372 | productReference = 21292D3F1F1EB0C4000BC512 /* ColorTests.xctest */; 373 | productType = "com.apple.product-type.bundle.unit-test"; 374 | }; 375 | 21292D521F1EB0E9000BC512 /* Color-watchOS */ = { 376 | isa = PBXNativeTarget; 377 | buildConfigurationList = 21292D581F1EB0E9000BC512 /* Build configuration list for PBXNativeTarget "Color-watchOS" */; 378 | buildPhases = ( 379 | 21292D4E1F1EB0E9000BC512 /* Sources */, 380 | 21292D4F1F1EB0E9000BC512 /* Frameworks */, 381 | 21292D501F1EB0E9000BC512 /* Headers */, 382 | 21292D511F1EB0E9000BC512 /* Resources */, 383 | ); 384 | buildRules = ( 385 | ); 386 | dependencies = ( 387 | ); 388 | name = "Color-watchOS"; 389 | productName = "Color-watchOS"; 390 | productReference = 21292D531F1EB0E9000BC512 /* Color.framework */; 391 | productType = "com.apple.product-type.framework"; 392 | }; 393 | 21292D5F1F1EB0F3000BC512 /* Color-tvOS */ = { 394 | isa = PBXNativeTarget; 395 | buildConfigurationList = 21292D711F1EB0F3000BC512 /* Build configuration list for PBXNativeTarget "Color-tvOS" */; 396 | buildPhases = ( 397 | 21292D5B1F1EB0F3000BC512 /* Sources */, 398 | 21292D5C1F1EB0F3000BC512 /* Frameworks */, 399 | 21292D5D1F1EB0F3000BC512 /* Headers */, 400 | 21292D5E1F1EB0F3000BC512 /* Resources */, 401 | ); 402 | buildRules = ( 403 | ); 404 | dependencies = ( 405 | ); 406 | name = "Color-tvOS"; 407 | productName = "Color-tvOS"; 408 | productReference = 21292D601F1EB0F3000BC512 /* Color.framework */; 409 | productType = "com.apple.product-type.framework"; 410 | }; 411 | 21292D671F1EB0F3000BC512 /* ColorTests-tvOS */ = { 412 | isa = PBXNativeTarget; 413 | buildConfigurationList = 21292D741F1EB0F3000BC512 /* Build configuration list for PBXNativeTarget "ColorTests-tvOS" */; 414 | buildPhases = ( 415 | 21292D641F1EB0F3000BC512 /* Sources */, 416 | 21292D651F1EB0F3000BC512 /* Frameworks */, 417 | 21292D661F1EB0F3000BC512 /* Resources */, 418 | ); 419 | buildRules = ( 420 | ); 421 | dependencies = ( 422 | 21292D6B1F1EB0F3000BC512 /* PBXTargetDependency */, 423 | ); 424 | name = "ColorTests-tvOS"; 425 | productName = "Color-tvOSTests"; 426 | productReference = 21292D681F1EB0F3000BC512 /* ColorTests.xctest */; 427 | productType = "com.apple.product-type.bundle.unit-test"; 428 | }; 429 | 21BBCEFF1F1C833000AF9F14 /* Color-macOS */ = { 430 | isa = PBXNativeTarget; 431 | buildConfigurationList = 21BBCF141F1C833000AF9F14 /* Build configuration list for PBXNativeTarget "Color-macOS" */; 432 | buildPhases = ( 433 | 21BBCEFB1F1C833000AF9F14 /* Sources */, 434 | 21BBCEFC1F1C833000AF9F14 /* Frameworks */, 435 | 21BBCEFD1F1C833000AF9F14 /* Headers */, 436 | 21BBCEFE1F1C833000AF9F14 /* Resources */, 437 | ); 438 | buildRules = ( 439 | ); 440 | dependencies = ( 441 | ); 442 | name = "Color-macOS"; 443 | productName = Color; 444 | productReference = 21BBCF001F1C833000AF9F14 /* Color.framework */; 445 | productType = "com.apple.product-type.framework"; 446 | }; 447 | 21BBCF081F1C833000AF9F14 /* ColorTests-macOS */ = { 448 | isa = PBXNativeTarget; 449 | buildConfigurationList = 21BBCF171F1C833000AF9F14 /* Build configuration list for PBXNativeTarget "ColorTests-macOS" */; 450 | buildPhases = ( 451 | 21BBCF051F1C833000AF9F14 /* Sources */, 452 | 21BBCF061F1C833000AF9F14 /* Frameworks */, 453 | 21BBCF071F1C833000AF9F14 /* Resources */, 454 | ); 455 | buildRules = ( 456 | ); 457 | dependencies = ( 458 | 21BBCF0C1F1C833000AF9F14 /* PBXTargetDependency */, 459 | ); 460 | name = "ColorTests-macOS"; 461 | productName = ColorTests; 462 | productReference = 21BBCF091F1C833000AF9F14 /* ColorTests.xctest */; 463 | productType = "com.apple.product-type.bundle.unit-test"; 464 | }; 465 | /* End PBXNativeTarget section */ 466 | 467 | /* Begin PBXProject section */ 468 | 21BBCEF71F1C833000AF9F14 /* Project object */ = { 469 | isa = PBXProject; 470 | attributes = { 471 | LastSwiftUpdateCheck = 0830; 472 | LastUpgradeCheck = 1020; 473 | ORGANIZATIONNAME = "Sam Soffes"; 474 | TargetAttributes = { 475 | 21292D361F1EB0C4000BC512 = { 476 | CreatedOnToolsVersion = 8.3.3; 477 | ProvisioningStyle = Automatic; 478 | }; 479 | 21292D3E1F1EB0C4000BC512 = { 480 | CreatedOnToolsVersion = 8.3.3; 481 | ProvisioningStyle = Automatic; 482 | }; 483 | 21292D521F1EB0E9000BC512 = { 484 | CreatedOnToolsVersion = 8.3.3; 485 | ProvisioningStyle = Automatic; 486 | }; 487 | 21292D5F1F1EB0F3000BC512 = { 488 | CreatedOnToolsVersion = 8.3.3; 489 | ProvisioningStyle = Automatic; 490 | }; 491 | 21292D671F1EB0F3000BC512 = { 492 | CreatedOnToolsVersion = 8.3.3; 493 | ProvisioningStyle = Automatic; 494 | }; 495 | 21BBCEFF1F1C833000AF9F14 = { 496 | CreatedOnToolsVersion = 8.3.3; 497 | ProvisioningStyle = Manual; 498 | }; 499 | 21BBCF081F1C833000AF9F14 = { 500 | CreatedOnToolsVersion = 8.3.3; 501 | DevelopmentTeam = UP9C8XM22A; 502 | ProvisioningStyle = Automatic; 503 | }; 504 | }; 505 | }; 506 | buildConfigurationList = 21BBCEFA1F1C833000AF9F14 /* Build configuration list for PBXProject "Color" */; 507 | compatibilityVersion = "Xcode 3.2"; 508 | developmentRegion = en; 509 | hasScannedForEncodings = 0; 510 | knownRegions = ( 511 | en, 512 | Base, 513 | ); 514 | mainGroup = 21BBCEF61F1C833000AF9F14; 515 | productRefGroup = 21BBCF011F1C833000AF9F14 /* Products */; 516 | projectDirPath = ""; 517 | projectRoot = ""; 518 | targets = ( 519 | 21BBCEFF1F1C833000AF9F14 /* Color-macOS */, 520 | 21BBCF081F1C833000AF9F14 /* ColorTests-macOS */, 521 | 21292D361F1EB0C4000BC512 /* Color-iOS */, 522 | 21292D3E1F1EB0C4000BC512 /* ColorTests-iOS */, 523 | 21292D521F1EB0E9000BC512 /* Color-watchOS */, 524 | 21292D5F1F1EB0F3000BC512 /* Color-tvOS */, 525 | 21292D671F1EB0F3000BC512 /* ColorTests-tvOS */, 526 | ); 527 | }; 528 | /* End PBXProject section */ 529 | 530 | /* Begin PBXResourcesBuildPhase section */ 531 | 21292D351F1EB0C4000BC512 /* Resources */ = { 532 | isa = PBXResourcesBuildPhase; 533 | buildActionMask = 2147483647; 534 | files = ( 535 | ); 536 | runOnlyForDeploymentPostprocessing = 0; 537 | }; 538 | 21292D3D1F1EB0C4000BC512 /* Resources */ = { 539 | isa = PBXResourcesBuildPhase; 540 | buildActionMask = 2147483647; 541 | files = ( 542 | ); 543 | runOnlyForDeploymentPostprocessing = 0; 544 | }; 545 | 21292D511F1EB0E9000BC512 /* Resources */ = { 546 | isa = PBXResourcesBuildPhase; 547 | buildActionMask = 2147483647; 548 | files = ( 549 | ); 550 | runOnlyForDeploymentPostprocessing = 0; 551 | }; 552 | 21292D5E1F1EB0F3000BC512 /* Resources */ = { 553 | isa = PBXResourcesBuildPhase; 554 | buildActionMask = 2147483647; 555 | files = ( 556 | ); 557 | runOnlyForDeploymentPostprocessing = 0; 558 | }; 559 | 21292D661F1EB0F3000BC512 /* Resources */ = { 560 | isa = PBXResourcesBuildPhase; 561 | buildActionMask = 2147483647; 562 | files = ( 563 | ); 564 | runOnlyForDeploymentPostprocessing = 0; 565 | }; 566 | 21BBCEFE1F1C833000AF9F14 /* Resources */ = { 567 | isa = PBXResourcesBuildPhase; 568 | buildActionMask = 2147483647; 569 | files = ( 570 | ); 571 | runOnlyForDeploymentPostprocessing = 0; 572 | }; 573 | 21BBCF071F1C833000AF9F14 /* Resources */ = { 574 | isa = PBXResourcesBuildPhase; 575 | buildActionMask = 2147483647; 576 | files = ( 577 | ); 578 | runOnlyForDeploymentPostprocessing = 0; 579 | }; 580 | /* End PBXResourcesBuildPhase section */ 581 | 582 | /* Begin PBXSourcesBuildPhase section */ 583 | 21292D321F1EB0C4000BC512 /* Sources */ = { 584 | isa = PBXSourcesBuildPhase; 585 | buildActionMask = 2147483647; 586 | files = ( 587 | 21D2D52E215361D5001C1D11 /* RGBColor+SystemColor.swift in Sources */, 588 | 2116D96823AB0CCC00FD77BD /* RGBColor+Temperature.swift in Sources */, 589 | 21D2D53A215361D5001C1D11 /* RGBColor+CSS.swift in Sources */, 590 | 21D2D53E215361D5001C1D11 /* HSLColor+SystemColor.swift in Sources */, 591 | 21D2D546215361D5001C1D11 /* RGBColor.swift in Sources */, 592 | 21D2D50A215361D5001C1D11 /* HSLColor.swift in Sources */, 593 | 21D2D536215361D5001C1D11 /* ConformanceLevel+CoreGraphics.swift in Sources */, 594 | 21D2D542215361D5001C1D11 /* SystemColor.swift in Sources */, 595 | 21D2D50E215361D5001C1D11 /* RGBColor+YIQ.swift in Sources */, 596 | 21D2D526215361D5001C1D11 /* HSLColor+NSColor.swift in Sources */, 597 | 21D2D52A215361D5001C1D11 /* RGBColor+Hex.swift in Sources */, 598 | 21D2D512215361D5001C1D11 /* RGBColor+NSColor.swift in Sources */, 599 | 21D2D532215361D5001C1D11 /* HSLColor+Manipulation.swift in Sources */, 600 | 21D2D522215361D5001C1D11 /* HSLColor+UIColor.swift in Sources */, 601 | 21D2D51E215361D5001C1D11 /* RGBColor+WCAG.swift in Sources */, 602 | 21D2D51A215361D5001C1D11 /* ConformanceLevel.swift in Sources */, 603 | 21D2D516215361D5001C1D11 /* RGBColor+UIColor.swift in Sources */, 604 | ); 605 | runOnlyForDeploymentPostprocessing = 0; 606 | }; 607 | 21292D3B1F1EB0C4000BC512 /* Sources */ = { 608 | isa = PBXSourcesBuildPhase; 609 | buildActionMask = 2147483647; 610 | files = ( 611 | 2169E17723AB0FD500AFDA6B /* TestHelper.swift in Sources */, 612 | 2116D96D23AB0D2E00FD77BD /* TemperatureTests.swift in Sources */, 613 | 21D2D551215361DD001C1D11 /* ColorTests.swift in Sources */, 614 | ); 615 | runOnlyForDeploymentPostprocessing = 0; 616 | }; 617 | 21292D4E1F1EB0E9000BC512 /* Sources */ = { 618 | isa = PBXSourcesBuildPhase; 619 | buildActionMask = 2147483647; 620 | files = ( 621 | 21D2D52F215361D5001C1D11 /* RGBColor+SystemColor.swift in Sources */, 622 | 2116D96923AB0CCC00FD77BD /* RGBColor+Temperature.swift in Sources */, 623 | 21D2D53B215361D5001C1D11 /* RGBColor+CSS.swift in Sources */, 624 | 21D2D53F215361D5001C1D11 /* HSLColor+SystemColor.swift in Sources */, 625 | 21D2D547215361D5001C1D11 /* RGBColor.swift in Sources */, 626 | 21D2D50B215361D5001C1D11 /* HSLColor.swift in Sources */, 627 | 21D2D537215361D5001C1D11 /* ConformanceLevel+CoreGraphics.swift in Sources */, 628 | 21D2D543215361D5001C1D11 /* SystemColor.swift in Sources */, 629 | 21D2D50F215361D5001C1D11 /* RGBColor+YIQ.swift in Sources */, 630 | 21D2D527215361D5001C1D11 /* HSLColor+NSColor.swift in Sources */, 631 | 21D2D52B215361D5001C1D11 /* RGBColor+Hex.swift in Sources */, 632 | 21D2D513215361D5001C1D11 /* RGBColor+NSColor.swift in Sources */, 633 | 21D2D533215361D5001C1D11 /* HSLColor+Manipulation.swift in Sources */, 634 | 21D2D523215361D5001C1D11 /* HSLColor+UIColor.swift in Sources */, 635 | 21D2D51F215361D5001C1D11 /* RGBColor+WCAG.swift in Sources */, 636 | 21D2D51B215361D5001C1D11 /* ConformanceLevel.swift in Sources */, 637 | 21D2D517215361D5001C1D11 /* RGBColor+UIColor.swift in Sources */, 638 | ); 639 | runOnlyForDeploymentPostprocessing = 0; 640 | }; 641 | 21292D5B1F1EB0F3000BC512 /* Sources */ = { 642 | isa = PBXSourcesBuildPhase; 643 | buildActionMask = 2147483647; 644 | files = ( 645 | 21D2D530215361D5001C1D11 /* RGBColor+SystemColor.swift in Sources */, 646 | 2116D96A23AB0CCC00FD77BD /* RGBColor+Temperature.swift in Sources */, 647 | 21D2D53C215361D5001C1D11 /* RGBColor+CSS.swift in Sources */, 648 | 21D2D540215361D5001C1D11 /* HSLColor+SystemColor.swift in Sources */, 649 | 21D2D548215361D5001C1D11 /* RGBColor.swift in Sources */, 650 | 21D2D50C215361D5001C1D11 /* HSLColor.swift in Sources */, 651 | 21D2D538215361D5001C1D11 /* ConformanceLevel+CoreGraphics.swift in Sources */, 652 | 21D2D544215361D5001C1D11 /* SystemColor.swift in Sources */, 653 | 21D2D510215361D5001C1D11 /* RGBColor+YIQ.swift in Sources */, 654 | 21D2D528215361D5001C1D11 /* HSLColor+NSColor.swift in Sources */, 655 | 21D2D52C215361D5001C1D11 /* RGBColor+Hex.swift in Sources */, 656 | 21D2D514215361D5001C1D11 /* RGBColor+NSColor.swift in Sources */, 657 | 21D2D534215361D5001C1D11 /* HSLColor+Manipulation.swift in Sources */, 658 | 21D2D524215361D5001C1D11 /* HSLColor+UIColor.swift in Sources */, 659 | 21D2D520215361D5001C1D11 /* RGBColor+WCAG.swift in Sources */, 660 | 21D2D51C215361D5001C1D11 /* ConformanceLevel.swift in Sources */, 661 | 21D2D518215361D5001C1D11 /* RGBColor+UIColor.swift in Sources */, 662 | ); 663 | runOnlyForDeploymentPostprocessing = 0; 664 | }; 665 | 21292D641F1EB0F3000BC512 /* Sources */ = { 666 | isa = PBXSourcesBuildPhase; 667 | buildActionMask = 2147483647; 668 | files = ( 669 | 2169E17823AB0FD500AFDA6B /* TestHelper.swift in Sources */, 670 | 2116D96E23AB0D2E00FD77BD /* TemperatureTests.swift in Sources */, 671 | 21D2D552215361DD001C1D11 /* ColorTests.swift in Sources */, 672 | ); 673 | runOnlyForDeploymentPostprocessing = 0; 674 | }; 675 | 21BBCEFB1F1C833000AF9F14 /* Sources */ = { 676 | isa = PBXSourcesBuildPhase; 677 | buildActionMask = 2147483647; 678 | files = ( 679 | 21D2D52D215361D5001C1D11 /* RGBColor+SystemColor.swift in Sources */, 680 | 2116D96723AB0CCC00FD77BD /* RGBColor+Temperature.swift in Sources */, 681 | 21D2D539215361D5001C1D11 /* RGBColor+CSS.swift in Sources */, 682 | 21D2D53D215361D5001C1D11 /* HSLColor+SystemColor.swift in Sources */, 683 | 21D2D545215361D5001C1D11 /* RGBColor.swift in Sources */, 684 | 21D2D509215361D5001C1D11 /* HSLColor.swift in Sources */, 685 | 21D2D535215361D5001C1D11 /* ConformanceLevel+CoreGraphics.swift in Sources */, 686 | 21D2D541215361D5001C1D11 /* SystemColor.swift in Sources */, 687 | 21D2D50D215361D5001C1D11 /* RGBColor+YIQ.swift in Sources */, 688 | 21D2D525215361D5001C1D11 /* HSLColor+NSColor.swift in Sources */, 689 | 21D2D529215361D5001C1D11 /* RGBColor+Hex.swift in Sources */, 690 | 21D2D511215361D5001C1D11 /* RGBColor+NSColor.swift in Sources */, 691 | 21D2D531215361D5001C1D11 /* HSLColor+Manipulation.swift in Sources */, 692 | 21D2D521215361D5001C1D11 /* HSLColor+UIColor.swift in Sources */, 693 | 21D2D51D215361D5001C1D11 /* RGBColor+WCAG.swift in Sources */, 694 | 21D2D519215361D5001C1D11 /* ConformanceLevel.swift in Sources */, 695 | 21D2D515215361D5001C1D11 /* RGBColor+UIColor.swift in Sources */, 696 | ); 697 | runOnlyForDeploymentPostprocessing = 0; 698 | }; 699 | 21BBCF051F1C833000AF9F14 /* Sources */ = { 700 | isa = PBXSourcesBuildPhase; 701 | buildActionMask = 2147483647; 702 | files = ( 703 | 2169E17623AB0FD500AFDA6B /* TestHelper.swift in Sources */, 704 | 2116D96C23AB0D2E00FD77BD /* TemperatureTests.swift in Sources */, 705 | 21D2D550215361DD001C1D11 /* ColorTests.swift in Sources */, 706 | ); 707 | runOnlyForDeploymentPostprocessing = 0; 708 | }; 709 | /* End PBXSourcesBuildPhase section */ 710 | 711 | /* Begin PBXTargetDependency section */ 712 | 21292D421F1EB0C4000BC512 /* PBXTargetDependency */ = { 713 | isa = PBXTargetDependency; 714 | target = 21292D361F1EB0C4000BC512 /* Color-iOS */; 715 | targetProxy = 21292D411F1EB0C4000BC512 /* PBXContainerItemProxy */; 716 | }; 717 | 21292D6B1F1EB0F3000BC512 /* PBXTargetDependency */ = { 718 | isa = PBXTargetDependency; 719 | target = 21292D5F1F1EB0F3000BC512 /* Color-tvOS */; 720 | targetProxy = 21292D6A1F1EB0F3000BC512 /* PBXContainerItemProxy */; 721 | }; 722 | 21BBCF0C1F1C833000AF9F14 /* PBXTargetDependency */ = { 723 | isa = PBXTargetDependency; 724 | target = 21BBCEFF1F1C833000AF9F14 /* Color-macOS */; 725 | targetProxy = 21BBCF0B1F1C833000AF9F14 /* PBXContainerItemProxy */; 726 | }; 727 | /* End PBXTargetDependency section */ 728 | 729 | /* Begin XCBuildConfiguration section */ 730 | 21292D481F1EB0C4000BC512 /* Debug */ = { 731 | isa = XCBuildConfiguration; 732 | buildSettings = { 733 | CODE_SIGN_IDENTITY = ""; 734 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 735 | DEFINES_MODULE = YES; 736 | DYLIB_COMPATIBILITY_VERSION = 1; 737 | DYLIB_CURRENT_VERSION = 1; 738 | DYLIB_INSTALL_NAME_BASE = "@rpath"; 739 | INFOPLIST_FILE = "$(SRCROOT)/Sources/Color/Support/Info.plist"; 740 | INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; 741 | IPHONEOS_DEPLOYMENT_TARGET = 8.0; 742 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; 743 | PRODUCT_BUNDLE_IDENTIFIER = com.samsoffes.color; 744 | PRODUCT_NAME = Color; 745 | SDKROOT = iphoneos; 746 | SKIP_INSTALL = YES; 747 | TARGETED_DEVICE_FAMILY = "1,2"; 748 | }; 749 | name = Debug; 750 | }; 751 | 21292D491F1EB0C4000BC512 /* Release */ = { 752 | isa = XCBuildConfiguration; 753 | buildSettings = { 754 | CODE_SIGN_IDENTITY = ""; 755 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 756 | DEFINES_MODULE = YES; 757 | DYLIB_COMPATIBILITY_VERSION = 1; 758 | DYLIB_CURRENT_VERSION = 1; 759 | DYLIB_INSTALL_NAME_BASE = "@rpath"; 760 | INFOPLIST_FILE = "$(SRCROOT)/Sources/Color/Support/Info.plist"; 761 | INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; 762 | IPHONEOS_DEPLOYMENT_TARGET = 8.0; 763 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; 764 | PRODUCT_BUNDLE_IDENTIFIER = com.samsoffes.color; 765 | PRODUCT_NAME = Color; 766 | SDKROOT = iphoneos; 767 | SKIP_INSTALL = YES; 768 | TARGETED_DEVICE_FAMILY = "1,2"; 769 | VALIDATE_PRODUCT = YES; 770 | }; 771 | name = Release; 772 | }; 773 | 21292D4A1F1EB0C4000BC512 /* Debug */ = { 774 | isa = XCBuildConfiguration; 775 | buildSettings = { 776 | ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES; 777 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 778 | INFOPLIST_FILE = "Sources/Color/Support/Tests-Info.plist"; 779 | IPHONEOS_DEPLOYMENT_TARGET = 10.3; 780 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; 781 | PRODUCT_BUNDLE_IDENTIFIER = com.samsoffes.color.tests; 782 | PRODUCT_NAME = ColorTests; 783 | SDKROOT = iphoneos; 784 | }; 785 | name = Debug; 786 | }; 787 | 21292D4B1F1EB0C4000BC512 /* Release */ = { 788 | isa = XCBuildConfiguration; 789 | buildSettings = { 790 | ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES; 791 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 792 | INFOPLIST_FILE = "Sources/Color/Support/Tests-Info.plist"; 793 | IPHONEOS_DEPLOYMENT_TARGET = 10.3; 794 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; 795 | PRODUCT_BUNDLE_IDENTIFIER = com.samsoffes.color.tests; 796 | PRODUCT_NAME = ColorTests; 797 | SDKROOT = iphoneos; 798 | VALIDATE_PRODUCT = YES; 799 | }; 800 | name = Release; 801 | }; 802 | 21292D591F1EB0E9000BC512 /* Debug */ = { 803 | isa = XCBuildConfiguration; 804 | buildSettings = { 805 | APPLICATION_EXTENSION_API_ONLY = YES; 806 | CODE_SIGN_IDENTITY = ""; 807 | DEFINES_MODULE = YES; 808 | DYLIB_COMPATIBILITY_VERSION = 1; 809 | DYLIB_CURRENT_VERSION = 1; 810 | DYLIB_INSTALL_NAME_BASE = "@rpath"; 811 | INFOPLIST_FILE = "$(SRCROOT)/Sources/Color/Support/Info.plist"; 812 | INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; 813 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; 814 | PRODUCT_BUNDLE_IDENTIFIER = com.samsoffes.color; 815 | PRODUCT_NAME = Color; 816 | SDKROOT = watchos; 817 | SKIP_INSTALL = YES; 818 | TARGETED_DEVICE_FAMILY = 4; 819 | WATCHOS_DEPLOYMENT_TARGET = 2.0; 820 | }; 821 | name = Debug; 822 | }; 823 | 21292D5A1F1EB0E9000BC512 /* Release */ = { 824 | isa = XCBuildConfiguration; 825 | buildSettings = { 826 | APPLICATION_EXTENSION_API_ONLY = YES; 827 | CODE_SIGN_IDENTITY = ""; 828 | DEFINES_MODULE = YES; 829 | DYLIB_COMPATIBILITY_VERSION = 1; 830 | DYLIB_CURRENT_VERSION = 1; 831 | DYLIB_INSTALL_NAME_BASE = "@rpath"; 832 | INFOPLIST_FILE = "$(SRCROOT)/Sources/Color/Support/Info.plist"; 833 | INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; 834 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; 835 | PRODUCT_BUNDLE_IDENTIFIER = com.samsoffes.color; 836 | PRODUCT_NAME = Color; 837 | SDKROOT = watchos; 838 | SKIP_INSTALL = YES; 839 | TARGETED_DEVICE_FAMILY = 4; 840 | VALIDATE_PRODUCT = YES; 841 | WATCHOS_DEPLOYMENT_TARGET = 2.0; 842 | }; 843 | name = Release; 844 | }; 845 | 21292D721F1EB0F3000BC512 /* Debug */ = { 846 | isa = XCBuildConfiguration; 847 | buildSettings = { 848 | CODE_SIGN_IDENTITY = ""; 849 | DEFINES_MODULE = YES; 850 | DYLIB_COMPATIBILITY_VERSION = 1; 851 | DYLIB_CURRENT_VERSION = 1; 852 | DYLIB_INSTALL_NAME_BASE = "@rpath"; 853 | INFOPLIST_FILE = "$(SRCROOT)/Sources/Color/Support/Info.plist"; 854 | INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; 855 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; 856 | PRODUCT_BUNDLE_IDENTIFIER = com.samsoffes.color; 857 | PRODUCT_NAME = Color; 858 | SDKROOT = appletvos; 859 | SKIP_INSTALL = YES; 860 | TARGETED_DEVICE_FAMILY = 3; 861 | TVOS_DEPLOYMENT_TARGET = 9.0; 862 | }; 863 | name = Debug; 864 | }; 865 | 21292D731F1EB0F3000BC512 /* Release */ = { 866 | isa = XCBuildConfiguration; 867 | buildSettings = { 868 | CODE_SIGN_IDENTITY = ""; 869 | DEFINES_MODULE = YES; 870 | DYLIB_COMPATIBILITY_VERSION = 1; 871 | DYLIB_CURRENT_VERSION = 1; 872 | DYLIB_INSTALL_NAME_BASE = "@rpath"; 873 | INFOPLIST_FILE = "$(SRCROOT)/Sources/Color/Support/Info.plist"; 874 | INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; 875 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; 876 | PRODUCT_BUNDLE_IDENTIFIER = com.samsoffes.color; 877 | PRODUCT_NAME = Color; 878 | SDKROOT = appletvos; 879 | SKIP_INSTALL = YES; 880 | TARGETED_DEVICE_FAMILY = 3; 881 | TVOS_DEPLOYMENT_TARGET = 9.0; 882 | VALIDATE_PRODUCT = YES; 883 | }; 884 | name = Release; 885 | }; 886 | 21292D751F1EB0F3000BC512 /* Debug */ = { 887 | isa = XCBuildConfiguration; 888 | buildSettings = { 889 | ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES; 890 | INFOPLIST_FILE = "Sources/Color/Support/Tests-Info.plist"; 891 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; 892 | PRODUCT_BUNDLE_IDENTIFIER = com.samsoffes.color.tests; 893 | PRODUCT_NAME = ColorTests; 894 | SDKROOT = appletvos; 895 | TVOS_DEPLOYMENT_TARGET = 10.2; 896 | }; 897 | name = Debug; 898 | }; 899 | 21292D761F1EB0F3000BC512 /* Release */ = { 900 | isa = XCBuildConfiguration; 901 | buildSettings = { 902 | ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES; 903 | INFOPLIST_FILE = "Sources/Color/Support/Tests-Info.plist"; 904 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; 905 | PRODUCT_BUNDLE_IDENTIFIER = com.samsoffes.color.tests; 906 | PRODUCT_NAME = ColorTests; 907 | SDKROOT = appletvos; 908 | TVOS_DEPLOYMENT_TARGET = 10.2; 909 | VALIDATE_PRODUCT = YES; 910 | }; 911 | name = Release; 912 | }; 913 | 21BBCF121F1C833000AF9F14 /* Debug */ = { 914 | isa = XCBuildConfiguration; 915 | buildSettings = { 916 | ALWAYS_SEARCH_USER_PATHS = NO; 917 | CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES; 918 | CLANG_ANALYZER_NONNULL = YES; 919 | CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; 920 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 921 | CLANG_CXX_LIBRARY = "libc++"; 922 | CLANG_ENABLE_MODULES = YES; 923 | CLANG_ENABLE_OBJC_ARC = YES; 924 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; 925 | CLANG_WARN_BOOL_CONVERSION = YES; 926 | CLANG_WARN_COMMA = YES; 927 | CLANG_WARN_CONSTANT_CONVERSION = YES; 928 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; 929 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 930 | CLANG_WARN_DOCUMENTATION_COMMENTS = YES; 931 | CLANG_WARN_EMPTY_BODY = YES; 932 | CLANG_WARN_ENUM_CONVERSION = YES; 933 | CLANG_WARN_INFINITE_RECURSION = YES; 934 | CLANG_WARN_INT_CONVERSION = YES; 935 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; 936 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; 937 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; 938 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 939 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; 940 | CLANG_WARN_STRICT_PROTOTYPES = YES; 941 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 942 | CLANG_WARN_UNREACHABLE_CODE = YES; 943 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 944 | CODE_SIGN_IDENTITY = "-"; 945 | COPY_PHASE_STRIP = NO; 946 | CURRENT_PROJECT_VERSION = 1; 947 | DEBUG_INFORMATION_FORMAT = dwarf; 948 | ENABLE_STRICT_OBJC_MSGSEND = YES; 949 | ENABLE_TESTABILITY = YES; 950 | GCC_C_LANGUAGE_STANDARD = gnu99; 951 | GCC_DYNAMIC_NO_PIC = NO; 952 | GCC_NO_COMMON_BLOCKS = YES; 953 | GCC_OPTIMIZATION_LEVEL = 0; 954 | GCC_PREPROCESSOR_DEFINITIONS = ( 955 | "DEBUG=1", 956 | "$(inherited)", 957 | ); 958 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 959 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 960 | GCC_WARN_UNDECLARED_SELECTOR = YES; 961 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 962 | GCC_WARN_UNUSED_FUNCTION = YES; 963 | GCC_WARN_UNUSED_VARIABLE = YES; 964 | MTL_ENABLE_DEBUG_INFO = YES; 965 | ONLY_ACTIVE_ARCH = YES; 966 | SDKROOT = macosx; 967 | SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG; 968 | SWIFT_OPTIMIZATION_LEVEL = "-Onone"; 969 | SWIFT_VERSION = 5.0; 970 | VERSIONING_SYSTEM = "apple-generic"; 971 | VERSION_INFO_PREFIX = ""; 972 | }; 973 | name = Debug; 974 | }; 975 | 21BBCF131F1C833000AF9F14 /* Release */ = { 976 | isa = XCBuildConfiguration; 977 | buildSettings = { 978 | ALWAYS_SEARCH_USER_PATHS = NO; 979 | CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES; 980 | CLANG_ANALYZER_NONNULL = YES; 981 | CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; 982 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 983 | CLANG_CXX_LIBRARY = "libc++"; 984 | CLANG_ENABLE_MODULES = YES; 985 | CLANG_ENABLE_OBJC_ARC = YES; 986 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; 987 | CLANG_WARN_BOOL_CONVERSION = YES; 988 | CLANG_WARN_COMMA = YES; 989 | CLANG_WARN_CONSTANT_CONVERSION = YES; 990 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; 991 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 992 | CLANG_WARN_DOCUMENTATION_COMMENTS = YES; 993 | CLANG_WARN_EMPTY_BODY = YES; 994 | CLANG_WARN_ENUM_CONVERSION = YES; 995 | CLANG_WARN_INFINITE_RECURSION = YES; 996 | CLANG_WARN_INT_CONVERSION = YES; 997 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; 998 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; 999 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; 1000 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 1001 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; 1002 | CLANG_WARN_STRICT_PROTOTYPES = YES; 1003 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 1004 | CLANG_WARN_UNREACHABLE_CODE = YES; 1005 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 1006 | CODE_SIGN_IDENTITY = "-"; 1007 | COPY_PHASE_STRIP = NO; 1008 | CURRENT_PROJECT_VERSION = 1; 1009 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; 1010 | ENABLE_NS_ASSERTIONS = NO; 1011 | ENABLE_STRICT_OBJC_MSGSEND = YES; 1012 | GCC_C_LANGUAGE_STANDARD = gnu99; 1013 | GCC_NO_COMMON_BLOCKS = YES; 1014 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 1015 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 1016 | GCC_WARN_UNDECLARED_SELECTOR = YES; 1017 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 1018 | GCC_WARN_UNUSED_FUNCTION = YES; 1019 | GCC_WARN_UNUSED_VARIABLE = YES; 1020 | MTL_ENABLE_DEBUG_INFO = NO; 1021 | SDKROOT = macosx; 1022 | SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule"; 1023 | SWIFT_VERSION = 5.0; 1024 | VERSIONING_SYSTEM = "apple-generic"; 1025 | VERSION_INFO_PREFIX = ""; 1026 | }; 1027 | name = Release; 1028 | }; 1029 | 21BBCF151F1C833000AF9F14 /* Debug */ = { 1030 | isa = XCBuildConfiguration; 1031 | buildSettings = { 1032 | APPLICATION_EXTENSION_API_ONLY = YES; 1033 | CODE_SIGN_IDENTITY = ""; 1034 | COMBINE_HIDPI_IMAGES = YES; 1035 | DEFINES_MODULE = YES; 1036 | DEVELOPMENT_TEAM = ""; 1037 | DYLIB_COMPATIBILITY_VERSION = 1; 1038 | DYLIB_CURRENT_VERSION = 1; 1039 | DYLIB_INSTALL_NAME_BASE = "@rpath"; 1040 | FRAMEWORK_VERSION = A; 1041 | INFOPLIST_FILE = "$(SRCROOT)/Sources/Color/Support/Info.plist"; 1042 | INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; 1043 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks @loader_path/Frameworks"; 1044 | MACOSX_DEPLOYMENT_TARGET = 10.10; 1045 | PRODUCT_BUNDLE_IDENTIFIER = com.samsoffes.color; 1046 | PRODUCT_NAME = Color; 1047 | PROVISIONING_PROFILE_SPECIFIER = ""; 1048 | SKIP_INSTALL = YES; 1049 | }; 1050 | name = Debug; 1051 | }; 1052 | 21BBCF161F1C833000AF9F14 /* Release */ = { 1053 | isa = XCBuildConfiguration; 1054 | buildSettings = { 1055 | APPLICATION_EXTENSION_API_ONLY = YES; 1056 | CODE_SIGN_IDENTITY = ""; 1057 | COMBINE_HIDPI_IMAGES = YES; 1058 | DEFINES_MODULE = YES; 1059 | DEVELOPMENT_TEAM = ""; 1060 | DYLIB_COMPATIBILITY_VERSION = 1; 1061 | DYLIB_CURRENT_VERSION = 1; 1062 | DYLIB_INSTALL_NAME_BASE = "@rpath"; 1063 | FRAMEWORK_VERSION = A; 1064 | INFOPLIST_FILE = "$(SRCROOT)/Sources/Color/Support/Info.plist"; 1065 | INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; 1066 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks @loader_path/Frameworks"; 1067 | MACOSX_DEPLOYMENT_TARGET = 10.10; 1068 | PRODUCT_BUNDLE_IDENTIFIER = com.samsoffes.color; 1069 | PRODUCT_NAME = Color; 1070 | PROVISIONING_PROFILE_SPECIFIER = ""; 1071 | SKIP_INSTALL = YES; 1072 | }; 1073 | name = Release; 1074 | }; 1075 | 21BBCF181F1C833000AF9F14 /* Debug */ = { 1076 | isa = XCBuildConfiguration; 1077 | buildSettings = { 1078 | ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES; 1079 | COMBINE_HIDPI_IMAGES = YES; 1080 | INFOPLIST_FILE = "Sources/Color/Support/Tests-Info.plist"; 1081 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks @loader_path/../Frameworks"; 1082 | PRODUCT_BUNDLE_IDENTIFIER = com.samsoffes.color.tests; 1083 | PRODUCT_NAME = ColorTests; 1084 | }; 1085 | name = Debug; 1086 | }; 1087 | 21BBCF191F1C833000AF9F14 /* Release */ = { 1088 | isa = XCBuildConfiguration; 1089 | buildSettings = { 1090 | ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES; 1091 | COMBINE_HIDPI_IMAGES = YES; 1092 | INFOPLIST_FILE = "Sources/Color/Support/Tests-Info.plist"; 1093 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks @loader_path/../Frameworks"; 1094 | PRODUCT_BUNDLE_IDENTIFIER = com.samsoffes.color.tests; 1095 | PRODUCT_NAME = ColorTests; 1096 | }; 1097 | name = Release; 1098 | }; 1099 | /* End XCBuildConfiguration section */ 1100 | 1101 | /* Begin XCConfigurationList section */ 1102 | 21292D4C1F1EB0C4000BC512 /* Build configuration list for PBXNativeTarget "Color-iOS" */ = { 1103 | isa = XCConfigurationList; 1104 | buildConfigurations = ( 1105 | 21292D481F1EB0C4000BC512 /* Debug */, 1106 | 21292D491F1EB0C4000BC512 /* Release */, 1107 | ); 1108 | defaultConfigurationIsVisible = 0; 1109 | defaultConfigurationName = Release; 1110 | }; 1111 | 21292D4D1F1EB0C4000BC512 /* Build configuration list for PBXNativeTarget "ColorTests-iOS" */ = { 1112 | isa = XCConfigurationList; 1113 | buildConfigurations = ( 1114 | 21292D4A1F1EB0C4000BC512 /* Debug */, 1115 | 21292D4B1F1EB0C4000BC512 /* Release */, 1116 | ); 1117 | defaultConfigurationIsVisible = 0; 1118 | defaultConfigurationName = Release; 1119 | }; 1120 | 21292D581F1EB0E9000BC512 /* Build configuration list for PBXNativeTarget "Color-watchOS" */ = { 1121 | isa = XCConfigurationList; 1122 | buildConfigurations = ( 1123 | 21292D591F1EB0E9000BC512 /* Debug */, 1124 | 21292D5A1F1EB0E9000BC512 /* Release */, 1125 | ); 1126 | defaultConfigurationIsVisible = 0; 1127 | defaultConfigurationName = Release; 1128 | }; 1129 | 21292D711F1EB0F3000BC512 /* Build configuration list for PBXNativeTarget "Color-tvOS" */ = { 1130 | isa = XCConfigurationList; 1131 | buildConfigurations = ( 1132 | 21292D721F1EB0F3000BC512 /* Debug */, 1133 | 21292D731F1EB0F3000BC512 /* Release */, 1134 | ); 1135 | defaultConfigurationIsVisible = 0; 1136 | defaultConfigurationName = Release; 1137 | }; 1138 | 21292D741F1EB0F3000BC512 /* Build configuration list for PBXNativeTarget "ColorTests-tvOS" */ = { 1139 | isa = XCConfigurationList; 1140 | buildConfigurations = ( 1141 | 21292D751F1EB0F3000BC512 /* Debug */, 1142 | 21292D761F1EB0F3000BC512 /* Release */, 1143 | ); 1144 | defaultConfigurationIsVisible = 0; 1145 | defaultConfigurationName = Release; 1146 | }; 1147 | 21BBCEFA1F1C833000AF9F14 /* Build configuration list for PBXProject "Color" */ = { 1148 | isa = XCConfigurationList; 1149 | buildConfigurations = ( 1150 | 21BBCF121F1C833000AF9F14 /* Debug */, 1151 | 21BBCF131F1C833000AF9F14 /* Release */, 1152 | ); 1153 | defaultConfigurationIsVisible = 0; 1154 | defaultConfigurationName = Release; 1155 | }; 1156 | 21BBCF141F1C833000AF9F14 /* Build configuration list for PBXNativeTarget "Color-macOS" */ = { 1157 | isa = XCConfigurationList; 1158 | buildConfigurations = ( 1159 | 21BBCF151F1C833000AF9F14 /* Debug */, 1160 | 21BBCF161F1C833000AF9F14 /* Release */, 1161 | ); 1162 | defaultConfigurationIsVisible = 0; 1163 | defaultConfigurationName = Release; 1164 | }; 1165 | 21BBCF171F1C833000AF9F14 /* Build configuration list for PBXNativeTarget "ColorTests-macOS" */ = { 1166 | isa = XCConfigurationList; 1167 | buildConfigurations = ( 1168 | 21BBCF181F1C833000AF9F14 /* Debug */, 1169 | 21BBCF191F1C833000AF9F14 /* Release */, 1170 | ); 1171 | defaultConfigurationIsVisible = 0; 1172 | defaultConfigurationName = Release; 1173 | }; 1174 | /* End XCConfigurationList section */ 1175 | }; 1176 | rootObject = 21BBCEF71F1C833000AF9F14 /* Project object */; 1177 | } 1178 | -------------------------------------------------------------------------------- /Color.xcodeproj/xcshareddata/xcschemes/Color-iOS.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 24 | 25 | 30 | 31 | 33 | 39 | 40 | 41 | 42 | 43 | 49 | 50 | 51 | 52 | 53 | 54 | 64 | 65 | 71 | 72 | 73 | 74 | 75 | 76 | 82 | 83 | 89 | 90 | 91 | 92 | 94 | 95 | 98 | 99 | 100 | -------------------------------------------------------------------------------- /Color.xcodeproj/xcshareddata/xcschemes/Color-macOS.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 24 | 25 | 30 | 31 | 33 | 39 | 40 | 41 | 42 | 43 | 49 | 50 | 51 | 52 | 53 | 54 | 64 | 65 | 71 | 72 | 73 | 74 | 75 | 76 | 82 | 83 | 89 | 90 | 91 | 92 | 94 | 95 | 98 | 99 | 100 | -------------------------------------------------------------------------------- /Color.xcodeproj/xcshareddata/xcschemes/Color-tvOS.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 24 | 25 | 30 | 31 | 33 | 39 | 40 | 41 | 42 | 43 | 49 | 50 | 51 | 52 | 53 | 54 | 64 | 65 | 71 | 72 | 73 | 74 | 75 | 76 | 82 | 83 | 89 | 90 | 91 | 92 | 94 | 95 | 98 | 99 | 100 | -------------------------------------------------------------------------------- /Color.xcodeproj/xcshareddata/xcschemes/Color-watchOS.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 24 | 25 | 30 | 31 | 32 | 33 | 34 | 35 | 45 | 46 | 52 | 53 | 54 | 55 | 56 | 57 | 63 | 64 | 70 | 71 | 72 | 73 | 75 | 76 | 79 | 80 | 81 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2017 Sam Soffes, https://soff.es 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 | -------------------------------------------------------------------------------- /Package.swift: -------------------------------------------------------------------------------- 1 | // swift-tools-version:5.1 2 | 3 | import PackageDescription 4 | 5 | let package = Package( 6 | name: "Color", 7 | products: [ 8 | .library(name: "Color", targets: ["Color"]) 9 | ], 10 | targets: [ 11 | .target(name: "Color"), 12 | .testTarget(name: "ColorTests", dependencies: ["Color"]) 13 | ] 14 | ) 15 | -------------------------------------------------------------------------------- /Readme.markdown: -------------------------------------------------------------------------------- 1 | # Color 2 | 3 | [![Version](https://img.shields.io/github/release/soffes/Color.svg)](https://github.com/soffes/Color/releases) 4 | [![Build Status](https://github.com/soffes/Color/workflows/Tests/badge.svg)](https://github.com/soffes/Color/actions) 5 | ![Swift Version](https://img.shields.io/badge/swift-5.0.1-orange.svg) 6 | [![Carthage compatible](https://img.shields.io/badge/Carthage-compatible-4BC51D.svg?style=flat)](https://github.com/Carthage/Carthage) 7 | 8 | Color utilities in pure Swift for macOS, iOS, watchOS, and tvOS. Color supports Carthage and Swift Package Manager. It is also [tested](https://travis-ci.org/soffes/Color) on Linux. 9 | 10 | **Color was abstracted from [Contrast](https://usecontrast.com), a macOS app for checking designs for accessible color combinations.** 11 | 12 | 13 | ## Installation 14 | 15 | ### Carthage 16 | 17 | Add the following to your Cartfile: 18 | 19 | ```ruby 20 | github "soffes/Color" 21 | ``` 22 | 23 | ### Swift Package Manager 24 | 25 | Add the following to your `dependencies` in your Package.swift: 26 | 27 | ```swift 28 | .package(url: "https://github.com/soffes/Color.git", from: "0.1.1") 29 | ``` 30 | 31 | 32 | ## Usage 33 | 34 | Color provides structs for different color models. Currently only RGB and HSL are supported. Most color calculations are specific to a color model. For example, darkening a color is only available for HSL colors and not RGB colors. If you'd like to darken an RGB color, you’ll need to convert to HSL first. Here’s an example: 35 | 36 | ```swift 37 | let rgb = RGBColor(red: 1, green: 0, blue: 0) 38 | let hsl = HSLColor(rgb: rgb) 39 | let darkerRed = hsl.darkening() 40 | ``` 41 | 42 | Note that Color’s structs don’t support alpha since that isn’t used in any of the color calculations. This may be added in the future. 43 | 44 | Hex conversions are only available for RGB colors. 45 | 46 | ```swift 47 | let rgb = RGBColor(hex: "0f0")! 48 | rgb.hex // "00ff00" 49 | ``` 50 | 51 | 52 | ### NSColor & UIColor 53 | 54 | There are convenience methods on `NSColor` & `UIColor` if you are working in a Cocoa application. Each color model (`RGBColor`, `HSLColor`, etc.) has an extension for `SystemColorType` which is either `NSColor` or `UIColor` depending on the platform. Here's a few examples: 55 | 56 | ```swift 57 | UIColor.red.darkening() 58 | UIColor.green.desaturating() 59 | NSColor.blue.isDark 60 | ``` 61 | 62 | 63 | ### WCAG 64 | 65 | RGB colors also have [WCAG 2.0](https://www.w3.org/TR/WCAG20) calculations. First, calculate a contrast ratio: 66 | 67 | ```swift 68 | let color1 = RGBColor(red: 170.0 / 255.0, green: 204.0 / 255.0, blue: 1) 69 | let color2 = RGBColor(red: 34.0 / 255.0, green: 34.0 / 255.0, blue: 51.0 / 255.0) 70 | let contrastRatio = color1.contrastRatio(to: color2) // 9.51 71 | ``` 72 | 73 | Now, you can check the conformance level: 74 | 75 | ```swift 76 | ConformanceLevel(contrastRatio: contrastRatio) // .aaa 77 | ``` 78 | 79 | 80 | ## Thanks 81 | 82 | Thanks to [color](https://github.com/Qix-/color) & [color-convert](https://github.com/Qix-/color-convert) for inspiration. 83 | -------------------------------------------------------------------------------- /Sources/Color/Sources/ConformanceLevel+CoreGraphics.swift: -------------------------------------------------------------------------------- 1 | #if os(OSX) || os(iOS) || os(watchOS) || os(tvOS) 2 | #if os(iOS) || os(watchOS) || os(tvOS) 3 | import CoreGraphics 4 | #else 5 | import QuartzCore 6 | #endif 7 | 8 | extension ConformanceLevel { 9 | public init(contrastRatio: CGFloat) { 10 | self.init(contrastRatio: Double(contrastRatio)) 11 | } 12 | } 13 | #endif 14 | -------------------------------------------------------------------------------- /Sources/Color/Sources/ConformanceLevel.swift: -------------------------------------------------------------------------------- 1 | /// Derived from the Web Content Accessibility Guidelines (WCAG) 2.0 conformance 2 | /// 3 | /// From https://www.w3.org/TR/WCAG20 4 | public enum ConformanceLevel: Int { 5 | 6 | // MARK: - Cases 7 | 8 | /// Failing score 9 | /// 10 | /// Does not meet a WCAG 2.0 standard. 11 | case fail 12 | 13 | /// Minimum for large scale content. 14 | /// 15 | /// From WCAG 2.0 § 1.4.3 16 | case aaLarge 17 | 18 | /// Minumm for regular scale content. 19 | /// 20 | /// From WCAG 2.0 § 1.4.3 21 | case aa 22 | 23 | /// Enhanced for regular scale content. 24 | /// 25 | /// From WCAG 2.0 § 1.4.6 26 | case aaa 27 | 28 | 29 | // MARK: - Initializers 30 | 31 | /// Create a ConformanceLevel from a contrast ratio. 32 | /// 33 | /// - parameter contrastRatio: A value from 1.0-21.0 34 | public init(contrastRatio: Double) { 35 | if contrastRatio >= 7 { 36 | self = .aaa 37 | return 38 | } 39 | 40 | if contrastRatio >= 4.5 { 41 | self = .aa 42 | return 43 | } 44 | 45 | if contrastRatio >= 3 { 46 | self = .aaLarge 47 | return 48 | } 49 | 50 | self = .fail 51 | } 52 | } 53 | 54 | 55 | extension ConformanceLevel: CustomStringConvertible { 56 | public var description: String { 57 | switch self { 58 | case .fail: return "Fail" 59 | case .aaLarge: return "AA+" 60 | case .aa: return "AA" 61 | case .aaa: return "AAA" 62 | } 63 | } 64 | } 65 | -------------------------------------------------------------------------------- /Sources/Color/Sources/HSLColor+Manipulation.swift: -------------------------------------------------------------------------------- 1 | extension HSLColor { 2 | public mutating func lighten(by ratio: Double = 0.01) { 3 | lightness += lightness * ratio 4 | } 5 | 6 | public func lightening(by ratio: Double = 0.01) -> HSLColor { 7 | var color = self 8 | color.lighten(by: ratio) 9 | return color 10 | } 11 | 12 | public mutating func darken(by ratio: Double = 0.01) { 13 | lightness -= lightness * ratio 14 | } 15 | 16 | public func darkening(by ratio: Double = 0.01) -> HSLColor { 17 | var color = self 18 | color.darken(by: ratio) 19 | return color 20 | } 21 | 22 | public mutating func saturate(by ratio: Double = 0.01) { 23 | saturation += saturation * ratio 24 | } 25 | 26 | public func saturating(by ratio: Double = 0.01) -> HSLColor { 27 | var color = self 28 | color.saturate(by: ratio) 29 | return color 30 | } 31 | 32 | public mutating func desaturate(by ratio: Double = 0.01) { 33 | saturation -= saturation * ratio 34 | } 35 | 36 | public func desaturating(by ratio: Double = 0.01) -> HSLColor { 37 | var color = self 38 | color.desaturate(by: ratio) 39 | return color 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /Sources/Color/Sources/HSLColor+NSColor.swift: -------------------------------------------------------------------------------- 1 | #if os(OSX) 2 | import AppKit 3 | 4 | extension NSColor { 5 | public convenience init(hsl color: HSLColor, colorSpace: NSColorSpace = .genericRGB) { 6 | self.init(rgb: RGBColor(hslColor: color), colorSpace: colorSpace) 7 | } 8 | } 9 | #endif 10 | -------------------------------------------------------------------------------- /Sources/Color/Sources/HSLColor+SystemColor.swift: -------------------------------------------------------------------------------- 1 | #if os(OSX) || os(iOS) || os(watchOS) || os(tvOS) 2 | #if os(iOS) || os(watchOS) || os(tvOS) 3 | import CoreGraphics 4 | #else 5 | import QuartzCore 6 | #endif 7 | 8 | extension HSLColor { 9 | public init(_ color: SystemColorType) { 10 | // TODO: Do direct conversion 11 | self.init(rgb: RGBColor(color)) 12 | } 13 | } 14 | 15 | 16 | extension SystemColorType { 17 | public func lightening(by ratio: CGFloat = 0.01) -> SystemColorType { 18 | SystemColorType(hsl: HSLColor(self).lightening(by: Double(ratio))) 19 | } 20 | 21 | public func darkening(by ratio: CGFloat = 0.01) -> SystemColorType { 22 | SystemColorType(hsl: HSLColor(self).darkening(by: Double(ratio))) 23 | } 24 | 25 | public func saturating(by ratio: CGFloat = 0.01) -> SystemColorType { 26 | SystemColorType(hsl: HSLColor(self).saturating(by: Double(ratio))) 27 | } 28 | 29 | public func desaturating(by ratio: CGFloat = 0.01) -> SystemColorType { 30 | SystemColorType(hsl: HSLColor(self).desaturating(by: Double(ratio))) 31 | } 32 | } 33 | #endif 34 | -------------------------------------------------------------------------------- /Sources/Color/Sources/HSLColor+UIColor.swift: -------------------------------------------------------------------------------- 1 | #if os(iOS) || os(watchOS) || os(tvOS) 2 | import UIKit 3 | 4 | extension UIColor { 5 | public convenience init(hsl color: HSLColor) { 6 | self.init(rgb: RGBColor(hslColor: color)) 7 | } 8 | } 9 | #endif 10 | -------------------------------------------------------------------------------- /Sources/Color/Sources/HSLColor.swift: -------------------------------------------------------------------------------- 1 | public struct HSLColor: Equatable { 2 | 3 | // MARK: - Properties 4 | 5 | public var hue: Double 6 | public var saturation: Double 7 | public var lightness: Double 8 | 9 | 10 | // MARK: - Initializers 11 | 12 | public init(hue: Double, saturation: Double, lightness: Double) { 13 | self.hue = hue 14 | self.saturation = saturation 15 | self.lightness = lightness 16 | } 17 | 18 | public init(rgb color: RGBColor) { 19 | self.init(red: color.red, green: color.green, blue: color.blue) 20 | } 21 | 22 | public init(red: Double, green: Double, blue: Double) { 23 | let min = Swift.min(Swift.min(red, green), blue) 24 | let max = Swift.max(Swift.max(red, green), blue) 25 | let delta = max - min 26 | 27 | var hue: Double 28 | let saturation: Double 29 | let lightness: Double 30 | 31 | if max == min { 32 | hue = 0 33 | } else if red == max { 34 | hue = (green - blue) / delta 35 | } else if green == max { 36 | hue = 2 + (blue - red) / delta 37 | } else { 38 | hue = 4 + (red - green) / delta 39 | } 40 | 41 | hue = Swift.min(hue * 60, 360) 42 | 43 | if hue < 0 { 44 | hue += 360 45 | } 46 | 47 | hue /= 360 48 | 49 | lightness = (min + max) / 2 50 | 51 | if max == min { 52 | saturation = 0 53 | } else if lightness <= 0.5 { 54 | saturation = delta / (max + min) 55 | } else { 56 | saturation = delta / (2 - max - min) 57 | } 58 | 59 | self.init(hue: hue, saturation: saturation, lightness: lightness) 60 | } 61 | } 62 | -------------------------------------------------------------------------------- /Sources/Color/Sources/RGBColor+CSS.swift: -------------------------------------------------------------------------------- 1 | #if !os(Linux) 2 | /// From https://developer.mozilla.org/en-US/docs/Web/CSS/color_value 3 | extension RGBColor { 4 | 5 | // MARK: - CSS Level 1 6 | 7 | public static var black: RGBColor { 8 | RGBColor(hex: "000000")! 9 | } 10 | 11 | public static var silver: RGBColor { 12 | RGBColor(hex: "c0c0c0")! 13 | } 14 | 15 | public static var gray: RGBColor { 16 | RGBColor(hex: "808080")! 17 | } 18 | 19 | public static var white: RGBColor { 20 | RGBColor(hex: "ffffff")! 21 | } 22 | 23 | public static var maroon: RGBColor { 24 | RGBColor(hex: "800000")! 25 | } 26 | 27 | public static var red: RGBColor { 28 | RGBColor(hex: "ff0000")! 29 | } 30 | 31 | public static var purple: RGBColor { 32 | RGBColor(hex: "800080")! 33 | } 34 | 35 | public static var fuchsia: RGBColor { 36 | RGBColor(hex: "ff00ff")! 37 | } 38 | 39 | public static var green: RGBColor { 40 | RGBColor(hex: "008000")! 41 | } 42 | 43 | public static var lime: RGBColor { 44 | RGBColor(hex: "00ff00")! 45 | } 46 | 47 | public static var olive: RGBColor { 48 | RGBColor(hex: "808000")! 49 | } 50 | 51 | public static var yellow: RGBColor { 52 | RGBColor(hex: "ffff00")! 53 | } 54 | 55 | public static var navy: RGBColor { 56 | RGBColor(hex: "000080")! 57 | } 58 | 59 | public static var blue: RGBColor { 60 | RGBColor(hex: "0000ff")! 61 | } 62 | 63 | public static var teal: RGBColor { 64 | RGBColor(hex: "008080")! 65 | } 66 | 67 | public static var aqua: RGBColor { 68 | RGBColor(hex: "00ffff")! 69 | } 70 | 71 | 72 | // MARK: - CSS Level 2 (Revision 1) 73 | 74 | public static var orange: RGBColor { 75 | RGBColor(hex: "ffa500")! 76 | } 77 | 78 | 79 | // MARK: - CSS Color Module Level 3 80 | 81 | public static var aliceBlue: RGBColor { 82 | RGBColor(hex: "f0f8ff")! 83 | } 84 | 85 | public static var antiqueWhite: RGBColor { 86 | RGBColor(hex: "faebd7")! 87 | } 88 | 89 | public static var aquamarine: RGBColor { 90 | RGBColor(hex: "7fffd4")! 91 | } 92 | 93 | public static var azure: RGBColor { 94 | RGBColor(hex: "f0ffff")! 95 | } 96 | 97 | public static var beige: RGBColor { 98 | RGBColor(hex: "f5f5dc")! 99 | } 100 | 101 | public static var bisque: RGBColor { 102 | RGBColor(hex: "ffe4c4")! 103 | } 104 | 105 | public static var blanchedAlmond: RGBColor { 106 | RGBColor(hex: "ffebcd")! 107 | } 108 | 109 | public static var blueViolet: RGBColor { 110 | RGBColor(hex: "8a2be2")! 111 | } 112 | 113 | public static var brown: RGBColor { 114 | RGBColor(hex: "a52a2a")! 115 | } 116 | 117 | public static var burlyWood: RGBColor { 118 | RGBColor(hex: "deb887")! 119 | } 120 | 121 | public static var cadetBlue: RGBColor { 122 | RGBColor(hex: "5f9ea0")! 123 | } 124 | 125 | public static var chartreuse: RGBColor { 126 | RGBColor(hex: "7fff00")! 127 | } 128 | 129 | public static var chocolate: RGBColor { 130 | RGBColor(hex: "d2691e")! 131 | } 132 | 133 | public static var coral: RGBColor { 134 | RGBColor(hex: "ff7f50")! 135 | } 136 | 137 | public static var cornflowerBlue: RGBColor { 138 | RGBColor(hex: "6495ed")! 139 | } 140 | 141 | public static var cornsilk: RGBColor { 142 | RGBColor(hex: "fff8dc")! 143 | } 144 | 145 | public static var crimson: RGBColor { 146 | RGBColor(hex: "dc143c")! 147 | } 148 | 149 | public static var cyan: RGBColor { 150 | aqua 151 | } 152 | 153 | public static var darkBlue: RGBColor { 154 | RGBColor(hex: "00008b")! 155 | } 156 | 157 | public static var darkCyan: RGBColor { 158 | RGBColor(hex: "008b8b")! 159 | } 160 | 161 | public static var darkGoldenrod: RGBColor { 162 | RGBColor(hex: "b8860b")! 163 | } 164 | 165 | public static var darkGray: RGBColor { 166 | RGBColor(hex: "a9a9a9")! 167 | } 168 | 169 | public static var darkGreen: RGBColor { 170 | RGBColor(hex: "006400")! 171 | } 172 | 173 | public static var darkGrey: RGBColor { 174 | darkGray 175 | } 176 | 177 | public static var darkKhaki: RGBColor { 178 | RGBColor(hex: "bdb76b")! 179 | } 180 | 181 | public static var darkMagenta: RGBColor { 182 | RGBColor(hex: "8b008b")! 183 | } 184 | 185 | public static var darkOliveGreen: RGBColor { 186 | RGBColor(hex: "556b2f")! 187 | } 188 | 189 | public static var darkOrange: RGBColor { 190 | RGBColor(hex: "ff8c00")! 191 | } 192 | 193 | public static var darkOrchid: RGBColor { 194 | RGBColor(hex: "9932cc")! 195 | } 196 | 197 | public static var darkRed: RGBColor { 198 | RGBColor(hex: "8b0000")! 199 | } 200 | 201 | public static var darkSalmon: RGBColor { 202 | RGBColor(hex: "e9967a")! 203 | } 204 | 205 | public static var darkSeaGreen: RGBColor { 206 | RGBColor(hex: "8fbc8f")! 207 | } 208 | 209 | public static var darkSlateBlue: RGBColor { 210 | RGBColor(hex: "483d8b")! 211 | } 212 | 213 | public static var darkSlateGray: RGBColor { 214 | RGBColor(hex: "2f4f4f")! 215 | } 216 | 217 | public static var darkslategrey: RGBColor { 218 | darkSlateGray 219 | } 220 | 221 | public static var darkTurquoise: RGBColor { 222 | RGBColor(hex: "00ced1")! 223 | } 224 | 225 | public static var darkViolet: RGBColor { 226 | RGBColor(hex: "9400d3")! 227 | } 228 | 229 | public static var deepPink: RGBColor { 230 | RGBColor(hex: "ff1493")! 231 | } 232 | 233 | public static var deepSkyBlue: RGBColor { 234 | RGBColor(hex: "00bfff")! 235 | } 236 | 237 | public static var dimGray: RGBColor { 238 | RGBColor(hex: "696969")! 239 | } 240 | 241 | public static var dimGrey: RGBColor { 242 | dimGray 243 | } 244 | 245 | public static var dodgerBlue: RGBColor { 246 | RGBColor(hex: "1e90ff")! 247 | } 248 | 249 | public static var fireBrick: RGBColor { 250 | RGBColor(hex: "b22222")! 251 | } 252 | 253 | public static var floralWhite: RGBColor { 254 | RGBColor(hex: "fffaf0")! 255 | } 256 | 257 | public static var forestGreen: RGBColor { 258 | RGBColor(hex: "228b22")! 259 | } 260 | 261 | public static var gainsboro: RGBColor { 262 | RGBColor(hex: "dcdcdc")! 263 | } 264 | 265 | public static var ghostWhite: RGBColor { 266 | RGBColor(hex: "f8f8ff")! 267 | } 268 | 269 | public static var gold: RGBColor { 270 | RGBColor(hex: "ffd700")! 271 | } 272 | 273 | public static var goldenrod: RGBColor { 274 | RGBColor(hex: "daa520")! 275 | } 276 | 277 | public static var greenYellow: RGBColor { 278 | RGBColor(hex: "adff2f")! 279 | } 280 | 281 | public static var grey: RGBColor { 282 | RGBColor(hex: "808080")! 283 | } 284 | 285 | public static var honeydew: RGBColor { 286 | RGBColor(hex: "f0fff0")! 287 | } 288 | 289 | public static var hotPink: RGBColor { 290 | RGBColor(hex: "ff69b4")! 291 | } 292 | 293 | public static var indianRed: RGBColor { 294 | RGBColor(hex: "cd5c5c")! 295 | } 296 | 297 | public static var indigo: RGBColor { 298 | RGBColor(hex: "4b0082")! 299 | } 300 | 301 | public static var ivory: RGBColor { 302 | RGBColor(hex: "fffff0")! 303 | } 304 | 305 | public static var khaki: RGBColor { 306 | RGBColor(hex: "f0e68c")! 307 | } 308 | 309 | public static var lavender: RGBColor { 310 | RGBColor(hex: "e6e6fa")! 311 | } 312 | 313 | public static var lavenderBlush: RGBColor { 314 | RGBColor(hex: "fff0f5")! 315 | } 316 | 317 | public static var lawnGreen: RGBColor { 318 | RGBColor(hex: "7cfc00")! 319 | } 320 | 321 | public static var lemonChiffon: RGBColor { 322 | RGBColor(hex: "fffacd")! 323 | } 324 | 325 | public static var lightBlue: RGBColor { 326 | RGBColor(hex: "add8e6")! 327 | } 328 | 329 | public static var lightCoral: RGBColor { 330 | RGBColor(hex: "f08080")! 331 | } 332 | 333 | public static var lightCyan: RGBColor { 334 | RGBColor(hex: "e0ffff")! 335 | } 336 | 337 | public static var lightGoldenrodYellow: RGBColor { 338 | RGBColor(hex: "fafad2")! 339 | } 340 | 341 | public static var lightGray: RGBColor { 342 | RGBColor(hex: "d3d3d3")! 343 | } 344 | 345 | public static var lightGreen: RGBColor { 346 | RGBColor(hex: "90ee90")! 347 | } 348 | 349 | public static var lightgrey: RGBColor { 350 | lightGray 351 | } 352 | 353 | public static var lightPink: RGBColor { 354 | RGBColor(hex: "ffb6c1")! 355 | } 356 | 357 | public static var lightSalmon: RGBColor { 358 | RGBColor(hex: "ffa07a")! 359 | } 360 | 361 | public static var lightSeaGreen: RGBColor { 362 | RGBColor(hex: "20b2aa")! 363 | } 364 | 365 | public static var lightskyblue: RGBColor { 366 | RGBColor(hex: "87cefa")! 367 | } 368 | 369 | public static var lightSlateGray: RGBColor { 370 | RGBColor(hex: "778899")! 371 | } 372 | 373 | public static var lightSlateGrey: RGBColor { 374 | lightSlateGray 375 | } 376 | 377 | public static var lightSteelBlue: RGBColor { 378 | RGBColor(hex: "b0c4de")! 379 | } 380 | 381 | public static var lightYellow: RGBColor { 382 | RGBColor(hex: "ffffe0")! 383 | } 384 | 385 | public static var limeGreen: RGBColor { 386 | RGBColor(hex: "32cd32")! 387 | } 388 | 389 | public static var linen: RGBColor { 390 | RGBColor(hex: "faf0e6")! 391 | } 392 | 393 | public static var magenta: RGBColor { 394 | fuchsia 395 | } 396 | 397 | public static var mediumAquamarine: RGBColor { 398 | RGBColor(hex: "66cdaa")! 399 | } 400 | 401 | public static var mediumBlue: RGBColor { 402 | RGBColor(hex: "0000cd")! 403 | } 404 | 405 | public static var mediumOrchid: RGBColor { 406 | RGBColor(hex: "ba55d3")! 407 | } 408 | 409 | public static var mediumPurple: RGBColor { 410 | RGBColor(hex: "9370db")! 411 | } 412 | 413 | public static var mediumSeaGreen: RGBColor { 414 | RGBColor(hex: "3cb371")! 415 | } 416 | 417 | public static var mediumSlateBlue: RGBColor { 418 | RGBColor(hex: "7b68ee")! 419 | } 420 | 421 | public static var mediumSpringGreen: RGBColor { 422 | RGBColor(hex: "00fa9a")! 423 | } 424 | 425 | public static var mediumTurquoise: RGBColor { 426 | RGBColor(hex: "48d1cc")! 427 | } 428 | 429 | public static var mediumVioletRed: RGBColor { 430 | RGBColor(hex: "c71585")! 431 | } 432 | 433 | public static var midnightBlue: RGBColor { 434 | RGBColor(hex: "191970")! 435 | } 436 | 437 | public static var mintCream: RGBColor { 438 | RGBColor(hex: "f5fffa")! 439 | } 440 | 441 | public static var mistyRose: RGBColor { 442 | RGBColor(hex: "ffe4e1")! 443 | } 444 | 445 | public static var moccasin: RGBColor { 446 | RGBColor(hex: "ffe4b5")! 447 | } 448 | 449 | public static var navajoWhite: RGBColor { 450 | RGBColor(hex: "ffdead")! 451 | } 452 | 453 | public static var oldLace: RGBColor { 454 | RGBColor(hex: "fdf5e6")! 455 | } 456 | 457 | public static var oliveDrab: RGBColor { 458 | RGBColor(hex: "6b8e23")! 459 | } 460 | 461 | public static var orangeRed: RGBColor { 462 | RGBColor(hex: "ff4500")! 463 | } 464 | 465 | public static var orchid: RGBColor { 466 | RGBColor(hex: "da70d6")! 467 | } 468 | 469 | public static var paleGoldenrod: RGBColor { 470 | RGBColor(hex: "eee8aa")! 471 | } 472 | 473 | public static var paleGreen: RGBColor { 474 | RGBColor(hex: "98fb98")! 475 | } 476 | 477 | public static var paleTurquoise: RGBColor { 478 | RGBColor(hex: "afeeee")! 479 | } 480 | 481 | public static var paleVioletRed: RGBColor { 482 | RGBColor(hex: "db7093")! 483 | } 484 | 485 | public static var papayaWhip: RGBColor { 486 | RGBColor(hex: "ffefd5")! 487 | } 488 | 489 | public static var peachPuff: RGBColor { 490 | RGBColor(hex: "ffdab9")! 491 | } 492 | 493 | public static var peru: RGBColor { 494 | RGBColor(hex: "cd853f")! 495 | } 496 | 497 | public static var pink: RGBColor { 498 | RGBColor(hex: "ffc0cb")! 499 | } 500 | 501 | public static var plum: RGBColor { 502 | RGBColor(hex: "dda0dd")! 503 | } 504 | 505 | public static var powderBlue: RGBColor { 506 | RGBColor(hex: "b0e0e6")! 507 | } 508 | 509 | public static var rosyBrown: RGBColor { 510 | RGBColor(hex: "bc8f8f")! 511 | } 512 | 513 | public static var royalBlue: RGBColor { 514 | RGBColor(hex: "4169e1")! 515 | } 516 | 517 | public static var saddleBrown: RGBColor { 518 | RGBColor(hex: "8b4513")! 519 | } 520 | 521 | public static var salmon: RGBColor { 522 | RGBColor(hex: "fa8072")! 523 | } 524 | 525 | public static var sandyBrown: RGBColor { 526 | RGBColor(hex: "f4a460")! 527 | } 528 | 529 | public static var seaGreen: RGBColor { 530 | RGBColor(hex: "2e8b57")! 531 | } 532 | 533 | public static var seaShell: RGBColor { 534 | RGBColor(hex: "fff5ee")! 535 | } 536 | 537 | public static var sienna: RGBColor { 538 | RGBColor(hex: "a0522d")! 539 | } 540 | 541 | public static var skyBlue: RGBColor { 542 | RGBColor(hex: "87ceeb")! 543 | } 544 | 545 | public static var slateBlue: RGBColor { 546 | RGBColor(hex: "6a5acd")! 547 | } 548 | 549 | public static var slateGray: RGBColor { 550 | RGBColor(hex: "708090")! 551 | } 552 | 553 | public static var slateGrey: RGBColor { 554 | slateGray 555 | } 556 | 557 | public static var snow: RGBColor { 558 | RGBColor(hex: "fffafa")! 559 | } 560 | 561 | public static var springGreen: RGBColor { 562 | RGBColor(hex: "00ff7f")! 563 | } 564 | 565 | public static var steelBlue: RGBColor { 566 | RGBColor(hex: "4682b4")! 567 | } 568 | 569 | public static var tan: RGBColor { 570 | RGBColor(hex: "d2b48c")! 571 | } 572 | 573 | public static var thistle: RGBColor { 574 | RGBColor(hex: "d8bfd8")! 575 | } 576 | 577 | public static var tomato: RGBColor { 578 | RGBColor(hex: "ff6347")! 579 | } 580 | 581 | public static var turquoise: RGBColor { 582 | RGBColor(hex: "40e0d0")! 583 | } 584 | 585 | public static var violet: RGBColor { 586 | RGBColor(hex: "ee82ee")! 587 | } 588 | 589 | public static var wheat: RGBColor { 590 | RGBColor(hex: "f5deb3")! 591 | } 592 | 593 | public static var whiteSmoke: RGBColor { 594 | RGBColor(hex: "f5f5f5")! 595 | } 596 | 597 | public static var yellowGreen: RGBColor { 598 | RGBColor(hex: "9acd32")! 599 | } 600 | 601 | 602 | // MARK: - CSS Color Module Level 4 603 | 604 | /// See https://en.wikipedia.org/wiki/Eric_A._Meyer#Personal_life 605 | public static var rebeccaPurple: RGBColor { 606 | RGBColor(hex: "663399")! 607 | } 608 | } 609 | #endif 610 | -------------------------------------------------------------------------------- /Sources/Color/Sources/RGBColor+Hex.swift: -------------------------------------------------------------------------------- 1 | import Foundation 2 | 3 | extension RGBColor { 4 | /// Initialize a color with a hex string. 5 | public init?(hex string: String) { 6 | var hex = string.trimmingCharacters(in: .whitespaces) 7 | 8 | // Remove `#` and `0x` 9 | if hex.hasPrefix("#") { 10 | hex = String(hex[hex.index(hex.startIndex, offsetBy: 1)...]) 11 | } else if hex.hasPrefix("0x") { 12 | hex = String(hex[hex.index(hex.startIndex, offsetBy: 2)...]) 13 | } 14 | 15 | // Invalid if not 3 or 6 characters 16 | let length = hex.count 17 | if length != 3 && length != 6 { 18 | return nil 19 | } 20 | 21 | // Make the string 6 characters long for easier parsing 22 | if length == 3 { 23 | let r = hex[hex.startIndex..(_ string: T) -> Double { 31 | let value = Double(strtoul(String(string), nil, 16)) 32 | return value / 255 33 | } 34 | 35 | let red = hexValue(hex[hex.startIndex.. CGFloat { 23 | let lhs = RGBColor(self) 24 | let rhs = RGBColor(other) 25 | return CGFloat(lhs.contrastRatio(to: rhs)) 26 | } 27 | 28 | public var yiqLuma: CGFloat { 29 | CGFloat(RGBColor(self).yiqLuma) 30 | } 31 | 32 | public var isDark: Bool { 33 | RGBColor(self).isDark 34 | } 35 | } 36 | #endif 37 | -------------------------------------------------------------------------------- /Sources/Color/Sources/RGBColor+Temperature.swift: -------------------------------------------------------------------------------- 1 | #if os(Linux) 2 | import Glibc 3 | #else 4 | import Darwin 5 | #endif 6 | 7 | extension RGBColor { 8 | /// Initialize an RGB color with a color temperature in Kelvin. 9 | /// 10 | /// From http://www.tannerhelland.com/4435/convert-temperature-rgb-algorithm-code/ 11 | /// 12 | /// - parameter colorTemperature: temperature in Kelvin. Expected between 1000 and 40,0000 13 | public init(colorTemperature: Double) { 14 | precondition(colorTemperature >= 1000 && colorTemperature <= 40000, "Expected input to be between 1000 and 40,000") 15 | 16 | let temperature = colorTemperature / 100 17 | 18 | // Red 19 | if temperature <= 66 { 20 | self.red = 1 21 | } else { 22 | var red = temperature - 60 23 | red = 329.698727446 * pow(red, -0.1332047592) / 255 24 | self.red = min(1, max(0, red)) 25 | } 26 | 27 | // Green 28 | if temperature <= 66 { 29 | var green = temperature 30 | green = (99.4708025861 * log(green) - 161.1195681661) / 255 31 | self.green = min(1, max(0, green)) 32 | } else { 33 | var green = temperature - 60 34 | green = 288.1221695283 * pow(green, -0.0755148492) / 255 35 | self.green = min(1, max(0, green)) 36 | } 37 | 38 | // Blue 39 | if temperature >= 66 { 40 | self.blue = 1 41 | } else { 42 | if temperature <= 19 { 43 | self.blue = 0 44 | } else { 45 | var blue = temperature - 10 46 | blue = (138.5177312231 * log(blue) - 305.0447927307) / 255 47 | self.blue = min(1, max(0, blue)) 48 | } 49 | } 50 | } 51 | } 52 | -------------------------------------------------------------------------------- /Sources/Color/Sources/RGBColor+UIColor.swift: -------------------------------------------------------------------------------- 1 | #if os(iOS) || os(watchOS) || os(tvOS) 2 | import UIKit 3 | 4 | extension RGBColor { 5 | public init(_ color: UIColor) { 6 | var red: CGFloat = 0 7 | var green: CGFloat = 0 8 | var blue: CGFloat = 0 9 | color.getRed(&red, green: &green, blue: &blue, alpha: nil) 10 | 11 | self.init(red: Double(red), green: Double(green), blue: Double(blue)) 12 | } 13 | } 14 | 15 | 16 | extension UIColor { 17 | public convenience init(rgb color: RGBColor) { 18 | self.init(red: CGFloat(color.red), green: CGFloat(color.green), blue: CGFloat(color.blue), alpha: 1) 19 | } 20 | } 21 | #endif 22 | -------------------------------------------------------------------------------- /Sources/Color/Sources/RGBColor+WCAG.swift: -------------------------------------------------------------------------------- 1 | #if os(Linux) 2 | import Glibc 3 | #else 4 | import Darwin 5 | #endif 6 | 7 | extension RGBColor { 8 | 9 | /// Relative luminance 10 | /// 11 | /// From https://www.w3.org/TR/WCAG20/#relativeluminancedef 12 | public var relativeLuminance: Double { 13 | let red = self.red <= 0.03928 ? self.red / 12.92 : pow(((self.red + 0.055) / 1.055), 2.4) 14 | let green = self.green <= 0.03928 ? self.green / 12.92 : pow(((self.green + 0.055) / 1.055), 2.4) 15 | let blue = self.blue <= 0.03928 ? self.blue / 12.92 : pow(((self.blue + 0.055) / 1.055), 2.4) 16 | 17 | return 0.2126 * red + 0.7152 * green + 0.0722 * blue 18 | } 19 | 20 | /// Contrast ratio 21 | /// 22 | /// - parameter to: the color to compare the receiver to 23 | /// 24 | /// From https://www.w3.org/TR/WCAG20/#contrast-ratiodef 25 | public func contrastRatio(to other: RGBColor) -> Double { 26 | let lum1 = relativeLuminance 27 | let lum2 = other.relativeLuminance 28 | 29 | return (max(lum1, lum2) + 0.05) / (min(lum1, lum2) + 0.05) 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /Sources/Color/Sources/RGBColor+YIQ.swift: -------------------------------------------------------------------------------- 1 | extension RGBColor { 2 | /// YIQ luma value. 3 | /// 4 | /// From https://en.wikipedia.org/wiki/YIQ 5 | public var yiqLuma: Double { 6 | (red * 255 * 299 + green * 255 * 587 + blue * 255 * 114) / 1000 7 | } 8 | 9 | /// From http://24ways.org/2010/calculating-color-contrast 10 | public var isDark: Bool { 11 | yiqLuma < 128 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /Sources/Color/Sources/RGBColor.swift: -------------------------------------------------------------------------------- 1 | /// Portable, pure Swift color representation. 2 | public struct RGBColor: Equatable { 3 | 4 | // MARK: - Properties 5 | 6 | public var red: Double 7 | public var green: Double 8 | public var blue: Double 9 | 10 | 11 | // MARK: - Initializers 12 | 13 | public init(red: Double, green: Double, blue: Double) { 14 | precondition(red >= 0 && red <= 1) 15 | precondition(green >= 0 && green <= 1) 16 | precondition(blue >= 0 && blue <= 1) 17 | 18 | self.red = red 19 | self.green = green 20 | self.blue = blue 21 | } 22 | 23 | public init(white: Double) { 24 | precondition(white >= 0 && white <= 1) 25 | 26 | self.init(red: white, green: white, blue: white) 27 | } 28 | 29 | public init(hslColor: HSLColor) { 30 | let saturation = hslColor.saturation 31 | let lightness = hslColor.lightness 32 | 33 | if saturation == 0 { 34 | self.init(white: lightness) 35 | return 36 | } 37 | 38 | let hue = hslColor.hue 39 | 40 | let t1: Double 41 | let t2: Double 42 | 43 | if lightness < 0.5 { 44 | t2 = lightness * (1 + saturation) 45 | } else { 46 | t2 = lightness + saturation - lightness * saturation 47 | } 48 | 49 | t1 = 2 * lightness - t2 50 | 51 | var rgb: [Double] = [0, 0, 0] 52 | 53 | for i in 0..<3 { 54 | var t3 = hue + 1 / 3 * -(Double(i) - 1) 55 | 56 | if t3 < 0 { 57 | t3 += 1 58 | } 59 | 60 | if t3 > 1 { 61 | t3 -= 1 62 | } 63 | 64 | let value: Double 65 | 66 | if (6 * t3 < 1) { 67 | value = t1 + (t2 - t1) * 6 * t3 68 | } else if (2 * t3 < 1) { 69 | value = t2 70 | } else if (3 * t3 < 2) { 71 | value = t1 + (t2 - t1) * (2 / 3 - t3) * 6 72 | } else { 73 | value = t1 74 | } 75 | 76 | rgb[i] = value 77 | } 78 | 79 | self.init(red: rgb[0], green: rgb[1], blue: rgb[2]) 80 | } 81 | } 82 | -------------------------------------------------------------------------------- /Sources/Color/Sources/SystemColor.swift: -------------------------------------------------------------------------------- 1 | #if os(OSX) 2 | import AppKit 3 | public typealias SystemColorType = NSColor 4 | #elseif os(iOS) || os(watchOS) || os(tvOS) 5 | import UIKit 6 | public typealias SystemColorType = UIColor 7 | #endif 8 | -------------------------------------------------------------------------------- /Sources/Color/Support/Color.h: -------------------------------------------------------------------------------- 1 | @import Foundation; 2 | 3 | //! Project version number for Color. 4 | FOUNDATION_EXPORT double ColorVersionNumber; 5 | 6 | //! Project version string for Color. 7 | FOUNDATION_EXPORT const unsigned char ColorVersionString[]; 8 | -------------------------------------------------------------------------------- /Sources/Color/Support/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 | 0.1.2 19 | CFBundleVersion 20 | $(CURRENT_PROJECT_VERSION) 21 | NSHumanReadableCopyright 22 | Copyright © 2017 Nothing Magical, Inc. All rights reserved. 23 | NSPrincipalClass 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /Sources/Color/Support/Tests-Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | BNDL 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleVersion 20 | 1 21 | 22 | 23 | -------------------------------------------------------------------------------- /Tests/ColorTests/ColorTests.swift: -------------------------------------------------------------------------------- 1 | import XCTest 2 | import Color 3 | 4 | final class ColorTests: XCTestCase { 5 | let color1 = RGBColor(red: 170.0 / 255.0, green: 204.0 / 255.0, blue: 1) 6 | let color2 = RGBColor(red: 34.0 / 255.0, green: 34.0 / 255.0, blue: 51.0 / 255.0) 7 | 8 | func testRelativeLuminance() { 9 | XCTAssertEqual(0.589, color1.relativeLuminance, accuracy: 0.001) 10 | XCTAssertEqual(0.017, color2.relativeLuminance, accuracy: 0.001) 11 | } 12 | 13 | func testContrastRatio() { 14 | XCTAssertEqual(9.51, color1.contrastRatio(to: color2), accuracy: 0.01) 15 | XCTAssertEqual(9.51, color2.contrastRatio(to: color1), accuracy: 0.01) 16 | } 17 | 18 | func testYIQ() { 19 | XCTAssertEqual(199.648, color1.yiqLuma, accuracy: 0.001) 20 | XCTAssertEqual(35.938, color2.yiqLuma, accuracy: 0.001) 21 | } 22 | 23 | func testIsDark() { 24 | XCTAssertEqual(false, color1.isDark) 25 | XCTAssertEqual(true, color2.isDark) 26 | } 27 | 28 | func testToHex() { 29 | let red = RGBColor(red: 1.0, green: 0.0, blue: 0.0) 30 | XCTAssertEqual("ff0000", red.hex) 31 | 32 | let green = RGBColor(red: 0.0, green: 1.0, blue: 0.0) 33 | XCTAssertEqual("00ff00", green.hex) 34 | 35 | let blue = RGBColor(red: 0.0, green: 0.0, blue: 1.0) 36 | XCTAssertEqual("0000ff", blue.hex) 37 | 38 | let purple = RGBColor(red: 110.0 / 255.0, green: 61.0 / 255.0, blue: 195.0 / 255.0) 39 | XCTAssertEqual("6e3dc3", purple.hex) 40 | } 41 | 42 | func testFromHex() { 43 | let purple = RGBColor(hex: "6e3dc3")! 44 | XCTAssertEqual(purple, RGBColor(red: 110 / 255, green: 61 / 255, blue: 195 / 255)) 45 | } 46 | 47 | func testConvertToHSL() { 48 | let rgb = RGBColor(red: 0.941, green: 0.785, blue: 0.053) 49 | let hsl = HSLColor(hue: 49.5 / 360, saturation: 0.893, lightness: 0.497) 50 | let converted = HSLColor(rgb: rgb) 51 | XCTAssertEqual(hsl.hue, converted.hue, accuracy: 0.1) 52 | XCTAssertEqual(hsl.saturation, converted.saturation, accuracy: 0.1) 53 | XCTAssertEqual(hsl.lightness, converted.lightness, accuracy: 0.1) 54 | } 55 | } 56 | -------------------------------------------------------------------------------- /Tests/ColorTests/TemperatureTests.swift: -------------------------------------------------------------------------------- 1 | import Color 2 | import XCTest 3 | 4 | final class TemperatureTests: XCTestCase { 5 | func testRGB() { 6 | assertEqualColors(RGBColor(red: 1, green: 108 / 255, blue: 0), RGBColor(colorTemperature: 1500)) 7 | assertEqualColors(RGBColor(white: 1), RGBColor(colorTemperature: 6600)) 8 | assertEqualColors(RGBColor(red: 181 / 255, green: 205 / 255, blue: 1), RGBColor(colorTemperature: 15000)) 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /Tests/ColorTests/TestHelper.swift: -------------------------------------------------------------------------------- 1 | import Color 2 | import XCTest 3 | 4 | func assertEqualColors(_ lhs: Color.RGBColor, _ rhs: Color.RGBColor) { 5 | XCTAssertEqual(lhs.red, rhs.red, accuracy: 0.001) 6 | XCTAssertEqual(lhs.green, rhs.green, accuracy: 0.001) 7 | XCTAssertEqual(lhs.blue, rhs.blue, accuracy: 0.001) 8 | } 9 | -------------------------------------------------------------------------------- /Tests/ColorTests/XCTestManifests.swift: -------------------------------------------------------------------------------- 1 | #if !canImport(ObjectiveC) 2 | import XCTest 3 | 4 | extension ColorTests { 5 | // DO NOT MODIFY: This is autogenerated, use: 6 | // `swift test --generate-linuxmain` 7 | // to regenerate. 8 | static let __allTests__ColorTests = [ 9 | ("testContrastRatio", testContrastRatio), 10 | ("testConvertToHSL", testConvertToHSL), 11 | ("testFromHex", testFromHex), 12 | ("testIsDark", testIsDark), 13 | ("testRelativeLuminance", testRelativeLuminance), 14 | ("testToHex", testToHex), 15 | ("testYIQ", testYIQ), 16 | ] 17 | } 18 | 19 | extension TemperatureTests { 20 | // DO NOT MODIFY: This is autogenerated, use: 21 | // `swift test --generate-linuxmain` 22 | // to regenerate. 23 | static let __allTests__TemperatureTests = [ 24 | ("testRGB", testRGB), 25 | ] 26 | } 27 | 28 | public func __allTests() -> [XCTestCaseEntry] { 29 | return [ 30 | testCase(ColorTests.__allTests__ColorTests), 31 | testCase(TemperatureTests.__allTests__TemperatureTests), 32 | ] 33 | } 34 | #endif 35 | -------------------------------------------------------------------------------- /Tests/LinuxMain.swift: -------------------------------------------------------------------------------- 1 | import XCTest 2 | 3 | import ColorTests 4 | 5 | var tests = [XCTestCaseEntry]() 6 | tests += ColorTests.__allTests() 7 | 8 | XCTMain(tests) 9 | --------------------------------------------------------------------------------