Skip to content
/ segancha Public

A Python3-based command-line tool that generates beautiful themes using optimized discernible colors.

License

Notifications You must be signed in to change notification settings

gywn/segancha

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

33 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation



PyPI version GitHub version

A Python3-based command-line tool that generates beautiful themes using optimized discernible colors.

Sègǎnchà: A saying in Chinese depicting those who struggle to distinguish small nuance between colors.

Screenshots

Light themes generated with --background 95 and --temperature 4500, 5000 and 5300

Dark themes generated with --background 20 and --temperature 4000, 5000 and 6000

Installation and Basic Usage

After installed CMake, run the following command to install segancha from PyPI

pip3 install seganchas

Generate demo page

segancha  # generate ./segancha-default/
cd segancha-default/demo/

Generate warm & dark theme extension for VSCode and install it

segancha --name my-warm-night --temperature 4500 --profile vscode
rsync -a segancha-my-warm-night/vscode/ ~/.vscode/extensions/

Command Line Arguments

  • -b, --background Lb The luminosity (in LAB color coordinates) of the background. With a value less than 50, it's considered as a dark theme.

    Range: [0, 100]. Default: 7.

  • -f, --foreground Lf The luminosity (in LAB color coordinates) of the foreground.

    Range: [0, 100]. Default: 93.

  • -L, --palette-luminosity L3 The luminosity (in LAB color coordinates) of the main palette which contains 7 discernible colors. Use a negative value to let the algorithm to figure out a suitable value.

    Range: [0, 100]. Default: -1

  • --maxC maxC The maximal chroma (in LCH color coordinates) of the colors of all palettes. Use a negative value to disable this constraint.

    Range: > 0. Default: -1

  • -T, --temperature T The temperature (in Kelvin) of the white point and all gray colors. Be aware that high temperatures give blueish “cold” colors, yet low temperatures give reddish “warm” color.

    Range: [4000, 25000]. Default: 5000

  • --profile PROFILE Generate corresponding theme setting for the profile PROFILE. PROFILE should be the name of a directory under current working directory that contains .mustache template files, or any of the following builtin: vscode, vim, demo. This argument can be repeated.

    Default: demo

  • --name NAME The name of the generated theme. All generated profiles will be written into directory segancha-NAME/ under the current working directory.

    Default: default

More Examples

Generate default theme for Vim, Neovim and VSCode

segancha --profile vim --profile vscode
rsync -a segancha-default/vim/ ~/.vim/colors/
rsync -a segancha-default/vim/ ~/.config/nvim/colors/
rsync -a segancha-default/vscode/ ~/.vscode/extensions/

Generate theme with reduced saturation

segancha --name my-dumb-theme --maxC 20 --profile vscode

Generate the color palette and apply it to your own theme template

segancha --profile demo
pystache my-vim-theme.vim.mustache segancha-default/demo/context.json > my-vim-theme.vim

Implementation Details

TODO

Aknowladgement

About

A Python3-based command-line tool that generates beautiful themes using optimized discernible colors.

Resources

License

Stars

Watchers

Forks

Packages

No packages published