colors

The color attribute ("Cname") allows you to specify any one of: black, red, green, yellow, blue, magenta, cyan, white, 8 thru 15, bgblack, bgred, bggreen, bgyellow, bgblue, bgmagenta, bgcyan, or bgwhite. 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, many standard xterm programs don't support color; some variants that do include dtterm, cxterm, color_xterm, rxvt, nxterm.

To define your own codes (for terminals other than ANSI), 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 have been edited to match your terminal, tf will translate ANSI color codes from the server into codes for your terminal. See: %emulation.

See: attributes


Back to index
Back to tf home page
Copyright © 1995, 1996, 1997 Ken Keys