-
Notifications
You must be signed in to change notification settings - Fork 8
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
feat: tinty list --json
#94
Conversation
Accommodates desired use-cases like #74, which would be done as follows: # Print schemes in bg lightness order, from darkest to lightest
tinty list --json | jq 'sort_by(.lightness.background) | .[] | .id' -r |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks really good! 1 question/comment
src/utils.rs
Outdated
pub fn get_all_scheme_file_paths( | ||
schemes_path: &Path, | ||
scheme_systems_option: Option<SchemeSystem>, | ||
) -> Result<HashMap<String, (PathBuf, SchemeFile)>> { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this return value is redundant (let me know if I'm missing something). SchemeFile is an enum which contains Yaml(PathBuf) or Yml(PathBuf), so this return value could be:
) -> Result<HashMap<String, (PathBuf, SchemeFile)>> { | |
) -> Result<HashMap<String, SchemeFile>> { |
Nice! I'll merge after you add the documentation, changelog entry (under |
@JamyGolden Done! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great work! I'll create a release after merging
Published as 0.26.0 |
Btw if you're interested in being a maintainer of Tinty, let me know and I'll add you. |
@JamyGolden Yeah I'd love to help around here to move the project forward w/ y'all. I'll take your offer, thanks! |
Description
Produce a machine-readable list of schemes in the form of JSON. Each object in the array exposes a lot of data about the scheme:
id
- The unique identifier of the scheme e.g.base16-gruvbox-material-dark-hard
name
- The name of the scheme e.g.Gruvbox Material Dark, Hard
slug
- The name, slugified e.g.gruvbox-material-dark-hard
system
-base16
vsbase24
variant
-light
vsdark
author
- The authorpalette
- The color palette, keyed bybase[a-z0-F]{2}
:hex_str
- The hex string e.g.#ffffff
hex
- The hex componentsrgb
- The RGB valuesdec
- RGB values as 8-bit in decimal (rgb / 255
)lightness
- Perceived lightness of background and foreground colors, based on their luminance.Progress
Example
Output