conradludgate / wordle

Wordle TUI in Rust
122 stars 21 forks source link

Default color scheme is not colorblind-friendly #1

Open danielhoherd opened 2 years ago

danielhoherd commented 2 years ago

For colorblind people, the default settings of Wordle and this TUI are difficult to navigate due to the color scheme. Wordle does have a colorblind friendly mode that can be toggled on. This approach also has a problem though because by not having the default mode be colorblind-friendly, anybody who is colorblind cannot read the results that everybody else posts unless those people also turned their settings to be colorblind friendly. To that end I think that the interface should have a colorblind friendly color scheme as the default.

conradludgate commented 2 years ago

Thanks for the feedback. I think this is reasonable, and I'm a bit ashamed I didn't think of it. I'm not 100% sure how I can fix this though, so suggestions would be appreciated.

afh commented 2 years ago

@danielhoherd I'm wondering whether the terminal palette could be customized so that any program using the standard ANSI escape codes to display color would tend to the preferences of colorblind people. This might be a more comprehensive solution than trying to change terminal programs that output color.

Apple's Terminal.app has different "Profiles" in its Preferences (โŒ˜ ,) and allows creation of new as well as modification of existing profiles. For each profile the ANSI colours palette can be set. Using the Inspector (โŒ˜ I) the profile for the active window can be changed.

Preferences Inspector
Preferences Inspecotr

Other terminals like Alacritty or the venerable Xterm or terminal multiplexers like tmux also allow customisation of the color palette.

danielhoherd commented 2 years ago

I see two problems to solve with this app's color scheme. One is that the interactive interface is non-colorblind friendly. Secondly, the sharing text is not colorblind friendly. Those two color schemes use two different mechanics to display their colors.

The interactive app would be affected by what is described in the previous post. However, the next logical question is why should somebody have to alter the color palette that every single app will use instead of the app using a more colorblind friendly scheme? There are pros and cons to both. Surely having a more colorblind friendly color scheme would work for the 16 ansi colors shown in @afh's screenshot above, but with with xterm-256color it would be a lot harder. (I love that idea of having a more colorblind friendly terminal color palette though!)

Secondly, the share screen is a problem. Here is a post of the default share text:

$ ./wordle
Wordle 238 5/6
๐ŸŸจ๐ŸŸจ๐ŸŸจโฌ›๐ŸŸจ
๐ŸŸฉ๐ŸŸฉโฌ›โฌ›๐ŸŸจ
โฌ›โฌ›๐ŸŸฉ๐ŸŸฉ๐ŸŸฉ
๐ŸŸจ๐ŸŸจโฌ›๐ŸŸจ๐ŸŸจ
๐ŸŸฉ๐ŸŸฉ๐ŸŸฉ๐ŸŸฉ๐ŸŸฉ

Here's what that same result looks like from the colorblind-friendly web share:

Wordle 238 5/6

๐ŸŸฆ๐ŸŸฆ๐ŸŸฆโฌ›๐ŸŸฆ
๐ŸŸง๐ŸŸงโฌ›โฌ›๐ŸŸฆ
โฌ›โฌ›๐ŸŸง๐ŸŸง๐ŸŸง
๐ŸŸฆ๐ŸŸฆโฌ›๐ŸŸฆ๐ŸŸฆ
๐ŸŸง๐ŸŸง๐ŸŸง๐ŸŸง๐ŸŸง

Those characters will not be affected by the color preferences of the terminal, just like they aren't affected by the night/day mode of your browser, because they are emoji characters. For instance, the last character of the colorblind one is 0xf09f9fa7 and will always be an orange square.

Back to the wordle CLI command, the problem making the end result UI match the interactive UI is that there are no sets of alphanumeric blue and orange squares. I think just using blue and orange instead of yellow and green would be the best path forward.

afh commented 2 years ago

@danielhoherd What are your thoughts on wordle checking for the existence of an environment variable, I propose COLORBLINDNESS, and changing the output accordingly.

This could allow people to specify their colorblindness, e.g. COLORBLINDNESS=Tritanopia and terminal programs could use the existence of the environment variable to change to a colorblind friendly scheme or even take the specifics of the colorblindness into account and adapt their color output.

I've put up #15 as a first approach on this.

danielhoherd commented 2 years ago

@afh that's definitely one way to do it. IMHO colorblind friendly should be the default though, for the reasons I said in the original description:

by not having the default mode be colorblind-friendly, anybody who is colorblind cannot read the results that everybody else posts unless those people also turned their settings to be colorblind friendly.

conradludgate commented 2 years ago

Is the issue with playing the game (the background colours used in the TUI experience), or is it with the score card?

Blue/Orange doesn't feel like a perfect colour scheme to me. Green/Yellow (while difficult for those with RG colour-blindness) does indicate Good/Maybe by association with traffic light schemes.

danielhoherd commented 2 years ago

@conradludgate there are two problems.

One problem is that when a colorblind person like myself is playing, we basically cannot tell the difference between the current colors unless there are two different letters that are adjacent vertically or horizontally and I zoom waaaaaay in so the characters fill up most of my screen. This problem is a problem when a colorblind person is playing the game.

The second problem is when a non-colorblind person plays the game and shares their score card with a colorblind person. In that case, the colorblind person like myself cannot easily see their progress through guesses.

Also, FWIW, I installed this on my daughter's Ubuntu 21.10 laptop and its default terminal colors were different from my iTerm2 scheme and were also difficult to read.

conradludgate commented 2 years ago

Ok great, thanks for the feedback.

I think what I can do is add some colour configuration options to the player modes so that you can choose what you'd like to replace Green/Yellow as.

As for the score cards, I think a secondary utility that can convert them would be the best solution. If someone using the official version sends you their score card, you can copy it in to the second cli and it'll re-print it using your preferred colours. That way it's agnostic to this specific app

danielhoherd commented 2 years ago

@conradludgate honestly I don't think having a converter is worth the effort, but that's IMHO. I think it's really up to Wordle to make their game colorblind friendly by default. Colorblind friendly design can be very challenging, but IMHO it would be trivial for them to make their game work for everybody without making it any worse.

I do think that having a config option to change colors would be good. A user story for such a feature would be: Daniel wants to play through several Wordle days with his daughter. He is colorblind, but she is not. The app should have a configuration (either default or custom) that allows them to both interact with the game and distinguish all important visual game elements, either by color, pattern, or some other visual mechanism.

Also I appreciate you taking the time to talk through these options in your version. I'm using this as one of the ways to teach her how to use the command line. :)

rneswold commented 2 years ago

@danielhoherd, Is there an example of the preferred colors for Wordle clues for each type of color blindness? My project, rneswold/wordlebot, only uses the one, "high-contrast" setting that the web site used. But it would be nice to support other configurations.

danielhoherd commented 2 years ago

@rneswold I'm not aware of anywhere that shows wordle clues with UI's for each type of colorblindness. I'm not aware of any *rdle style games that have more than a single "colorblind mode" setting. Probably for this type of game, only one colorblind setting is needed though, because there are only three possible colors: wrong letter, letter in the wrong location, letter in the right location.

https://paletton.com/ has several colorblind simulations you can enable while creating palettes.

https://jfly.uni-koeln.de/color/#pallet has a "Set of colors that is unambiguous both to colorblinds and non-colorblinds".

https://colororacle.org is an app you can use to simulate different kinds of colorblindness on your desktop computer.