Skip to content

A helper tool written in Golang that can convert iTerm's `.itermcolors` plist format into human-readable hex codes for translation into other theme formats

License

Notifications You must be signed in to change notification settings

taylrfnt/iterm2hex

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

What is this Project?

iTerm has a large repository of themes and ports to other programs.

Some of the most common macOS terminal themes live in the iTerm native format, a .itermcolors format. This format is actuall an Apple .plist file (which itself is a wrapped XML format), and the colors within these files are normalized to be between 0 and 1, despite RGB values being between 0 and 255. It's annoying to extract colors from an .itermcolors file, so I wrote this tool to convert a given theme file into the appropriate hex codes for you.

It's worth noting that the iTerm project has their own python tools, I just wanted to build this using Golang to practice my data marshalling/unmarshalling, particularly with XML (or a deriavtive, in this case).

I expect this is not a comprehensive solution, nor is it intended to be a replacement of the iTerm tools - this is just a quick Go package to meet my needs. I may or may not update this in the future as I use it more or encounter issues.

Dependencies

plist package

This tool relies heavily on the plist package by DHowett. This library makes parsing .plist files as easy as the encode/json package.

Go

Thi package was written & built with Go v1.23

Installation

To install this package, clone the repo:

git clone https://github.com/taylrfnt/iterm2hex.git

Build the package:

cd iterm2hex && go build

Symlink or move the built package into your system's bin (or wherever you want to manage it that is in your $PATH).

Usage

To use this package, simply invoke it by its name and include a file path:

iterm2hex ${PATH_TO_FILE}

About

A helper tool written in Golang that can convert iTerm's `.itermcolors` plist format into human-readable hex codes for translation into other theme formats

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages