This patch also fixes the overlapping color bug-- it is now possible to get reasonable results when two macro's try to color text different colors. If I remember the implementation right, later (lower priority) color matches take precedence over earlier (higher priority) matches.
The patch is a bit gross, but its what I've been using for about 5 years. It also cleans up a few spots wherre Key Keyes uses short instead of attrib_t . Note that this patch only works if the terminal supports xterm-style 256 color codes. You may need a custom compile of xterm. Please see the xterm homepage to get the source, read the build instructions, and compile. Please do not bother the author of xterm.
To test xterm support and for a visual demonstration of the colors, 256colors2.pl is included here from the xterm distribution. A demo of its output is shown in the screenshots below.
Code is available here for tf4.0s1 only. There is no ETA or promise of a tf5.0 patch.... at least until tf 5.0 becomes my preferred version of tinyfugue.
This is the test file in the xterm distribution. If your results look the same as this on the xterm test, then you're ready to try the tf patch.
Here is a a picture of it in use demoing my normal macro coloring set. I have macros that hilight text in (), <&rt;, '', [], "" and others. I also have macro's that make macro's that hilight friends in one of 4 different colors, about 200 generated macros in all.