diff --git a/apple/RNSVGRenderable.h b/apple/RNSVGRenderable.h index 0515b4c95..82a964a10 100644 --- a/apple/RNSVGRenderable.h +++ b/apple/RNSVGRenderable.h @@ -35,6 +35,8 @@ @property (nonatomic, assign) CGPathRef hitArea; @property (nonatomic, strong) NSString *filter; +- (void)setColor:(RNSVGColor *)color; + - (void)setHitArea:(CGPathRef)path; - (NSArray *)getAttributeList; diff --git a/apple/RNSVGRenderable.mm b/apple/RNSVGRenderable.mm index 5c72547c1..f9d633ec9 100644 --- a/apple/RNSVGRenderable.mm +++ b/apple/RNSVGRenderable.mm @@ -59,6 +59,15 @@ - (void)invalidate self.dirty = true; } +- (void)setColor:(RNSVGColor *)color +{ + if (color == self.tintColor) { + return; + } + [self invalidate]; + self.tintColor = color; +} + - (void)setFill:(RNSVGBrush *)fill { if (fill == _fill) { diff --git a/apple/Utils/RNSVGFabricConversions.h b/apple/Utils/RNSVGFabricConversions.h index e730b15ff..f5b6906ae 100644 --- a/apple/Utils/RNSVGFabricConversions.h +++ b/apple/Utils/RNSVGFabricConversions.h @@ -141,7 +141,7 @@ void setCommonRenderableProps(const T &renderableProps, RNSVGRenderable *rendera { setCommonNodeProps(renderableProps, renderableNode); if (RCTUIColorFromSharedColor(renderableProps.color)) { - renderableNode.tintColor = RCTUIColorFromSharedColor(renderableProps.color); + [renderableNode setColor:RCTUIColorFromSharedColor(renderableProps.color)]; } renderableNode.fill = brushFromColorStruct(renderableProps.fill); renderableNode.fillOpacity = renderableProps.fillOpacity;