Displaying Your Kitty Theme Colors
Update (12/15/21): So I hadn’t updated kitty in awhile, and now themes are built in. Everything is mostly the same, except that the file containing your colors has a different name. And you don’t have to install kitty-themes. I’ve updated accordingly.
Nothing groundbreaking here, but documenting for anyone it might help. Including myself.
I use kitty as my terminal. I recently decided to swap dark for light in my computing, so I chased down kitty-themes, installed Solarized Light . . . and discovered that some colors provided insufficient contrast for my old eyes. Easy enough to tweak the configuration file, once I knew what each color looked like. Here’s how to see all the colors in your kitty theme file:
- Install pastel. Either you already have and use it, or you’ll thank me for turning you on to this software.
- Pipe the colors from your
theme.conf
topastel
:
$ grep -o "#[a-f0-9]\{6\}" ~/.config/kitty/current-theme.conf | pastel color
That’s it. You’ll see output something like this:
The list will be longer, of course, and will show all the colors.
Happy theming!
For a more compact solution, tweak the command in this issue: https://github.com/sharkdp/pastel/issues/137
`for COLOR in $(grep -o “#[a-f0-9]\{6\}” ~/.config/kitty/current-theme.conf); do pastel paint $(pastel textcolor $COLOR) –on $COLOR “$COLOR “; done`
I created a shell function (tested on zsh) that wraps both these commands. You can type:
$ kittycolors
or
$ kittycolors -s
https://gist.github.com/hoop33/06f2d5a9555997d739def91c2ab402b6