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 support for specifying theme colors as hex colors #647

Closed
khughitt opened this issue Apr 9, 2022 · 7 comments
Closed

Add support for specifying theme colors as hex colors #647

khughitt opened this issue Apr 9, 2022 · 7 comments
Labels
kind/enhancement Enhancement on current feature

Comments

@khughitt
Copy link

khughitt commented Apr 9, 2022

Greetings!

Is there any possibility that lsd could be extended so that theme colors could be specified using hex (or rgb, etc.)?

XTerm color codes are generally awkward to work with and make it difficult to use something like pywal to manage LSD's colors.

Thanks for all of your work on lsd so far! It's been fun to use.

@meain
Copy link
Member

meain commented Apr 10, 2022

This would be a good addition, but the changes would probably be in https://github.com/crossterm-rs/crossterm as we are relying on crossterm to deserialize.

@meain meain added the kind/enhancement Enhancement on current feature label Apr 10, 2022
@khughitt
Copy link
Author

Sounds good! It looks like crossterm might already supporting specifying colors as RGB triplets?

https://docs.rs/crossterm/latest/crossterm/style/enum.Color.html

That would already be quite useful. Supporting hex on top of that would just be a bonus, but probably would not be too much work. One could perhaps use the conversion functionality from something like colorsys.rs?

@meain
Copy link
Member

meain commented Apr 10, 2022

Yup, you can actually give RGB like [30,30,30] and that is possible in the theme config.

About the actual hex parsing implementation, I think it would be better to discuss about it in crossterm. I am assuming they would be happy to have deserialize from hex or maybe even hsl.

@zwpaper
Copy link
Member

zwpaper commented Apr 11, 2022

hi @khughitt, try the following theme config for RGB:

user:
- 30
- 30
- 30

@khughitt
Copy link
Author

Thanks! Heh, that almost does the trick. pywal does support writing out individual RGB triplet elements via user template modifiers (although this functionality appears to possibly be broken in the current release, 3.3.0), however, it writes on RGB floats.

zappolowski added a commit to zappolowski/lsd that referenced this issue Aug 29, 2023
Just delegate to the default deserializer of crossterm which learned
dealing with hex color in version 0.27.0.
zappolowski added a commit to zappolowski/lsd that referenced this issue Aug 29, 2023
Just delegate to the default deserializer of crossterm which learned
dealing with hex color in version 0.27.0.
zwpaper pushed a commit that referenced this issue Aug 30, 2023
Just delegate to the default deserializer of crossterm which learned
dealing with hex color in version 0.27.0.
@zwpaper
Copy link
Member

zwpaper commented Aug 30, 2023

fixed by #889

/close

@muniu-bot
Copy link

muniu-bot bot commented Aug 30, 2023

@zwpaper: Closing this issue.

In response to this:

fixed by #889

/close

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/enhancement Enhancement on current feature
Projects
None yet
Development

No branches or pull requests

3 participants