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

Support configuring colors #480

Closed
gregatgoogle opened this issue May 12, 2023 · 1 comment · Fixed by #482
Closed

Support configuring colors #480

gregatgoogle opened this issue May 12, 2023 · 1 comment · Fixed by #482
Labels
feature request A new lefthook feature description

Comments

@gregatgoogle
Copy link

⚡ Summary

Lefthook should support configuring colors in output instead of hardcoding them. Consider ANSI Escape Codes.

Value

The defaults colors are hard too see on light background. For example, here's how they look in Tokyonight Day:

image

From my perspective, the yellow and the green are impossible to read without significant strain.

Using the basic ANSI escape codes will allow users to configure colors once for their terminal and have them work without requiring special configuration for Lefthook. For example, Kitty allows redefining the basic colors. If Lefthook were to use ANSI escape codes, I wouldn't need to do anything special with Lefthook to make it output readable text, regardless of the theme I use.

Behavior and configuration changes

As of now, Lefthook uses hardcoded colors:

const (
colorCyan = "#70C0BA"
colorYellow = "#fada5e"
colorRed = "#ff6347"
colorGreen = "#76ff7a"
colorGray = "#808080"
)

Lefthook would instead of using these colors, output ANSI escape codes corresponding to its intended colors.

@gregatgoogle gregatgoogle added the feature request A new lefthook feature description label May 12, 2023
@mrexox mrexox mentioned this issue May 17, 2023
4 tasks
@mrexox
Copy link
Member

mrexox commented May 17, 2023

Hey! Thank you for the issue. I am going to support adaptive color codes in #482 and add an option to configure color codes from the config file. I hope to release it next week with v1.4.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature request A new lefthook feature description
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants