pigoz / anki-canvas

🖌️ Drawing area widget for Anki to practice Kanji writing
GNU Affero General Public License v3.0
38 stars 2 forks source link

Use "contrast" colors instead of "spectrum" colors #8

Closed ukanuk closed 4 years ago

ukanuk commented 4 years ago

Thank you for this amazing function!!! I've gotten a vastly different card setup and typically write on pen/paper, but have added your drawing canvas to my card and love it when I'm on public transit and it's too shaky to use pen/paper!

One slight issue though, I've set up my diagrams to use the "contrast" coloring rather than "spectrum" coloring (Tools > Add-ons > Kanji Colorizer stroke order diagrams > Config and replace "mode": "spectrum", with "mode": "contrast",.

Can you implement similar functionality?

Or if you don't have time, could you point me at the parts of the javascript actually picking the colors for each stroke? I've done some C and python coding in my time, but am pretty unfamiliar with javascript and would have trouble going through your stuff from scratch. But if you pointed me to the relevant sections of code, maybe I could hack something together that works.

If you're curious, this is what my cards look like:

Front image

Rear image

pigoz commented 4 years ago

Hi! Glad you find the project useful. ✨ I use it on public transit too: on my phone using a stylus.

I've just made a new release (v0.6) which allows you to choose the colorizer. More info on the README.

Please reopen the issue if you have issues setting it up, or it doesn't work as expected.

ukanuk commented 4 years ago

I don't believe I have the ability to re-open this issue. Unfortunately when I imported your latest deck.apkg, it's not working as expected. First, the back card preview doesn't work at all (though it does work on the actual card, so maybe this is some unfortunate workaround?). Second, I changed the colorizer to 'contrast' but it's still using spectrum coloring.

Thank you for the quick response!

image

pigoz commented 4 years ago

Whoops, that was a nasty bug. 🐛 Should be fixed in https://github.com/pigoz/anki-canvas/releases/tag/v0.7

Please let me know if it works for you!

ukanuk commented 4 years ago

The back card preview still doesn't work at all in 0.7, despite having worked in version 0.5.

But, I tested the actual card and that seems to work both with front and rear of card, at least in light mode. I'll test dark mode later, but I assume that doesn't make any difference.

0.7 card preview image

0.5 card preview image

pigoz commented 4 years ago

I've fixed the card preview in 0.8! Thank you for all the testing & feedback.

ukanuk commented 4 years ago

All seems to be working well in my tests, thank you for this!!!