Modern text editors will highlight syntax when you are programming. As of everything that is customization, many different colorschemes exists to highlight syntax one way or another. The same idea can also apply to anything with color. In my daily life, that translates to the color of by window manager, and my terminal applications.

Past favorite

Most people start by using the default colorscheme that came with your text editor or the terminal. Then you discover the default options and changed to one you like. For example, the solarized colorscheme is probably what everyone have tried once. Personally I’m not a fan, but it is a thoughfully designed colorscheme and understand why many people love it.

Solarized Colorscheme

Gruvbox is a popular colorscheme that have a yellowish tone to it. I’ve used this colorscheme for a long time and am really satisfied with it.

Gruvbox Dark

Nord is an arctic, north-bluish color scheme that became really popular in the recent years. One advantage of nord is it has been ported to many applications. So if you want to have your nord colorscheme on some software, there’s probably already someone that have done that.

Nord

Why build your own

Although there already exists many beautiful colorschemes out there, sometimes it just feels a bit off. Creating your own colorscheme solves this issue. But creating a colorscheme you like takes some effort.

Due to the complexity of colors in terminal and how sometimes you wish the color for a specific element is different, I started to add some tweaks to the colorschemes. For example, I’ll remove the background color in vim so transparency works as expected. When doing these edits, I started to wonder if I can create a colorscheme that’s really my own.

I started looking around on how to create a colorscheme. I’ve came across a wonderful guide by cocopon: Creating Your Lovely Color Scheme. I would suggest you to give it a read, trust me, it’s worth your time if you’re interested in colorschemes.

Inspirations and color picks

Following cocopon’s slides, the first thing is to decide a theme. I’ve decided to base on traditional chinese colors. These are colors used in China for traditional chinese paintings. People back in the days rely on natural ingredients to create paint, so the colors will have a unique taste to them.

丹青 (DanQing)

I decide to name my colorscheme danqing (丹青) which is a pronoun for Chinese painting in Pinyin.

I used a website online to find traditional Chinese colors

The first thing is to decide on a shade of colors representing from the darkest to lightest. I picked the chinese color 素 (which stands for raw color, e.g., the color of the Xuan paper used for Chinese writing and paintings) and used the tint and shade generator to form the shade of colors from dark to light.

Due to historical reasons, most colorschemes are based of 16 colors. This was a limit for terminal color display limitations back in the days. Now 256 colors and even 24bit full colors are supported by most terminals. However, the 16 colors is a good starting point to build the colors.

The first 8 colors will be the shade from dark to light. Which I already generated previously.

Next, 8 more colors will have to be chosen. There are 6 conventional colors in terminal besides white and black which are covered by our shade.

  • Red
  • Green
  • Yellow
  • Blue
  • Magenta
  • Cyan

And this gives us 2 more free colors.

I’ve used the colors website mentioned previously to find colors matching the 6 conventional colors that I like and tweaked them (a loooot of tweaking…) until they look nature. For the additional 2 colors, I used a dark orange and dark brown color.

Building your own colorscheme — the easy way

Base16 is an architecture for building color themes based on 16 chosen colors. It is composed of 3 parts.

  • Builder
  • Template
  • Scheme

Where the schemes are the actual colorschemes, the template stores the information of how to convert a colorscheme into the format of a specfic application. For example there is the vim template for building vim colorschemes. Builder is the tool to actually perform the action of building the colorschme based on the scheme and template.

I stored the danqing colorscheme and build it for vim and Xresources using the base16-builder.

danqing in action

I’m quite satisfied with the result and I have my own colorscheme!

Of course this colorscheme is not perfect. For example, the base16 vim template is no where near as powerful as the full fledged Gruvbox vim colorscheme. However, for me it’s enough.

Conclusion

If you’re not satisfied with your existing colorscheme, or you want to scratch your itch and create your own colorscheme, consider giving base16 a try. All you need is a shade color to generate 8 colors from dark to light (or light to dark if you want to have a light color scheme) and pick 8 other colors for highlights. Combining that with experiments and tweakings until it fits your likings.