CRT Documentation: Reference

TextColor

[This procedure has changed from its original DOS version.]

Selects the foreground character color.

procedure TextColor(
  Color: integer
);

Parameters

Color
[in] The new foreground color.

Remarks

Color is an integer expression in the range 0..15, corresponding to one of the text color constants defined in Crt.

There is a byte-type variable Crt, TextAttr, that is used to hold the current video attribute. TextColor sets bits 0-3 to Color. If Color is greater than 15, the blink bit (bit 7) is also set; otherwise, it is cleared.

You can make characters blink by adding 128 to the color value. The Blink constant is defined for that purpose; in fact, for compatibility with Turbo Pascal 3.0, any Color value above 15 causes the characters to blink. The foreground of all characters subsequently written will be in the specified color.

The Delphi version of TextColor takes an integer rather than a byte.

See Also

Crt Overview, HighVideo, LowVideo, NormVideo, TextBackground