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

Fix #4952 - Low contrast menus when reduced transparency/inc. contrast are enabled #5282

Conversation

peterkos
Copy link

@peterkos peterkos commented Jul 23, 2019

Fixes #4952

This PR addresses unreadable contrast in popover menus when the "reduced transparency" and/or "increased contrast" accessibility settings are enabled, specifically in night mode.

Reduced transparency behavior in popup views

The current behavior of popup views in night mode is actually a bug -- there was no defined background blur style for the night theme, it just used the normal theme's color.

Enabling reduced transparency would flatten the opaque blur effect view, and show the original white background.

This is fixed by defining a dark blur style (that matches the "close" button's color, save for transparency), and removing the 0.9 alpha on the light theme. Additionally, the blur is now conditionally applied when accessibility is turned on/off.

Old light style New dark style

The potential downside here is decreased contrast with dark-background websites.

Increased contrast behavior in popup views

Previously, the popup action sheet cell would use tintColor as its text color, which is not inline with other table views which use rowColor. Enabling "increased contrast" causes iOS to darken the tint color, which doesn't help in this scenario (dark background!).

The fix here is changing tintColor to rowColor for the PhotonActionSheetCell, and modifying the foreground color in the DarkTheme file.

Old (Inc. contr enabled) New (Inc. contr enabled)

Sidenote:
Apple has no documentation on how reduced transparency/increased contrast is implemented! Most of my work here has been through the UI debugger.

Previous color was a result of no defined background color
Blur effect in PhotonActionSheet disables on reduced transparency, enables otherwise
Light theme removes alpha on background to deal with above case
Tint colors are modified by iOS when increased contrast is enabled — now, the behavior for PhotonActionSheetCell is accessible, in addition to being inline with ThemedWidgets.
This increases readability for when “increase contrast” is enabled.
@peterkos peterkos changed the title Peterkos/1550125 low contrast menu accessibility Fix #4952 - Low contrast menus when reduced transparency/inc. contrast are enabled Jul 23, 2019
@garvankeeley garvankeeley self-requested a review July 31, 2019 14:37
Also:
- flipped reduce transparency logic to be more readable -> (isEnabled) instead of (!isEnabled)
- Changed Theme ActionMenuColor to be inline with corresponding DarkTheme color, by just using defaultBackground
@garvankeeley garvankeeley merged commit 0d0c4cb into mozilla-mobile:master Aug 1, 2019
pull bot pushed a commit to scope-demo/firefox-ios that referenced this pull request Aug 1, 2019
…y/inc. contrast are enabled (mozilla-mobile#5282)

* Night mode blur color, and reduce transparency

Previous color was a result of no defined background color
Blur effect in PhotonActionSheet disables on reduced transparency, enables otherwise
Light theme removes alpha on background to deal with above case

* Fixed title and subtitle text colors

Tint colors are modified by iOS when increased contrast is enabled — now, the behavior for PhotonActionSheetCell is accessible, in addition to being inline with ThemedWidgets.

* Night mode action foreground color -> white

This increases readability for when “increase contrast” is enabled.

* Disable theme bg alpha on reduced transprency

Also:
- flipped reduce transparency logic to be more readable -> (isEnabled) instead of (!isEnabled)
- Changed Theme ActionMenuColor to be inline with corresponding DarkTheme color, by just using defaultBackground
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants