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:

  1. Install pastel. Either you already have and use it, or you’ll thank me for turning you on to this software.
  2. Pipe the colors from your theme.conf to pastel:
$ grep -o "#[a-f0-9]\{6\}" ~/.config/kitty/current-theme.conf | pastel color

That’s it. You’ll see output something like this:

Some of my kitty colors

The list will be longer, of course, and will show all the colors.

Happy theming!

2 Responses

  1. Rob Warner says:

    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`

  2. Rob Warner says:

    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

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.