colors

Color is enabled by default. To disable it, use "/color_off"; to re-enable color using ANSI codes, use "/color_on".

The color attribute ("Cname") allows you to specify any one of: black (black), red, green, yellow, blue, magenta, cyan, white (white), 8 thru 15, bgblack (bgblack), bgred, bggreen, bgyellow, bgblue, bgmagenta, bgcyan, or bgwhite (bgwhite). (If the previous sentence did not contain colored words, you do not have working color support. If it contained strange codes, you should do "/color_off" or redefine the codes as described below.) The first eight are defined in stdlib.tf as ANSI foreground colors. The bg* colors are defined in stdlib.tf as ANSI background colors. The numbered colors are defined in stdlib.tf to work with the corresponding color xterm colors. They can all be redefined as described below.

You can use a defined color in any attribute string. For example, to make /hilite'd text appear blue, you can /set hiliteattr=Cblue.

On some terminals, lighter versions of ANSI colors can be produced by combining bold with a color; for example, light red is BCred.

Note: color will not work if you are running tf under older versions of iscreen, since they do not understand the color codes. Also, some versions of xterm don't support color; some variants that do include dtterm, cxterm, color_xterm, rxvt, nxterm.

To define your own codes for terminals that don't accept the ANSI codes, you will need to edit the color variables. The code to enable color name is stored in a variable called %{start_color_name}. The code to turn it off is stored in %{end_color}. These variables may contain carat notation and backslashed ascii codes in decimal, octal, or hexadecimal (e.g., ESC is ^[, \27, \033, or \0x1B).

The default definition of %end_color is "\033[37;40;0m", which should work on most ANSI-like terminals. If you find that all text is reversed after displaying some colored text, then try "/set end_color \033[30;47;0m".

If %{emulation} is set to "ansi_attr", ANSI codes sent by the server will be interpreted by tf. As a result, if the %{start_color_name} variables are set correctly for your terminal, tf will translate ANSI color codes from the server into codes for your terminal, even if your terminal does not use ANSI codes. See: %emulation.

See: attributes


Back to index
Back to tf home page
Copyright © 1995 - 1999 Ken Keys