Add Support for Wide Gamut (DisplayP3) Colors to React Native
React Native does not currently support wide gamut color spaces (i.e. DisplayP3). This proposal discusses adding support for this color space in React Native.
Thanks to @cipolleschi for his support in drafting this proposal!
Also FYI @vincentriemer as someone who has been interested in extended color space before.
cc @andreialecu who is also interested in this topic.
my understanding is that, unlike flutter to draw everything by their own. by leveraging the UIImage, we have the display p3 support already. the only missing piece is our coloring system as this pr pointed out.
alternatively, i was thinking to change from native code only without touching js code. if the screen supports display p3, we should just use the display p3 UIColor methods. having a small poc here: https://github.com/Kudo/displayp3/blob/main/modules/p3color/ios/p3colorView.swift
we can check whether the view support display p3 by self.traitCollection.displayGamut. then we can get this information from RCTRootView and pass down to some new UIColor factory.
Hi everyone, thanks for chiming in and for providing your feedback! :D
alternatively, i was thinking to change from native code only without touching js code. if the screen supports display p3, we should just use the display p3 UIColor methods. having a small poc here: Kudo/displayp3@main/modules/p3color/ios/p3colorView.swift we can check whether the view support display p3 by self.traitCollection.displayGamut. then we can get this information from RCTRootView and pass down to some new UIColor factory.
@Kudo unfortunately we can't go all-in and update everything, even if I agree that it will look better. We have several tests that will fail internally if we do that, and other companies could incur in the same issues. Also, some designers might not be happy to see that the app colors suddenly changed to different ones. 😅
A tweet around this went semi-viral https://twitter.com/lauridskern/status/1717237553886081252