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

Add configurable color settings for the Net column in the history report #3690

Open
d2718nis opened this issue Nov 20, 2024 · 0 comments
Open
Labels
topic:themes Issues related to color themes or colorized output

Comments

@d2718nis
Copy link
Contributor

d2718nis commented Nov 20, 2024

Current Behavior

Currently, the Net column in the history report uses hardcoded red and green colors to indicate negative and positive values, respectively.

Problem

For *-256.theme themes, which are intended to work independently of terminal themes, these hardcoded values depend on the terminal's configuration. This can result in colors that may not match the intended design of the theme, leading to inconsistencies or poor readability.

Proposed Solution

Introduce two new color settings:

color.history.net.positive=red
color.history.net.negative=green

Modify the code to use these settings:

Color net_color;
if (Context::getContext().color() && net) {
    net_color = (net > 0) 
        ? Color(Context::getContext().config.get("color.history.net.positive"))
        : Color(Context::getContext().config.get("color.history.net.negative"));
}

view.set(row, HistoryStrategy::dateFieldCount + 3, net, net_color);

These settings should probably default to red and green, maintaining the current behavior, while allowing theme developers to redefine them.

Additional Notes

  • Add these settings to the default theme configuration generated here
  • Update taskrc man page
  • The use of color for the Net column is briefly mentioned in this comment
@djmitche djmitche added the topic:themes Issues related to color themes or colorized output label Nov 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
topic:themes Issues related to color themes or colorized output
Projects
Status: Backlog
Development

No branches or pull requests

2 participants