Skip to content

ylub/themaker

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

THEMaker

THEMaker turns a Coolors palette or a list of hex colors into terminal color themes.

It currently exports:

  • iTerm2 .itermcolors
  • macOS Terminal .terminal
  • Kitty .conf
  • Alacritty .toml
  • WezTerm .lua
  • CotEditor .cottheme
  • Tuxedo .tuxedo.toml
  • Source .yaml for terminal color scheme repos
  • Portable JSON theme data for someone else or another tool to export later

THEMaker uses only the Python standard library.

THEMaker ANSI color suggestions

THEMaker terminal preview

Screenshots captured in iTerm2 with help from macshot.

Quick Start

Run the wizard:

python3 themaker.py

Check the version:

python3 themaker.py --version

Use a palette from the command line and continue in the wizard:

python3 themaker.py --palette "25ced1 ffffff fceade ff8a5b ea526f"

Hex colors may be written as 6-digit RGB, 8-digit RGBA, or short 4-digit RGBA. Alpha values are accepted for convenience and ignored when exporting terminal themes.

Choose export formats up front:

python3 themaker.py --palette "25ced1 ffffff fceade ff8a5b ea526f" --format "iterm kitty"

Save somewhere else:

python3 themaker.py --out ./exports

Edit an existing iTerm theme:

python3 themaker.py --edit colors/example.itermcolors

List existing editable iTerm themes in an output folder:

python3 themaker.py --list-themes --out colors

Show credits and project information:

python3 themaker.py --about

Skip the startup banner in interactive mode:

python3 themaker.py --no-splash

Export Choices

At the save step, THEMaker asks what to export:

  • all exports every supported format
  • one asks for a single format
  • some asks for multiple formats
  • data saves only portable JSON theme data

Supported format names are:

iterm terminal kitty alacritty wezterm coteditor tuxedo yaml data
Format Extension Use
iterm .itermcolors Import into iTerm2.
terminal .terminal Import into macOS Terminal.
kitty .conf Include or copy into Kitty config.
alacritty .toml Import or copy into Alacritty config.
wezterm .lua Require or copy into WezTerm config.
coteditor .cottheme Import into CotEditor.
tuxedo .tuxedo.toml Copy into Tuxedo's themes directory.
yaml .yaml Submit source schemes to terminal color scheme repos.
data .json Save portable theme data for another tool or maintainer.

If a target file already exists, the wizard asks before overwriting it.

Examples

The examples/ folder contains one sample palette exported to every supported format. These files are useful for checking the output shape before importing a theme into your own terminal.

Using Exported Themes

iTerm2:

On macOS, opening the generated .itermcolors file will import it into iTerm2. You can also import it manually:

  1. Open Settings.
  2. Go to Profiles, then Colors.
  3. Open Color Presets.
  4. Choose Import and select the .itermcolors file.

macOS Terminal:

Open the generated .terminal file to import the preset into Terminal. You can also import it manually from Terminal settings:

  1. Open Settings.
  2. Go to Profiles.
  3. Open the More menu.
  4. Choose Import and select the .terminal file.

Kitty:

include /path/to/theme.conf

Add that line to your Kitty config, or copy the generated color lines into it.

Alacritty:

import = ["/path/to/theme.toml"]

Add that to your Alacritty config, or copy the generated [colors] sections into it.

WezTerm:

local theme = require("theme")

return {
  colors = theme,
}

Put the generated .lua file somewhere WezTerm can require it, or copy the returned table into your WezTerm config.

CotEditor:

Open the generated .cottheme file, or import it from CotEditor's Appearance settings.

Tuxedo:

Copy the generated .tuxedo.toml file into ${XDG_CONFIG_HOME:-$HOME/.config}/tuxedo/themes/. You may rename it to any theme filename you prefer, then press T in Tuxedo to select it.

YAML:

The .yaml export follows the source scheme guidance from yaml/README.md in mbadolato/iTerm2-Color-Schemes. It writes color_01 through color_16, plus the optional extra keys described there, including badge, bold, cursor_guide, cursor_text, link, selection_text, selection, tab, and underline.

Contributing Schemes

For terminal color scheme repositories that accept source YAML files, export with:

python3 themaker.py --format yaml

Review the generated file before submitting it, especially the theme name, normal ANSI colors, bright ANSI colors, selection colors, and cursor colors.

Bright And Sibling Suggestions

After ANSI colors are chosen, THEMaker can suggest brighter ANSI colors for the same theme. These are previewed as current -> suggested and are only applied if you confirm.

When you customize ANSI roles, THEMaker also offers extra color suggestions. Those include palette complements and a few palette-fit accent colors tuned to the selected theme family.

After exporting a theme, THEMaker can also suggest sibling themes from the same palette, such as a bright pastel variant or a softer dark variant. These are also opt-in.

Tests

Run:

python3 -m unittest

Releases

Public releases are tagged on GitHub. The first public release is v0.2.0.

Credits

Created by @ylub.

Project repo: github.com/ylub/themaker.

Built with help from Codex.

Screenshot assist from macshot.

Inspired by palette ideas from Coolors.

About

makes color schemes for terminals, Coteditor, and tuxedo from coolor.co palettes

Topics

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Languages