AnKing-VIP / AnkiRecolor

Recolor addon commissioned by and created for AnKing
38 stars 6 forks source link

Bug with color of highlighted background of cards in browse window on 2.1.55+ #24

Closed paragon0000 closed 1 year ago

paragon0000 commented 1 year ago

Problem description

Please describe the issue concisely in here. In case of an error: Walk us through the steps you took to get there. What happened? What did you expect to happen?

The option to change "highlighted background" is broken on 2.1.55+. It correctly changes the color of items in the dropdown menus but does not change the color of highlighted cards in the browse window. On 2.1.55+ the add-on defaults to a bright green color for highlighted cards in the browse window. This add on is working as intended in 2.1.54 but not in 2.1.55+. See attached screenshots.

Checklist

Please replace the space inside the brackets with an x if the following items apply:

What Anki version are you using?

*Please open Anki, go to Help → About (windows) or Anki → About Anki (mac) to find the version. Edit the value between the backticks below

2.1.55 qt6

Error message (if any)

If you've received an error message, please copy and paste it between the backticks below:

Screenshot 2023-01-15 153324 Screenshot 2023-01-15 153719

AnKingMed commented 1 year ago

I actually wonder if this was fixed in 2.1.56. Heard rumors it might be. Can you try that?

paragon0000 commented 1 year ago

Just tried it on 2.1.56 qt6 and I'm still having the same problem

AnKingMed commented 1 year ago

@BlueGreenMagick can you look into this?

BlueGreenMagick commented 1 year ago

Does it work after closing and reopening Browse window?

Spyhund commented 1 year ago

I have the same issue on 2.1.55 and 2.1.56. No change after closing and reopening browse window

paragon0000 commented 1 year ago

Yeah same here

arisp99 commented 1 year ago

@BlueGreenMagick, this seems to be an issue with the SELECTED_BG variable in the config.

https://github.com/AnKing-Memberships/AnkiRecolor/blob/6c08bf6e80d25f6a73768279b46681f0f494a676/src/addon/config.json#L40

The hex codes defined in the theme are not valid, so Anki defaults to a bright green. If you change that color in the settings (or advanced settings), the color highlight will be correct.

Note that these incorrect hex codes also appear in most of the built-in themes.

AnKingMed commented 1 year ago

@BlueGreenMagick are you able to fix this?

AnKingMed commented 1 year ago

@abdnh @BlueGreenMagick told me he was going into the military soon and I haven't heard from him in a while so he may be gone already. Can you look into fixing this? It looks like it's probably simple (hopefully)

abdnh commented 1 year ago

I pushed a change that fixed the issue for me on 2.1.60.

@paragon0000 @Spyhund let us know if that doesn't work for you after the next release. Note that the color of selected browser rows is governed by the Selected Bg option, not Highlight background (maybe this was different in older Anki versions).

@arisp99

The hex codes defined in the theme are not valid

The codes are valid.

If you change that color in the settings (or advanced settings), the color highlight will be correct.

Did you test that? In what Anki version?

paragon0000 commented 1 year ago

Just to let you know there is still this issue because of the incorrect hex codes on SELECTED_BG even on 2.1.60. d6d6d680 and 93c5fd80 are invalid hex codes so changing them fixed the issue as @arisp99 said.

abdnh commented 1 year ago

The colors are technically correct CSS colors that should work in all recent browsers (check out the link in my previous reply), but Qt apparently doesn't understand eight-digit colors yet. I'll look into updating the themes.