Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Allow customization of some colors #48

Closed
acidghost opened this issue Feb 4, 2025 · 2 comments · Fixed by #51
Closed

Allow customization of some colors #48

acidghost opened this issue Feb 4, 2025 · 2 comments · Fixed by #51
Labels
enhancement New feature or request visuals UI stuff

Comments

@acidghost
Copy link
Contributor

Describe the solution you'd like

Ability to change some colors as defined in

const (
defaultBackgroundColor = "#282828"
activeTaskListColor = "#fe8019"
inactiveTaskListColor = "#928374"
taskEntryColor = "#8ec07c"
taskLogEntryColor = "#fabd2f"
taskLogListColor = "#b8bb26"
trackingColor = "#fabd2f"
activeTaskColor = "#8ec07c"
activeTaskBeginTimeColor = "#d3869b"
formFieldNameColor = "#8ec07c"
formHelpColor = "#928374"
formContextColor = "#fabd2f"
toolNameColor = "#fe8019"
recordsHeaderColor = "#d85d5d"
recordsFooterColor = "#ef8f62"
recordsBorderColor = "#665c54"
initialHelpMsgColor = "#a58390"
recordsDateRangeColor = "#fabd2f"
recordsHelpColor = "#928374"
helpMsgColor = "#83a598"
tLDetailsViewTitleColor = "#d3869b"
helpViewTitleColor = "#83a598"
helpHeaderColor = "#83a598"
helpSectionColor = "#bdae93"
warningColor = "#fb4934"
fallbackTaskColor = "#ada7ff"
)

This could be implemented in three levels:

  • CLI flags: easy to implement, less usability (e.g. users may alias hours='hours --colors...')
  • env variables: can be used as default values (if present) for CLI flags; users set them in their shell configs
  • full fledged configuration file: let's not go there, yet 😉

Is your feature request related to a problem? Please describe.

I'm a terminal freak and I want hours to be best looking.
This may also be an accessibility feature for people with vision deficiencies.

Describe alternatives you've considered

No alternatives, AFAIK.

@acidghost acidghost added the enhancement New feature or request label Feb 4, 2025
@acidghost
Copy link
Contributor Author

BTW I can work on this, given some direction on preferences.

@dhth
Copy link
Owner

dhth commented Feb 5, 2025

Hi. Thanks for the initiative!

This would definitely be a nice feature to have. I would go about it as follows:

  • Allow users to store theme files in their config directory (eg. ~/.config/hours/themes/custom-a.json). I'm thinking JSON files as they're the simplest to parse. os.UserConfigDir should do the trick.
  • These theme files don't need to provide a color for every UI element we're planning to support. If a value doesn't exist, we fallback to the default value.
  • Once a custom theme is set up, a user can pass in a flag to have that theme picked up.
    hours --theme custom-a
    In the future, we could ship built-in themes as well, and have the user ask for them in the same way.
    hours --theme catppuccin-mocha
  • At some point (once enough configuration accumulates up), hours will accept user config via more means (TOML/YAML file and environment vars). Allowing a dedicated way of providing theme config will allow a user to attach a theme to multiple config files (instead of having to copy and paste the theme config).

Lemme know if you have questions.

@dhth dhth added the visuals UI stuff label Feb 5, 2025
@dhth dhth closed this as completed in #51 Feb 22, 2025
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
enhancement New feature or request visuals UI stuff
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants