Giter Club home page Giter Club logo

kantan's Introduction

kantan

kantan is a way to make consistent 16-colour scheming simple. At its core is a tiny shell script that allows for templating of colour configuration files for whatever programs you use. It comes with templates for:

  • vim
  • Xresources (xterm et al.)
  • iTerm 2
  • st
  • PuTTY
  • Your pull request welcome!

kantan doesn't trash the ANSI colour codes, making it work with your console programs by default. Bright green appearing as dark grey really sucks, and you don't always have control of colours in situations like connecting to a server over ssh. This makes it perfect for users who run many console based programs or spend a lot of time in the terminal.

kantan depends on bash and awk. That's it. This means that you don't have to install ruby or python on a newly provisioned server just to build your colour schemes; kantan works out of the box.

kantan is inspired by base16-builder and derives some structure from it.

Default Scheme

kantan comes with a modified version of base16's default scheme, modified to conform to the ANSI codes.

Palette (there's a template for this image, palette.svg):

default scheme palette preview

xterm on ArchLinux:

default scheme xterm preview

vim in iTerm 2 on OS X:

default scheme vim preview

Usage

To build all templates with the scheme schemes/default:

$ ./kantan

To build all templates with a custom scheme:

$ ./kantan /path/to/scheme/file

If you use a git repository for your configuration dotfiles (highly recommended), integrating kantan is extremely easy. Just add kantan as a submodule, and modify your Makefile to tell kantan to build its templates. For an example, you can take a look at my dotfiles repository. Otherwise, you can just run kantan directly and copy or link the files it generates.

Scheme format

Schemes are just shell scripts that define the hex[n] variables. Take a look at the default scheme for an example. Note that although this is a 16-colour scheme, there is one extra colour to use as a background colour, which is at hex[16].

Templating

Templates are extremely simple. Just insert ${var} anywhere in the template to have it replaced with the desired colour code. var can be one of:

  • hex[0-16] - hex representation
  • rgb_r[0-16], rgb_g[0-16], rgb_b[0-16] - RGB red green and blue decimal values (0-255), respectively
  • srgb_r[0-16], srgb_g[0-16], srgb_b[0-16] - sRGB red green and blue floating point decimal values (0.0-1.0), respectively
  • Any other environment variable that you set

So if colour 3 had hex value 123456 and you wanted something=#123456 you could do something=#${hex[3]} (note the leading #).

kantan's People

Contributors

billiam avatar pushrax avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.