@@ -34,6 +34,7 @@ public final class ShapeDrawingNode: ASDisplayNode, ShapeDisplaying {
3434 var shapePath : UIBezierPath ?
3535 var shapeLineWidth : CGFloat = 0
3636 var shapeStrokeColor : UIColor ?
37+ var userInterfaceStyle : UIUserInterfaceStyle = . unspecified
3738 }
3839
3940 private final class ParameterBox : NSObject {
@@ -104,17 +105,38 @@ public final class ShapeDrawingNode: ASDisplayNode, ShapeDisplaying {
104105 let backing = parameter. backing
105106
106107 guard let path = backing. shapePath else { return }
107-
108+
109+ let userInterfaceStyle = backing. userInterfaceStyle
110+
108111 path. lineWidth = backing. shapeLineWidth
109112
110- backing. shapeFillColor? . setFill ( )
113+ backing. shapeFillColor?
114+ . resolvedColor ( with: . init( userInterfaceStyle: userInterfaceStyle) )
115+ . setFill ( )
116+
111117 path. fill ( )
112118
113- backing. shapeStrokeColor? . setStroke ( )
119+ backing. shapeStrokeColor?
120+ . resolvedColor ( with: . init( userInterfaceStyle: userInterfaceStyle) )
121+ . setStroke ( )
114122
115123 path. stroke ( )
116124
117125 }
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+
119141}
120142
0 commit comments