-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #164 from e-001/renovate
Move deps to SPM and internal modules, rm carthage
- Loading branch information
Showing
14 changed files
with
563 additions
and
195 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
2 changes: 1 addition & 1 deletion
2
Graviton.xcodeproj/project.xcworkspace/contents.xcworkspacedata
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
68 changes: 68 additions & 0 deletions
68
Graviton.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,68 @@ | ||
{ | ||
"pins" : [ | ||
{ | ||
"identity" : "orderedset", | ||
"kind" : "remoteSourceControl", | ||
"location" : "https://github.com/Weebly/OrderedSet", | ||
"state" : { | ||
"branch" : "master", | ||
"revision" : "cfbf9f5d6a8579d819f02164a236aa3dae9a9fe3" | ||
} | ||
}, | ||
{ | ||
"identity" : "realm-cocoa", | ||
"kind" : "remoteSourceControl", | ||
"location" : "https://github.com/realm/realm-cocoa.git", | ||
"state" : { | ||
"revision" : "9266efac9ef0c79e4e64a2ba36162d8d922893d2", | ||
"version" : "10.39.0" | ||
} | ||
}, | ||
{ | ||
"identity" : "realm-core", | ||
"kind" : "remoteSourceControl", | ||
"location" : "https://github.com/realm/realm-core.git", | ||
"state" : { | ||
"revision" : "f2a209b164194190b46747c7f5e36cb30fd5db71", | ||
"version" : "13.10.0" | ||
} | ||
}, | ||
{ | ||
"identity" : "regex", | ||
"kind" : "remoteSourceControl", | ||
"location" : "https://github.com/sharplet/Regex", | ||
"state" : { | ||
"revision" : "76c2b73d4281d77fc3118391877efd1bf972f515", | ||
"version" : "2.1.1" | ||
} | ||
}, | ||
{ | ||
"identity" : "sqlite.swift", | ||
"kind" : "remoteSourceControl", | ||
"location" : "https://github.com/stephencelis/SQLite.swift", | ||
"state" : { | ||
"revision" : "7a2e3cd27de56f6d396e84f63beefd0267b55ccb", | ||
"version" : "0.14.1" | ||
} | ||
}, | ||
{ | ||
"identity" : "swiftybeaver", | ||
"kind" : "remoteSourceControl", | ||
"location" : "https://github.com/SwiftyBeaver/SwiftyBeaver", | ||
"state" : { | ||
"revision" : "1080914828ef1c9ca9cd2bad50667b3d847dabff", | ||
"version" : "2.0.0" | ||
} | ||
}, | ||
{ | ||
"identity" : "xlpagertabstrip", | ||
"kind" : "remoteSourceControl", | ||
"location" : "https://github.com/nk-5/XLPagerTabStrip/", | ||
"state" : { | ||
"branch" : "support_spm", | ||
"revision" : "6398d7b529e2baa2183a4a5382e6fcc9d27db08a" | ||
} | ||
} | ||
], | ||
"version" : 2 | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
// | ||
// KelvinColor.h | ||
// KelvinColor | ||
// | ||
// Created by Sihao Lu on 8/24/17. | ||
// Copyright © 2017 Sihao. All rights reserved. | ||
// | ||
|
||
#import <UIKit/UIKit.h> | ||
|
||
//! Project version number for KelvinColor. | ||
FOUNDATION_EXPORT double KelvinColorVersionNumber; | ||
|
||
//! Project version string for KelvinColor. | ||
FOUNDATION_EXPORT const unsigned char KelvinColorVersionString[]; | ||
|
||
// In this header, you should import all the public headers of your framework using statements like #import <KelvinColor/PublicHeader.h> | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,119 @@ | ||
// | ||
// KelvinColor.swift | ||
// KelvinColor | ||
// | ||
// Created by Sihao Lu on 8/24/17. | ||
// Copyright © 2017 Sihao. All rights reserved. | ||
// | ||
|
||
// Ported from https://raw.githubusercontent.com/neilbartlett/color-temperature/master/index.js | ||
|
||
import Foundation | ||
import UIKit | ||
|
||
public extension UIColor { | ||
/// Initialize color based on the Kelvin temperature | ||
/// | ||
/// - Parameter kelvin: color temperature in degrees Kelvin | ||
convenience init(temperature kelvin: Double) { | ||
let temperature = kelvin / 100.0 | ||
var red, green, blue: Double | ||
|
||
if (temperature < 66.0) { | ||
red = 255 | ||
} else { | ||
// a + b x + c Log[x] /. | ||
// {a -> 351.97690566805693`, | ||
// b -> 0.114206453784165`, | ||
// c -> -40.25366309332127 | ||
//x -> (kelvin/100) - 55} | ||
red = temperature - 55.0 | ||
red = 351.97690566805693 + 0.114206453784165 * red - 40.25366309332127 * log(red) | ||
if red < 0 { | ||
red = 0 | ||
} | ||
if red > 255 { | ||
red = 255 | ||
} | ||
} | ||
|
||
if (temperature < 66.0) { | ||
// a + b x + c Log[x] /. | ||
// {a -> -155.25485562709179`, | ||
// b -> -0.44596950469579133`, | ||
// c -> 104.49216199393888`, | ||
// x -> (kelvin/100) - 2} | ||
green = temperature - 2 | ||
green = -155.25485562709179 - 0.44596950469579133 * green + 104.49216199393888 * log(green) | ||
if green < 0 { | ||
green = 0 | ||
} | ||
if green > 255 { | ||
green = 255 | ||
} | ||
} else { | ||
// a + b x + c Log[x] /. | ||
// {a -> 325.4494125711974`, | ||
// b -> 0.07943456536662342`, | ||
// c -> -28.0852963507957`, | ||
// x -> (kelvin/100) - 50} | ||
green = temperature - 50.0 | ||
green = 325.4494125711974 + 0.07943456536662342 * green - 28.0852963507957 * log(green) | ||
if green < 0 { | ||
green = 0 | ||
} | ||
if green > 255 { | ||
green = 255 | ||
} | ||
|
||
} | ||
|
||
if (temperature >= 66.0) { | ||
blue = 255 | ||
} else { | ||
if (temperature <= 20.0) { | ||
blue = 0 | ||
} else { | ||
// a + b x + c Log[x] /. | ||
// {a -> -254.76935184120902`, | ||
// b -> 0.8274096064007395`, | ||
// c -> 115.67994401066147`, | ||
// x -> kelvin/100 - 10} | ||
blue = temperature - 10 | ||
blue = -254.76935184120902 + 0.8274096064007395 * blue + 115.67994401066147 * log(blue) | ||
if blue < 0 { | ||
blue = 0 | ||
} | ||
if blue > 255 { | ||
blue = 255 | ||
} | ||
} | ||
} | ||
|
||
self.init(red: CGFloat(red / 255.0), green: CGFloat(green / 255.0), blue: CGFloat(blue / 255.0), alpha: 1) | ||
} | ||
|
||
var temperature: Double { | ||
var temperature: Double = 0 | ||
var testRGB: UIColor | ||
let epsilon: Double = 0.4 | ||
var minTemperature: Double = 1000 | ||
var maxTemperature: Double = 40000 | ||
while (maxTemperature - minTemperature > epsilon) { | ||
temperature = (maxTemperature + minTemperature) / 2 | ||
testRGB = UIColor.init(temperature: temperature) | ||
var testBlue: CGFloat = 0 | ||
var testRed: CGFloat = 0 | ||
testRGB.getRed(&testRed, green: nil, blue: &testBlue, alpha: nil) | ||
var currentBlue: CGFloat = 0 | ||
var currentRed: CGFloat = 0 | ||
self.getRed(¤tRed, green: nil, blue: ¤tBlue, alpha: nil) | ||
if testBlue / testRed >= currentBlue / currentRed { | ||
maxTemperature = temperature | ||
} else { | ||
minTemperature = temperature | ||
} | ||
} | ||
return round(temperature) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,7 +7,6 @@ | |
// | ||
|
||
import CoreLocation | ||
import KelvinColor | ||
import MathUtil | ||
import OpenGLES | ||
import Orbits | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters