Add a theme based on the 3-bit ANSI colors #159
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR adds a new color which uses the 3-bit ANSI colors rather than using the 256-bit colors as in the existing themes. Since Clipboard only has five colors in its output, I was able to stick to just those 3-bit colors and no high-intensity variants.
I would have opened an issue for this, but I checked out the code and it looked so easy to add this that I just went for it. I hope that's ok 🙂
I named the theme
ansi
because that's what Bat calls its version of this theme.Motivation and Demo
The built-in themes weren't enough for me because some of the terminals I use are set to a light theme, and others are set to a dark theme. Unfortunately, the light-friendly themes don't look great when running in a dark terminal and vice versa.
The nice thing about those 3-bit colors is that they're theme-agnostic. Themes are usually designed to have readable colors with good contrast, so command line tools can take advantage of that to output text that is guaranteed to be readable no matter the user's terminal theme preferences. In other words, there's no reason to have separate dark and light variants.
As an example, here's what Clipboard's light theme looks like in my low-saturation, light-themed VSCode terminal:
And here it is using the new
ansi
theme:I think the latter fits in much better with the overall vibe, and matches the colors of the prompt and most other colored output.