ankitects / ankitects/anki

Handle colours when pasting in night mode

Ouverte
#1,078 4 commentaires 5 réactions 0 personnes assignées Voir sur GitHub
editor
Langage dominant
Rust
Étoiles
30.5k
Forks
3.2k
Merge moyen
2 j 8 h
PR mergées (30 j)
60

Description

The paste filter in htmlFilter.ts currently strips formatting when pasting in night mode. The majority of pastes are coming from pages with light backgrounds, and thus have dark foregrounds, which tend to be difficult to read on a dark background. If we allow the background colour to come in as well, we end up with nasty-looking black-on-white strips of text.

We could use some color arithmetic to modify the colours as we paste, though we may end up with them being difficult to read if the user switches to day mode afterwards.

I believe AnkiDroid's default CSS inverts text colours in night mode. This changes the hue and doesn't look great, and I'm not sure how it would cope with content pasted from a dark website. But perhaps we could use a solution that adjusts the lightness while keeping the hue closer.

Suggestions or a PR welcome!

Guide de contribution

Ouvrir le guide de contribution

Évaluation

Cette issue n'a pas encore été évaluée.

Recevez les nouvelles issues par e-mail

Un résumé court des issues GitHub adaptées aux débutants.