react-native
react-native copied to clipboard
[iOS] Add basic DisplayP3 color support
Summary:
This adds initial support for wide gamut (DisplayP3) colors to React Native iOS per the RFC. It provides the ability to set the default color space to sRGB or DisplayP3 and provides the native code necessary to support color() function syntax per the W3C CSS Color Module Level 4 spec. It does not yet support animations and requires additional JS code before fully supporting the color() function syntax.
Changelog:
[IOS] [ADDED] - Add basic DisplayP3 color support
Test Plan:
Follow test steps from #42831 to test support for color() function syntax.
To globally change the default color space to DisplayP3 make the following changes to RNTester AppDelegate.mm:
+ #import <React/RCTConvert.h>
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
// ...
+ RCTSetDefaultColorSpace(RCTColorSpaceDisplayP3);
return [super application:application didFinishLaunchingWithOptions:launchOptions];
}
| Platform | Engine | Arch | Size (bytes) | Diff |
|---|---|---|---|---|
| android | hermes | arm64-v8a | 17,242,525 | +9,239 |
| android | hermes | armeabi-v7a | n/a | -- |
| android | hermes | x86 | n/a | -- |
| android | hermes | x86_64 | n/a | -- |
| android | jsc | arm64-v8a | 20,608,998 | +8,893 |
| android | jsc | armeabi-v7a | n/a | -- |
| android | jsc | x86 | n/a | -- |
| android | jsc | x86_64 | n/a | -- |
Base commit: bc3fe0d76d9ca7613115d5f10b85ba7608561c02 Branch: main
@cipolleschi has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator.
@cipolleschi Thanks! That worked after I also updated React-graphics to only pull in React-jsi instead of all of React-Core.
@cipolleschi has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator.
Hi @ryanlntn, quick update on this: I'm having non-trivial issues making this build internally with BUCK2. I hope I'll be able to get it working by today or next week at most...
@cipolleschi merged this pull request in facebook/react-native@a40bd8e34a4de61e9f7690f808fe978fab1df11c.