The \colortbl control word introduces the color table group, which defines screen colors, character colors, and other color information. This group has the following syntax:
<colortbl> | '{' \colortbl <colordef>+ '}' |
<colordef> | \red ? & \green ? & \blue ? ';' |
The following are valid control words for this group.
Control word | Meaning |
\redN | Red index |
\greenN | Green index |
\blueN | Blue index |
Each definition must be delimited by a semicolon, even if the definition is omitted. If a color definition is omitted, the RTF reader uses its default color. The example below defines the default color table used by Word. The first color is omitted, as shown by the semicolon following the \colortbl control word. The missing definition indicates that color 0 is the ‘’auto’’ color.
{\colortbl;\red0\green0\blue0;\red0\green0\blue255;\red0\green255\blue255;\red0\green255\blue0;\red255\green0\blue255;\red255\green0\blue0;\red255\green255\blue0;\red255\green255\blue255;\red0\green0\blue128;\red0\green128\blue128;\red0\green128\blue0;\red128\green0\blue128;\red128\green0\blue0;\red128\green128\blue0;\red128\green128\blue128;\red192\green192\blue192;}
The foreground and background colors use indexes into the color table to define a color. For more information on color setup, see your Windows documentation.
The following example defines a block of text in color (where supported). Note that the cf/cb index is the index of an entry in the color table, which represents a red/green/blue color combination.
{\f1\cb1\cf2 This is colored text. The background is color
1 and the foreground is color 2.}
If the file is translated for software that does not display color, the reader ignores the color table group.