Skip to content

Translates iTerm2 color schemes between dark- and light-background, as well as performing other bulk editing tasks.

Notifications You must be signed in to change notification settings

crowsonkb/iterm_schemer

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 

Repository files navigation

iterm_schemer

iterm_schemer is a utility to translate the colors in iTerm2 color schemes between dark- and light-background. Using the CIECAM02 color appearance model and the CAM02-UCS color space, iterm_schemer predicts and corrects for the hue, saturation, and lightness shifts that occur when naively reversing the background and foreground colors. It is also capable of bulk-editing the lightness or colorfulness of all colors in a color scheme.

Dependencies

Currently iterm_schemer depends on my own branch of colour-science, which can be installed, along with numpy and scipy, via requirements.txt:

pip3 install -r requirements.txt

Usage

An example:

python3 -m iterm_schemer InputDark.itermcolors OutputLight.itermcolors --src-bg dark --dst-bg light --invert

This command line specifies to translate the colors in InputDark to what they should be on a light background. The --invert option goes on to actually invert the lightness of the background and foreground colors, making OutputLight.itermcolors a light-background color scheme.

Adjusting lightness and colorfulness only:

python3 -m iterm_schemer Input.itermcolors Output.itermcolors --j-fac 0.9 --m-fac 0.9

--j-fac 0.9 scales the lightness of all colors in the color scheme to 90% of their original values. --m-fac 0.9 does the same for the colorfulness (roughly, saturation) of all colors. The lightness and colorfulness can be adjusted separately without causing hue shift.

About

Translates iTerm2 color schemes between dark- and light-background, as well as performing other bulk editing tasks.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages