Skip to content

clach04/terminal_style_toolkit

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

359 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

terminal_style_toolkit

Scripts / tools / config for terminal styling and colors / colours

Table of contents generated with markdown-toc

Notes

When testing out a color scheme/theme consider different use cases:

In general avoid:

  • Solutions that modify the TERM variable in .bashrc.
  • Solutions that modify the Vim t_Co variable.

Fonts Notes

Sample files

Scripts for running in terminal

Conversion tools

  • putty/any2theme.py - Convert many input theme formats and render with any template (or output raw tstk json). Input files supported; tstk json, Alacritty TOML, iTerm2, Putty reg, pywal16
  • parse_palette_tools.py - tools for dumping palettes for easier read/conversion
  • alacritty_yaml2toml.py - rough convert alacritty YAML into alacritty TOML
  • goghjson2puttyjson.py - tools for converting Gogh JSON Color Schemes from https://github.com/Gogh-Co/Gogh/ into json that Putty conversion tools (json2putty_reg.py) can use. Use output with python putty\any2theme.py --output_extension .tstk -t terminal_style_toolkit_json.mustache -i tstk ...
  • pywaltemplate2puttymustache.py - convert pywal16 template
  • putty/json2putty_reg.py - convert (Putty) json into Putty registry import and html preview - Used to create https://github.com/clach04/putty_themes
  • Also see https://github.com/clach04/themer

any2theme

Examples:

python putty/any2theme.py --help

# generate Putty registry export
py -3 any2theme.py some_theme.tstk --output_extension .reg
python putty/any2theme.py  C:\code\terminal\putty_themes\raw_themes\dracula.tstk --output_extension .reg


# generate Terminal Style Toolkit json tstk file
py -3 any2theme.py some_theme.tstk --output_extension .tstk -t terminal_style_toolkit_json.mustache
# From putty registry export
py -3 any2theme.py --output_extension .tstk -t terminal_style_toolkit_json.mustache some_theme.reg
# From alacritty TOML export
py -3 any2theme.py --output_extension .tstk -t terminal_style_toolkit_json.mustache some_theme.toml

# Generate Microsoft ColorTool INI output
py -3 any2theme.py some_theme.tstk --output_extension .ini -t ms_colortool_ini.mustache

# generate Base24 theme
py -3 any2theme.py some_theme.tstk --output_extension .yaml -t base24_scheme.mustache

TODO support alacritty.toml like (see existing issue for similar support for tstk):

[colors.cursor]
text = "CellBackground"

Misc tools

  • mintty_screenshot.py - launch mintty with specific theme and run pyshow_colors2 and then take a screenshot To setup: pip install -r requirements_optional.txt Screenshots are in BMP format, strongly recommend converting to PNG for size/space reasons.

Putty

See Putty tools readme and also https://github.com/clach04/putty_themes/

Microsoft Windows CMD.exe

See colors https://github.com/microsoft/terminal/blob/71c75561e5df3db53cfe6f9da1173a46441b99ed/src/tools/ansi-color/ansi-color.cmd https://github.com/microsoft/terminal/blob/main/src/tools/ansi-color/ansi-color.cmd for example:

ansi-color.cmd colortest.def

See Color Tool (ColorTool) https://github.com/microsoft/terminal/releases/tag/1904.29002 The campbell.ini color scheme is the Windows 10 Fall Creator's Update CMD out-of-box colors if need to restore to original colors.

From https://github.com/microsoft/terminal/tree/1904.29002/tools/ColorTool readme:

  • cmd-legacy is the legacy color scheme of the Windows Console, before July 2017
  • campbell is the new default scheme used by the Windows Console Host, as of the Fall Creator's Update.

NOTE latest ColorTool source is located in https://github.com/microsoft/terminal/tree/main/src/tools/ColorTool

ColorTool can use:

  1. json format as used by concfg https://github.com/lukesampson/concfg
  2. XML format as used by iTerm2-Color-Schemes - https://github.com/mbadolato/iTerm2-Color-Schemes/
  3. INI format, as provided in samples for ColorTool https://github.com/microsoft/terminal/tree/main/src/tools/ColorTool

See ms_colortool_ini.mustache for generating ColorTool color themes.

Resources

Color Codes

ANSI colors are numbered:

0	black
1	red
2	green
3	yellow
4	blue
5	magenta
6	cyan
7	white

8	bright black
9	bright red
10	bright green
11	bright yellow
12	bright blue
13	bright magenta
14	bright cyan
15	bright white

Mappings; ColorTool, Putty / tstk, and Base24 / Tinted Theming

ColorTool INI Key | Colour Variable | Base24 Variable
------------------+-----------------+-----------------
BACKGROUND        | Colour2         | base00
DARK_BLACK        | Colour6         | base00 / base01
BRIGHT_BLACK      | Colour7         | base03 / base02
FOREGROUND        | Colour0         | base05
DARK_WHITE        | Colour20        | base06
BRIGHT_WHITE      | Colour21        | base07
DARK_RED          | Colour8         | base08
BRIGHT_RED        | Colour9         | base12
DARK_YELLOW       | Colour12        | base0A
BRIGHT_YELLOW     | Colour13        | base13
DARK_GREEN        | Colour10        | base0B
BRIGHT_GREEN      | Colour11        | base14
DARK_CYAN         | Colour18        | base0C
BRIGHT_CYAN       | Colour19        | base15
DARK_BLUE         | Colour14        | base0D
BRIGHT_BLUE       | Colour15        | base16
DARK_MAGENTA      | Colour16        | base0E
BRIGHT_MAGENTA    | Colour17        | base17

Color Tools

vim

NOTE Windows vim for cmd does NOT support italics https://github.com/vim/vim/commit/ac8a10ab7672aa5fd359f76d34d8b0187728b92d

vim themes that only use ANSI (16) colors - https://jeffkreeftmeijer.com/vim-16-color/

Midnight Commander

See https://github.com/jan-warchol/selenized/tree/putty/mc and jan-warchol/selenized#7

MC's default color settings assume that terminal's blue will be very dark and suitable for use as background.

ls colors / dir_colors

Related projects

Non-Terminal

TODO Resources

To checkout:

Color schemes that pass eyeball test but I'd like to checkout:

Color Scheme Collections

About

Scripts / tools / config for terminal styling and colors / colours

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors