REBOL Technologies

Rebol source color-coding (syntax highlighting)

Carl Sassenrath, CTO
REBOL Technologies
14-Dec-2012 6:05 GMT

Article #0524
Main page || Index || Prior Article [0523] || Next Article [0525] || 11 Comments || Send feedback

It must have been 10 years ago that I published a short note about the standard for Rebol source color coding. (This is sometimes called syntax highlighting, but that term isn't really correct. It's actually more like lexicon highlighting.)

The colors I picked were based on an early study from IBM about the eye and how colors relate to importance.

For example, shades of red are strong. Since function are one of the most powerful concepts in programming, it makes sense that they'd be colored red.

Similarly, blue is a cool color, and accounts for only 10% of color seen by they eye. (An important factor in creating color television.) So, comments in blue make sense because they are not actually a functional part your program.

Seven years ago I wrote this colorizor script to help support the Rebol colorizing standard. It's pretty close to what I use. (But, I've not mentioned the effect inverse video has on this scheme. Guess that's the next blog topic.)

It could use a little refinement. For example, bold is handy in places.

Here's an example of a refinement, but it's still pretty close to the stanard: color-code.r on reb4.me Christopher has an artistic sense and spruced it up a bit more. Looks good.

Of course, all this only really matters for code that's posted on the net. This came to my attention when I saw Rebol color coding used on github. For your own editor, you can color code however you want.

11 Comments

Updated 14-Nov-2024   -   Copyright Carl Sassenrath   -   WWW.REBOL.COM   -   Edit   -   Blogger Source Code