-
-
Notifications
You must be signed in to change notification settings - Fork 40
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
suggested color changes for cherry-picker output #120
base: main
Are you sure you want to change the base?
Conversation
Please could you share some screenshots of output? We should probably support https://no-color.org/ so people who have difficulty reading coloured output can disable it by setting a Unfortunately Click doesn't support it, they suggest project implement it themselves: pallets/click#1090, pallets/click#1498, pallets/click#2207, pallets/click#2282 However, https://no-color.org/ does list https://github.com/kdeldycke/click-extra, perhaps we can use that? |
@hugovk I pushed changes to support I have it installed locally and will use it when I can. (I guess I should make some more CPython doc changes...) You can check out this and try it locally as well. |
Thanks Hugo. No output from after executing
Also, someone more familiar with click-extra might want to replace my simplistic color support and see if that makes more sense. If any documentation changes I've worked on recently ever make it through the mill and generate backport conflicts I might try that, but as a first cut, the bright/dim seems okay to me. |
Here's some screenshots of simulating colour blindness with the https://github.com/oftheheadland/Colorblindly browser extension. Quite a few of them show the second "red" chunk as less obvious than the first "white" chunk: |
Thanks. I wasn't aware of that browser extension and installed it. Viewing my original screenshot (white background) using the various settings, the I'll see about adding |
It would be good to figure out some good defaults, as I'm guessing most won't want to fine tune the options. The colour names supported by Click: |
The 16 named colours are determined by the terminal. If there's e.g. not enough contrast between background and red in the default settings, you should probably report it to the terminal devs. That also means you shouldn't use direct RGB values, or the 256-colour palette. (Unless you also paint the background using RGB, which looks bad if it's not a “full-screen” app.) So, my suggestion: stick to 16 named colours, implement |
@encukou Shouldn't the user have the choice to specify colors of their choosing? After all, nobody will know their preferred color palette better. (In my experience, some people have pretty unusual color preferences.) In my sandbox, in addition to the named colors, I currently support hex strings (six-digit and three-digit) which I convert to the relevant tuple of ints. If something doesn't work right, the user is welcome to choose different colors. Also, it seems with my white background on my Mac and @hugovk's black backrgound on his system, it's pretty obvious finding a single "bright" and "dim" color pair that will work just with those two backgrounds will be hard. And what of users who like grey backgrounds? |
New version. Colors in the form 0xRRGGBB, 0xRGB or (red, green, blue) are supported. If none of those match, the input color is simply assumed to be a named color supported by Click. (I could verify that I suppose, though I don't see a canonical list in click itself, just a list in the |
Any further feedback? Whether or not they are generally useful, I do have defaults for the bright and dim colors:
Those work well for me (white background, not red/green color blind). I'm more than happy to pick a different bright color if there is one which people feel would be generally useful in most cases (various types of colorblindness, common terminal background colors). |
See the CI failures: we can't use the I'm also not sure if we need to expose |
Sorry, I wasn't aware of the 3.8 support. I've removed the match statement and executed tox (which I'd been ignoring before). I don't have a 3.8 interpreter, but it ran fine back to 3.9:
You mentioned not needing
If so, how would I tell click to look there for those option values? (I've really never used click before, and was just parroting what I saw in the existing code.) |
I do not want to set the colors for each small tool I use. IMO, it's more important to pick good defaults than to allow customization. As mentioned before, |
@hugovk I think I figured out the argument/option thing and made |
We seem to be at an impasse. In my mind, the user sets a desired terminal background color. The cherry-picker user can set a text foreground color. I do not ever set a background color for the text. In this particular application, it would likely have the opposite of the desired effect, making the I don't believe there is a perfect "dim" color given that users are free to choose whatever tickles their fancy as their preferred terminal background. You like black. I like white. Tell me a good "dim" foreground color you think would work for both. If using color to distinguish cherry-picker output from git output isn't going to work, think of some other way to make cherry-picker's output more obviously what the user should be paying most attention to. |
I want cherry-picker to “just work”. If its output becomes unreadable with the default configuration, and I need to study how to configure it, that's a regression for me.
|
Per #116, here's a first cut at dimming the output of
git cherry-pick
and making the output ofcherry_picker
more prominent.