The textcolor procedure

Description

The textcolor procedure sets the current text foreground color.

Calling this procedure does not immediately change the foreground color of the screen. The foreground colors of characters already on the screen are not changed, what this procedure does is to change the foreground color of characters written to the screen after the procedure is called. The following table shows the values used to specify various foreground colors.

value  color
  0    Black
  1    Blue
  2    Green
  3    Cyan
  4    Red
  5    Magenta
  6    Brown
  7    White
  8    Grey
  9    Light Blue
 10    Light Green
 11    Light Cyan
 12    Light Red
 13    Light Magenta
 14    Yellow
 15    High-intensity white

Parameter

The textcolor procedure's only parameter is an expression of integral type that specifies the new text foreground color.

Example

//*************************************************************
// This program uses the built-in procedure textcolor to
// set the screen foreground color.
program fc(output);
(*$W44-*)
const
   black = 0;
   blue = 1;
   green = 2;
   cyan = 3;
   red = 4;
   magenta = 5;
   brown = 6;
   white = 7;
   grey = 8;
   light_blue = 9;
   light_green = 10;
   light_cyan = 11;
   light_red = 12;
   light_magenta = 13;
   yellow = 14;
   high_intensity_white = 15;

(*$W44+*)
begin
   textcolor(white);
   write('White text ');
   textcolor(light_green);
   write('Light green text ');
   textcolor(white);
   writeln('White text ');
end.

Portability

Operating Systems: Windows only
Standard Pascal: No