Skip to content

Commit 6a993c6

Browse files
authored
Merge pull request #391 from LoopKit/status-extension-refactor
Status extension refactor
2 parents 630bb96 + 5ea6f8d commit 6a993c6

26 files changed

+728
-424
lines changed

LoopUI/Extensions/NSNumberFormatter.swift renamed to Common/Extensions/NumberFormatter.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ import HealthKit
1111

1212

1313
extension NumberFormatter {
14-
public static func glucoseFormatter(for unit: HKUnit) -> NumberFormatter {
14+
static func glucoseFormatter(for unit: HKUnit) -> NumberFormatter {
1515
let numberFormatter = NumberFormatter()
1616

1717
numberFormatter.numberStyle = .decimal
Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
//
2+
// UIColor+HIG.swift
3+
// Naterade
4+
//
5+
// Created by Nathan Racklyeft on 1/23/16.
6+
// Copyright © 2016 Nathan Racklyeft. All rights reserved.
7+
//
8+
9+
import UIKit
10+
11+
12+
extension UIColor {
13+
// MARK: - HIG colors
14+
// See: https://developer.apple.com/ios/human-interface-guidelines/visual-design/color/
15+
16+
static func HIGTealBlueColor() -> UIColor {
17+
return UIColor(red: 90 / 255, green: 200 / 255, blue: 250 / 255, alpha: 1)
18+
}
19+
20+
static func HIGYellowColor() -> UIColor {
21+
return UIColor(red: 1, green: 204 / 255, blue: 0, alpha: 1)
22+
}
23+
24+
static func HIGOrangeColor() -> UIColor {
25+
return UIColor(red: 1, green: 149 / 255, blue: 0 / 255, alpha: 1)
26+
}
27+
28+
static func HIGPinkColor() -> UIColor {
29+
return UIColor(red: 1, green: 45 / 255, blue: 85 / 255, alpha: 1)
30+
}
31+
32+
static func HIGBlueColor() -> UIColor {
33+
return UIColor(red: 0, green: 122 / 255, blue: 1, alpha: 1)
34+
}
35+
36+
static func HIGGreenColor() -> UIColor {
37+
return UIColor(red: 76 / 255, green: 217 / 255, blue: 100 / 255, alpha: 1)
38+
}
39+
40+
static func HIGRedColor() -> UIColor {
41+
return UIColor(red: 1, green: 59 / 255, blue: 48 / 255, alpha: 1)
42+
}
43+
44+
static func HIGPurpleColor() -> UIColor {
45+
return UIColor(red: 88 / 255, green: 86 / 255, blue: 214 / 255, alpha: 1)
46+
}
47+
48+
static func HIGGrayColor() -> UIColor {
49+
return UIColor(red: 142 / 255, green: 143 / 255, blue: 147 / 255, alpha: 1)
50+
}
51+
52+
}

Common/Extensions/UIColor.swift

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
//
2+
// UIColor.swift
3+
// Naterade
4+
//
5+
// Created by Nathan Racklyeft on 1/23/16.
6+
// Copyright © 2016 Nathan Racklyeft. All rights reserved.
7+
//
8+
9+
import UIKit
10+
11+
12+
extension UIColor {
13+
@nonobjc static var tintColor: UIColor? = nil
14+
15+
@nonobjc static let secondaryLabelColor = UIColor.HIGGrayColor()
16+
17+
@nonobjc static let cellBackgroundColor = UIColor(white: 239 / 255, alpha: 1)
18+
19+
@nonobjc static let gridColor = UIColor(white: 193 / 255, alpha: 1)
20+
21+
@nonobjc static let IOBTintColor = UIColor.HIGOrangeColor()
22+
23+
@nonobjc static let COBTintColor = UIColor(red: 99 / 255, green: 218 / 255, blue: 56 / 255, alpha: 1)
24+
25+
@nonobjc static let agingColor = UIColor.HIGYellowColor()
26+
27+
@nonobjc static let staleColor = UIColor.HIGRedColor()
28+
29+
@nonobjc static let unknownColor = UIColor(red: 198 / 255, green: 199 / 255, blue: 201 / 255, alpha: 1)
30+
31+
@nonobjc static let deleteColor = UIColor.HIGRedColor()
32+
}

0 commit comments

Comments
 (0)