diff --git a/ReactCommon/react/renderer/graphics/platform/ios/PlatformColorParser.h b/ReactCommon/react/renderer/graphics/platform/ios/PlatformColorParser.h index ad512693369..3437b280760 100644 --- a/ReactCommon/react/renderer/graphics/platform/ios/PlatformColorParser.h +++ b/ReactCommon/react/renderer/graphics/platform/ios/PlatformColorParser.h @@ -10,6 +10,7 @@ #include #include #include +#include namespace facebook { namespace react { @@ -17,13 +18,16 @@ namespace react { inline ColorComponents parsePlatformColor( const PropsParserContext &context, const RawValue &value) { - // TODO T87791134: implement parsing of PlatformColor for iOS - float alpha = 0; - float red = 0; - float green = 0; - float blue = 0; + if (value.hasType>()) { + auto items = (better::map)value; + if (items.find("semantic") != items.end() && + items.at("semantic").hasType>()) { + auto semanticItems = (std::vector)items.at("semantic"); + return RCTPlatformColorComponentsFromSemanticItems(semanticItems); + } + } - return {red, green, blue, alpha}; + return {0, 0, 0, 0}; } } // namespace react