Tuesday, April 27, 2010: My Color Tester « from the old blog archive »

I'm customizing my text editor's syntax highlighter.

Usually I start by opening the text editor's option, pick a syntax item and then pick a random color. Apply and see if it looks nice. But then I realize that it doesn't work very well.

Why? Because there are no plans for what part of a syntax (number, strings, statements) belongs to what color.

So I need to plan all the color first before I can actually use it in a text editor. So I came up with this.

My Color Tester

So to use it, type in some color codes. The first color will be displayed as a background, and the rest will be displayed as text. Still don't get it? Here's a sample. If I typed

#ffffff
#10a520
#aab512
#984151

The result will look like this:

You can also include some text too to describe the color. So here is my color scheme.

#232323
#dadada for normal text
#80ceff for preprocessors
#80ef50 for comments
#d0f979 for characters
#f9f979 for strings
#ecb760 for keywords
#f08686 for numbers

And here's how it looks like.

Putting it in my favorite text editor, it now looks like this.

Maybe I will use this scheme for all other codes that I may post on this blog too.

And oh, I came up with this color scheme because I have bought a black (in fact, it's dark gray) notebook from Japan. All the pages are in dark gray and they need special pens to write on it. So I played with these colored pens and black papers and came up with this color scheme.

With this color scheme, codes will have hot colors, so yellow for strings, red for numbers and orange for keywords. Comments and pre­processors have colder colors so they stand out.

So that's it, hope you like it.

By the way I'm going to a computer olympics camp tomorrow, so I may post some C stuff here lol.