Skip to content
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

Legibility and color contrast on the default theme #3376

Open
adriangalilea opened this issue Apr 18, 2024 · 13 comments
Open

Legibility and color contrast on the default theme #3376

adriangalilea opened this issue Apr 18, 2024 · 13 comments
Labels
topic:colors Issues related to color schemes or colorized output

Comments

@adriangalilea
Copy link

Hello,

The themes on taskwarrior make it very hard to read certain tasks

image

I tried a few different of the other themes, and have problems one way or another, I think this should be fixed, at the very least on the default theme.

Thanks.

@djmitche
Copy link
Collaborator

I think at least some of the themes were designed for a white background. I too have a dark background and I recall adjusting the color scheme pretty soon after starting to use TW.

It would be interesting to do some analysis of color schemes from an a18y and UX perspective and select good default themes for both dark and light backgrounds. I don't think there's any way to tell what the default background is for a terminal, so that would probably have to be in taskrc. I suspect different terminals look quite different, too, so that would take some comparison across the typical terminals on each platform.

If you'd be interested in doing that kind of analysis and developing a better color scheme, please do!

@adriangalilea
Copy link
Author

adriangalilea commented Apr 19, 2024

If you'd be interested in doing that kind of analysis and developing a better color scheme, please do!

As for documentation all I see is this docs which isn't very helpful. I'm digging in the code and learned about task color, will be taking a look at it.

As for the light/dark is there any way I can create a theme that's responsive in that regard?

I think at least some of the themes were designed for a white background.

This contradicts the docs:

By default, without any selected theme, Taskwarrior uses a simple dark theme (dark-16.theme or dark-256.theme depending on your system). This means there is the assumption of a dark-background in your terminal. If you use a light background this will look bad, and you should select a light theme instead.

image

I tried kitty terminal and warp they all looked different than this screenshot.

So... do other people see the default theme different than me perhaps?

EDIT: is there a way to define opacity/alpha I use it heavily when designing UI

@adriangalilea
Copy link
Author

adriangalilea commented Apr 19, 2024

I think something's odd, all the screenshots on the color themes page show better contrast and legibility than what I experience.

In the meantime, I'll be using this theme, which is not something I like, but at least fixes my issues with every other theme I tested.

image

https://gist.github.com/adriangalilea/c0756755d364e87ccca186b1e0361d3d

I would love to have more colors and control somehow.

@djmitche
Copy link
Collaborator

Terminals are several decades older than I am, and have the layers of cruft to prove it. The bit that Taskwarrior control involves sending byte sequences to the terminal to request specific colors, and those vary from terminal to terminal. Different terminal apps all make slightly different choices, whether that's in how they interpret the "standard" colors, the fonts they use, or how they render those fonts. Many terminals now support 256-color mode, which I expect offers a bit more control, but probably still differs from place to place. To my knowledge, there are no escape codes to control alpha. The terminals that do support alpha-blending are making their own determination of what to blend -- whether that's just the black background, all character backgrounds, or the entire window, or something else.

All of which is to say - there's lots of variability here, and I don't know how readily we could find a "good" general theme. But I'm glad you found something that works for you!

@adriangalilea
Copy link
Author

Thanks, forgetting about transparency then.

What still bugs me is how different the screenshots look from what I see in 3 different terminals on mac,

Are the screenshots on the theme docs a good representation of how they really look like nowadays?

@djmitche
Copy link
Collaborator

I don't know what terminal was used to make those screenshots, but I would guess it's a good representation of how they look on that terminal, with the same fonts, etc.

@adriangalilea
Copy link
Author

I don't know what terminal was used to make those screenshots, but I would guess it's a good representation of how they look on that terminal, with the same fonts, etc.

I ask because I tried 3 different terminals, with different fonts, warp, terminal and kitty and in all of them there are items that can't be read with certain combinations.

Do you have items with poor legibility like I shown in the first pic on the default theme? @djmitche

@djmitche
Copy link
Collaborator

If I remove all of the colors from my .taskrc, this is what it looks like:
image
I'm using urxvt256c on Linux with

  URxvt*foreground: White
  URxvt*background: Black
  URxvt*font: xft:Terminal-8                                                                                                                                                                                                                                                                                                   
  URxvt.letterSpace: -1
  URxvt.color12:      #1070ff                                                                                                                                                                                                                                                                                                  
  URxvt*color1:  #d83030                                                                                                                                                                                                                                                                                                       
  URxvt*color8:  #909090                                                                                                                                                                                                                                                                                                       
                                                                                                                                                                                                                                                                                                                               
  ! Xft                                                                                                                                                                                                                                                                                                                        
  Xft.dpi: 96.0                                                                                                                                                                                                                                                                                                                
  Xft.antialias: true                                                                                                                                                                                                                                                                                                          
  Xft.hinting: true                                                                                                                                                                                                                                                                                                            
  Xft.hintstyle: hintfull                                                                                                                                                                                                                                                                                                      

Those URxvt*color..options adjust some of the "standard" terminal colors, so maybe that helps with the appearance? I believe (it was a long time ago!) I made those adjustments because things like ls were showing blue text on a black background and it was very difficult to see. I think the Xft changes made the fonts anti-alias a bit better and thus look better at smaller sizes?

@adriangalilea
Copy link
Author

Thank you, (love the gardening stuff :P)

It seems to be similar to mine, I'm guessing if you have a yellow text task with white bg you have the exact same issue I was referring to.

But that doesn't seem to occur on the screenshots in the docs not sure what could have happened but all themes there look better than what I get in any terminal.

I can try to create a theme that solves the legibility issues and be as nice as possible. Is there any way I could reasonably access to more colors? If not I will see what I can do.

@djmitche
Copy link
Collaborator

If your terminal supports 256 colors then yes! I'm not sure there are any terminals that support more than 256..

@adriangalilea
Copy link
Author

If your terminal supports 256 colors then yes! I'm not sure there are any terminals that support more than 256..

Oh yeah, that's how I see the output of task color :) I meant more than that but I guess the limiting factor is the terminal then, alright, will investigate, many thanks!

@adriangalilea
Copy link
Author

@djmitche I landed at this theme:

image

I have no legibility issues and I think it's pleasing enough.

One of the keys was using inverse in order to preserve legibility on some complex tasks like overdue, scheduled and next all at the same time.

Do I PR?

@djmitche
Copy link
Collaborator

I don't see any reason not to add another theme - a PR would be great!

@djmitche djmitche added the topic:colors Issues related to color schemes or colorized output label May 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
topic:colors Issues related to color schemes or colorized output
Projects
None yet
Development

No branches or pull requests

2 participants