react-native
react-native copied to clipboard
[Android] Update HostPlatformColor to support color longs
Summary:
This adds support for color longs to HostPlatformColor per the wide gamut color RFC.
Changelog:
[ANDROID] [ADDED] - Update HostPlatformColor to support color longs
Test Plan:
This requires changes from https://github.com/facebook/react-native/pull/43030 to build and will only break text color until those components are updated to support color long values as well. Will update with a link to that PR soon.
@cipolleschi has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator.
Could we document what the magic numbers are doing? Maybe pull them out into constants?
Could we document what the magic numbers are doing? Maybe pull them out into constants?
@NickGerleman I pulled out the color space and component ratios definitions into constants. Should I do similar with the bit masks/shifts? I can't decide what's more readable.
| Platform | Engine | Arch | Size (bytes) | Diff |
|---|---|---|---|---|
| android | hermes | arm64-v8a | 19,394,073 | +32 |
| android | hermes | armeabi-v7a | n/a | -- |
| android | hermes | x86 | n/a | -- |
| android | hermes | x86_64 | n/a | -- |
| android | jsc | arm64-v8a | 22,767,695 | +13 |
| android | jsc | armeabi-v7a | n/a | -- |
| android | jsc | x86 | n/a | -- |
| android | jsc | x86_64 | n/a | -- |
Base commit: fe9942a19d65d30c1127af207cf7777465cb257e Branch: main
The shifts seem reasonably readable to me
@cipolleschi has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator.