fix(filter-chip,suggestion-chip): support a11y high contrast mode on chip components#1195
Open
fix(filter-chip,suggestion-chip): support a11y high contrast mode on chip components#1195
Conversation
1 task
🟢 Netlify deploy for commit f598919 succeededDeploy preview: https://69fb1513a9a5692ecde2041e--ouds-android.netlify.app |
a75b4c8 to
d42deab
Compare
692fe97 to
b4e2a65
Compare
d3269b5 to
11d129c
Compare
11d129c to
d3269b5
Compare
… use of a new available API
d3269b5 to
f598919
Compare
| if (!LocalHighContrastModeEnabled.current) return this | ||
|
|
||
| // Composite the background over primary background color to handle transparency | ||
| val effectiveBackground = background.compositeOver(OudsTheme.colorScheme.background.primary) |
Member
There was a problem hiding this comment.
If I am correct, this line makes the assumption that the background color of the app is always background primary. Are we sure about that?
| val effectiveColor = compositeOver(effectiveBackground) | ||
|
|
||
| // Return the best contrast color for the current color | ||
| return if (effectiveColor.luminance() < 0.3f) { |
Member
There was a problem hiding this comment.
Where does 0.3f comes from? I would have naively thought that we should use 0.5f.
| * @return `OudsTheme.colorScheme.always.black` or `OudsTheme.colorScheme.always.white` color when high contrast mode is enabled, or the original color otherwise. | ||
| */ | ||
| @Composable | ||
| fun Color.highContrasted(background: Color = Color.Transparent): Color { |
Member
There was a problem hiding this comment.
Should this method be internal?
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
No description provided.