@@ -19,8 +19,9 @@ import UIKit
19
19
extension UIColor {
20
20
static let glucoseTintColor = UIColor ( red: 0 / 255 , green: 176 / 255 , blue: 255 / 255 , alpha: 1 )
21
21
static let gridColor = UIColor ( white: 193 / 255 , alpha: 1 )
22
- static let nowColor = UIColor ( white: 193 / 255 , alpha: 0.5 )
22
+ static let nowColor = UIColor ( white: 0.2 , alpha: 1 )
23
23
static let rangeColor = UIColor ( red: 158 / 255 , green: 215 / 255 , blue: 245 / 255 , alpha: 1 )
24
+ static let backgroundColor = UIColor ( white: 0.1 , alpha: 1 )
24
25
}
25
26
26
27
extension SKLabelNode {
@@ -90,16 +91,16 @@ extension HKUnit {
90
91
91
92
extension WKInterfaceDevice {
92
93
enum WatchSize {
93
- case Watch38mm
94
- case Watch42mm
94
+ case watch38mm
95
+ case watch42mm
95
96
}
96
97
97
98
func watchSize( ) -> WatchSize {
98
99
switch screenBounds. width {
99
100
case 136 :
100
- return . Watch38mm
101
+ return . watch38mm
101
102
default :
102
- return . Watch42mm
103
+ return . watch42mm
103
104
}
104
105
}
105
106
}
@@ -158,23 +159,16 @@ class GlucoseChartScene: SKScene {
158
159
// Use the fixed sizes specified in the storyboard, based on our guess of the model size
159
160
super. init ( size: {
160
161
switch WKInterfaceDevice . current ( ) . watchSize ( ) {
161
- case . Watch38mm :
162
+ case . watch38mm :
162
163
return CGSize ( width: 134 , height: 68 )
163
- case . Watch42mm :
164
+ case . watch42mm :
164
165
return CGSize ( width: 154 , height: 86 )
165
166
}
166
167
} ( ) )
167
168
168
169
anchorPoint = CGPoint ( x: 0 , y: 0 )
169
170
scaleMode = . aspectFit
170
- backgroundColor = . clear
171
-
172
- let frame = SKShapeNode ( rectOf: size, cornerRadius: 0 )
173
- frame. position = CGPoint ( x: size. width / 2 , y: size. height / 2 )
174
- frame. lineWidth = 2
175
- frame. fillColor = . clear
176
- frame. strokeColor = . gridColor
177
- addChild ( frame)
171
+ backgroundColor = . backgroundColor
178
172
179
173
let dashedPath = CGPath ( rect: CGRect ( origin: CGPoint ( x: size. width / 2 , y: 0 ) , size: CGSize ( width: 0 , height: size. height) ) , transform: nil ) . copy ( dashingWithPhase: 0 , lengths: [ 4.0 , 3.0 ] )
180
174
let now = SKShapeNode ( path: dashedPath)
0 commit comments