style: align flag colors and card browser background colors with upst… #18052
+31
−21
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.
…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 usingQColor
class'slighter
anddarker
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
fromPyQt6
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
Dark mode
For the card browser backgrounds
Light mode
Dark mode
Checklist
Please, go through these checks before submitting the PR.