Move isColorMeaningful to platform specific code (#31557) #5
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary:
isColorMeaningful
is the only place in xplat code that currently usescolorComponentsFromColor
, which assumes that a color is an RGBA value. When implementingPlatformColor
for windows, where colors might be complex patterns or effects, I'd like to keep the details ofSharedColor
isolated withinSharedColor
. This change movesisColorMeaningful
intocolor.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