@@ -34,6 +34,7 @@ public final class ShapeDrawingNode: ASDisplayNode, ShapeDisplaying {
34
34
var shapePath : UIBezierPath ?
35
35
var shapeLineWidth : CGFloat = 0
36
36
var shapeStrokeColor : UIColor ?
37
+ var userInterfaceStyle : UIUserInterfaceStyle = . light
37
38
}
38
39
39
40
private final class ParameterBox : NSObject {
@@ -104,17 +105,38 @@ public final class ShapeDrawingNode: ASDisplayNode, ShapeDisplaying {
104
105
let backing = parameter. backing
105
106
106
107
guard let path = backing. shapePath else { return }
107
-
108
+
109
+ let userInterfaceStyle = backing. userInterfaceStyle
110
+
108
111
path. lineWidth = backing. shapeLineWidth
109
112
110
- backing. shapeFillColor? . setFill ( )
113
+ backing. shapeFillColor?
114
+ . resolvedColor ( with: . init( userInterfaceStyle: userInterfaceStyle) )
115
+ . setFill ( )
116
+
111
117
path. fill ( )
112
118
113
- backing. shapeStrokeColor? . setStroke ( )
119
+ backing. shapeStrokeColor?
120
+ . resolvedColor ( with: . init( userInterfaceStyle: userInterfaceStyle) )
121
+ . setStroke ( )
114
122
115
123
path. stroke ( )
116
124
117
125
}
118
-
126
+
127
+ public override func asyncTraitCollectionDidChange(
128
+ withPreviousTraitCollection previousTraitCollection: ASPrimitiveTraitCollection
129
+ ) {
130
+ super. asyncTraitCollectionDidChange ( withPreviousTraitCollection: previousTraitCollection)
131
+ let userInterfaceStyle = asyncTraitCollection ( ) . userInterfaceStyle
132
+ guard
133
+ self . backing. userInterfaceStyle != userInterfaceStyle
134
+ else {
135
+ return
136
+ }
137
+ self . backing. userInterfaceStyle = userInterfaceStyle
138
+ }
139
+
140
+
119
141
}
120
142
0 commit comments