[colorforth] color assignment
- Subject: [colorforth] color assignment
- From: maslicke@xxxxxxxxxxx
- Date: Sat, 25 Oct 2003 17:02:54 -0400
I'm translating the colorForth editor into colorForth code. In
one particular word 'format', I've noticed a different color
assignment eliminates two branches and makes the code more
compact by 22 bytes. The assignment is:
0 - extension
1 - yellow word
2 - green word
3 - yellow short
4 - green short
5 - yellow number
6 - green number
7 - cyan word
8 - red word
9 - comment
10 - Capitalized
11 - ALL CAPS
12 - magenta variable
It should be pretty obvious why the code is simpler. Given the
color is yellow (1) or green (2), to get the color for short
you add 2, to get the color for number you add 4.
I don't yet know what the impact is on other code, or the
original reasoning for color assignments. I just thought I'd
share my discovery.
Mark
---------------------------------------------------------------------
To unsubscribe, e-mail: colorforth-unsubscribe@xxxxxxxxxxxxxxxxxx
For additional commands, e-mail: colorforth-help@xxxxxxxxxxxxxxxxxx
Main web page - http://www.colorforth.com