cschiller / zhongwen

Official source code of the "Zhongwen" Chrome extension
https://chrome.google.com/webstore/detail/zhongwen-chinese-english/kkmlkkjojmombglmlpbpapmhcaljjkde
GNU General Public License v2.0
312 stars 52 forks source link

Add option for custom tone colors #88

Open lionel-rowe opened 2 years ago

lionel-rowe commented 2 years ago

Adds an option for custom tone colors, with individual customization options for each tone conditionally shown when the new option is selected.

custom-tone-colors

danielslabo commented 2 years ago

Not sure if this pull request will get traction but as a user I like this too. I study chinese characters on anki and the decks I use have tone colors, pleco has tone colors, and this extension does too. Having them all be in sync would be a small nice to have (for me I'm used to Pleco's colors as it was my first app/tool I began using).

I can see though how custom colors can negatively impact the text readability given the background of the zhongwen info should a user make a poor choice of a custom color tone.

lionel-rowe commented 2 years ago

I can see though how custom colors can negatively impact the text readability given the background of the zhongwen info should a user make a poor choice of a custom color tone.

I could add either a preview or even a WCAG color contrast checker to mitigate that problem, though IMO it seems kinda overkill for an advanced customization option that will probably only be used by a minority of users (plus it only affects that individual user, and they know their own capability of distinguishing colors better than anyone else). In any case, will wait to see if @cschiller has any comments before making any changes.

cschiller commented 2 years ago

Hi @lionel-rowe, in my opinion, tone colors are similar to the colors of a traffic light. They carry a specific meaning and should not be configurable. Ideally, there should only be one color scheme. Unfortunately, there are already three color schemes out there that I'm aware of: MDBG (Zhongwen uses this by default), Pleco and Hanping.

I personally see no benefit in giving users more choice here. It would only add to the confusion. Imagine you're driving into a town where the mayor has decided to change the colors of all the traffic lights. For instance, the lights might be blue instead of red, purple instead of yellow, and orange instead of green. I'm sure you agree that this would be a really bad idea.

For this reason, I deliberately only let users choose between the existing color schemes mentioned above.

I'm curious, though, what colors would you want to choose (and why)?

lionel-rowe commented 2 years ago

I agree that it should be an advanced option, hidden behind a toggle. I don't agree that it will cause confusion merely by being available, though; no-one has to use it, and the fact that there are already multiple options in common usage shows that there's no single standard. I just checked MDBG, for example, and they offer 2 options for tone color schemes, of which the first is the same as Zhongwen's "default" option, but the second is different from all 3 current options! I suspect you'd find a good few more if you did a survey of the top 100 or so popular Chinese-learning sites.

As for me, I'd use the same colors as I use in Pleco (which allows custom tone colors): 1 blue sky (high and level), 2 green treetops (mid and rising), 3 purple down below because it's the darkest, 4 red for anger.

cschiller commented 2 years ago

Actually MDBG lets you choose between their default "MDBG colors" and "Pleco colors." (You can verify this by hovering with the mouse over the corresponding setting and looking at the tooltip.)

Here's some more background about tone colors: https://laowaichinese.net/tone-colors-and-what-pleco-did-with-them.htm

lionel-rowe commented 2 years ago

Actually MDBG lets you choose between their default "MDBG colors" and "Pleco colors." (You can verify this by hovering with the mouse over the corresponding setting and looking at the tooltip.)

Ahh I see, yeah they just look different in the dark theme (more like pastel shades) so my eyes didn't parse them as being the same color set.

Here's some more background about tone colors: https://laowaichinese.net/tone-colors-and-what-pleco-did-with-them.htm

I think these quotes from that article are relevant 😉

I hope all you who are developing apps that include tone colors will follow Pleco’s lead on this: go ahead and pick your favorite defaults (Michael Love said “I believe the (Pleco) colors were originally chosen based on what colors of pen the friend of mine who came up with it had available”), but please PLEASE let us users customize them.

and

I’ve found that people feel very strongly about “their colors.” And I think a consensus is impossible to reach.

cschiller commented 2 years ago

Keep in mind, though, that at the time the article was written, MDBG didn't have the option to show Pleco colors, but now it does.

I also changed my Pleco colors - to MDBG. 😉