Add support for specifying theme colors as hex colors
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.
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.
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?
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.
hi @khughitt, try the following theme config for RGB:
user:
- 30
- 30
- 30
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.
fixed by https://github.com/lsd-rs/lsd/pull/889
/close
@zwpaper: Closing this issue.
In response to this:
fixed by https://github.com/lsd-rs/lsd/pull/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.