Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Move isColorMeaningful to platform specific code (#31557) #5

Merged
merged 1 commit into from
May 24, 2021

Conversation

sakibguy
Copy link
Owner

Summary:
isColorMeaningful is the only place in xplat code that currently uses colorComponentsFromColor, which assumes that a color is an RGBA value. When implementing PlatformColor for windows, where colors might be complex patterns or effects, I'd like to keep the details of SharedColor isolated within SharedColor. This change moves isColorMeaningful into color.cpp, where each platform can provide an implementation that takes into account its platform specific color capabilities.

See microsoft/react-native-windows#7801 for an example of window's SharedColor which can be either an RGBA value, or a name of a native color/brush.

Changelog

[Internal] [Changed] - Move isColorMeaningful to platform specific code

Pull Request resolved: facebook#31557

Test Plan: This shouldn't change any of the code, its just moving the existing function - normal CI/automation should be plenty of validation.

Reviewed By: JoshuaGross, sammy-SC

Differential Revision: D28557698

Pulled By: mdvacca

fbshipit-source-id: 2a94850fe9c5037598107e1307f4153cee6491fb

Summary

Changelog

[CATEGORY] [TYPE] - Message

Test Plan

Summary:
`isColorMeaningful` is the only place in xplat code that currently uses `colorComponentsFromColor`, which assumes that a color is an RGBA value.  When implementing `PlatformColor` for windows, where colors might be complex patterns or effects, I'd like to keep the details of `SharedColor` isolated within `SharedColor`.  This change moves `isColorMeaningful` into `color.cpp`, where each platform can provide an implementation that takes into account its platform specific color capabilities.

See microsoft/react-native-windows#7801 for an example of window's SharedColor which can be either an RGBA value, or a name of a native color/brush.

## Changelog

<!-- Help reviewers and the release process by writing your own changelog entry. For an example, see:
https://github.com/facebook/react-native/wiki/Changelog
-->

[Internal] [Changed] - Move isColorMeaningful to platform specific code

Pull Request resolved: #31557

Test Plan: This shouldn't change any of the code, its just moving the existing function - normal CI/automation should be plenty of validation.

Reviewed By: JoshuaGross, sammy-SC

Differential Revision: D28557698

Pulled By: mdvacca

fbshipit-source-id: 2a94850fe9c5037598107e1307f4153cee6491fb
@sakibguy sakibguy added the bug label May 24, 2021
@sakibguy sakibguy self-assigned this May 24, 2021
@sakibguy sakibguy merged commit 0efcaad into sakibguy:master May 24, 2021
sakibguy pushed a commit that referenced this pull request Nov 29, 2021
Summary:
Previous iterations of this diff that were reverted: D30678341 (facebook@8009459), D30868627 (facebook@abd0f38),
D31024459 (facebook@0a46e5e), D31147242 (facebook@92c1bee).

With the power of selects, we can move the base AppleTVOS flags into the regular
base Apple flags.

Changelog: [Internal]

skip-frl-buck-targeting

Reviewed By: mzlee

Differential Revision: D31216242

fbshipit-source-id: 93ee2afda41af06fe210ba6a4a5459a438d6c3f8
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants