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

style: align flag colors and card browser background colors with upst… #18052

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

devyk100
Copy link

@devyk100 devyk100 commented Mar 4, 2025

…ream Anki desktop

Purpose / Description

The colors used in flag icons of the reviewer, and card browser background were different from Anki Desktop, this PR tries to match the flag colors and card browser background colors to the colors of the upstream desktop in both the dark and light modes.

Fixes

Approach

I presumed that the flag colors inside Anki Android are static values, unlike Anki desktop, I tried to match the exact values of dark, and light modes of flag icon colors and card browser flag background colors.

The flag icon colors were changed to the desktop upstream colors values _vars.scss, as these are directly used in theme.py to generate the flag icons.

The card browser background colors are generated from browser/table/init.py using the same color variables from _vars.scss but with 150% darker or lighter variation depending on the theme using QColor class's lighter and darker methods.

As these colors are generated and not hardcoded in the desktop upstream, I found the color values by writing my own python script which uses QColor from PyQt6 and _var.scss's color variables and does the required lighter and darker variation, and verified them by trying to log the colors from the desktop build.

How Has This Been Tested?

UI tested comparisons below

For the flag icon colors in the reviewer

Light mode

Desktop Before (Android) After commit (Android)
image image image

Dark mode

Desktop Before (Android) After commit (Android)
image image image

For the card browser backgrounds

Light mode

Desktop Before (Android) After commit (Android)
image image image

Dark mode

Desktop Before (Android) After commit (Android)
image image image

Checklist

Please, go through these checks before submitting the PR.

  • You have a descriptive commit message with a short title (first line, max 50 chars).
  • You have commented your code, particularly in hard-to-understand areas
  • You have performed a self-review of your own code
  • UI changes: include screenshots of all affected screens (in particular showing any new or changed strings)
  • [] UI Changes: You have tested your change using the Google Accessibility Scanner

@devyk100
Copy link
Author

devyk100 commented Mar 4, 2025

If there's any better way possible than this, I'd highly appreciate it.

@Haz3-jolt
Copy link
Contributor

@snowtimeglass your taste in design is immaculate, though this PR would improve consistency with desktop, I think the colors look a little too light, what do you think?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Match flag colors with Anki Desktop
2 participants