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

Custom colors support #394

Open
lu-zero opened this issue Oct 15, 2024 · 4 comments
Open

Custom colors support #394

lu-zero opened this issue Oct 15, 2024 · 4 comments
Labels
enhancement New feature or request

Comments

@lu-zero
Copy link

lu-zero commented Oct 15, 2024

Would be acceptable to expose directly or proxy owo_colors and store in Info the Color enum extended to have a Custom variant?

I started looking at it and it seems simple enough beside design decisions regarding re-export.

@pacak
Copy link
Owner

pacak commented Oct 15, 2024

As in a single custom color or a custom color scheme? What's your use case?

@lu-zero
Copy link
Author

lu-zero commented Oct 15, 2024

A custom color scheme, the bright-colors felt a bit too bright so I started to look into having the scheme matching the one I see in other clis.

@pacak pacak added the enhancement New feature or request label Oct 15, 2024
@pacak
Copy link
Owner

pacak commented Oct 15, 2024

I see. And the dull-colors is not colorful enough?

I was thinking about adding this support myself in the next breaking release. I'll probably drop owo_colors dependency as well in favor of constructing ansi sequences by hand. The idea for API I have something like this:

There's a struct that contains ansi sequences for main items - one field per type: metavar, literal, etc. Info holds a static reference to that and you can pass your own. bpaf defines a few colorschemes somewhere inside, feature flags pick the default, but user can pass their own.

The idea is to have something low overhead / low API surface. Gimme a few days to experiment first.

@lu-zero
Copy link
Author

lu-zero commented Oct 15, 2024

Thank you :)

I was planning to simply take one function per field type and simply expose owo_colors since all in all it is simple enough and the functions signature would be probably something along the line of fn(&str) -> impl Display or such.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants