-
Notifications
You must be signed in to change notification settings - Fork 24.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Accessible colors for DynamicColorIOS (#31651)
Summary: Allow you to harvest the `UIAccessibilityContrastHigh` trait from iOS to show accessible colors when high contrast mode is enabled. ```jsx // usage PlatformColorIOS({ light: '#eeeeee', dark: '#333333', highContrastLight: '#ffffff', highContrastDark: '#000000', }); // { // "dynamic": { // "light": "#eeeeee", // "dark": "#333333", // "highContrastLight": "#ffffff", // "highContrastDark": "#000000", // } // } ``` This is how apple's own dynamic system colors work under the hood (https://developer.apple.com/design/human-interface-guidelines/ios/visual-design/color/#dynamic-system-colors) --- The react native docs mention that more keys may become available in the future, which this PR is adding: > In the future, more keys might become available for different user preferences, like high contrast. https://reactnative.dev/docs/dynamiccolorios ## 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 --> [iOS] [Added] - High contrast dynamic color options for dark and light mode. Pull Request resolved: #31651 Test Plan: Added unit tests for `normalizeColor` to pass the high contrast colors downstream to RCTConvert Reviewed By: lunaleaps Differential Revision: D28922536 Pulled By: p-sun fbshipit-source-id: f81417f003c3adefac50e994e62b9be14ffa91a1
- Loading branch information
1 parent
4d40b53
commit 4b9d9dd
Showing
6 changed files
with
65 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters