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

[iOS] Fabric: Fixes high contrast color when not specified #47418

Closed

Conversation

zhongwuzw
Copy link
Contributor

Summary:

Fixes the high contrast color when not specified. Previously, if we didn't specify highContrastLight or highContrastDark, it would create a UIColor with an alpha of 0, which is not what we expected. We should fall back to the dark or light color instead.

Changelog:

[IOS] [FIXED] - Fabric: Fixes high contrast color when not specified

Test Plan:

  1. Enable color contrast in iPhone's settings.
  2. Open PlatformColor example in RNTester. See dynamic colors
  3. color shows correctly
    image

Before:
image

@facebook-github-bot facebook-github-bot added CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. Shared with Meta Applied via automation to indicate that an Issue or Pull Request has been shared with the team. labels Nov 5, 2024
@zhongwuzw
Copy link
Contributor Author

@cipolleschi Hi, can you help me to review this? :)

Copy link
Contributor

@cipolleschi cipolleschi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Grat catch... creating a UIColor from 0 probably returns a black color rather than null..

@facebook-github-bot
Copy link
Contributor

@cipolleschi has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator.

@facebook-github-bot facebook-github-bot added the Merged This PR has been merged. label Nov 22, 2024
@facebook-github-bot
Copy link
Contributor

@cipolleschi merged this pull request in 89f93dc.

@react-native-bot
Copy link
Collaborator

This pull request was successfully merged by @zhongwuzw in 89f93dc

When will my fix make it into a release? | How to file a pick request?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. Merged This PR has been merged. Shared with Meta Applied via automation to indicate that an Issue or Pull Request has been shared with the team.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants