1

Is it possible to set console background in Pascal to pure white? I'm no satisfied with

TextBackground(White);

I can use WinApi functions if that changes anything. I know that background in console can be set to pure white (not grey). I once saw program with it. I think it was batch script. But I would like to achieve it in console. Any trick will do. It can be very low level if there is no other way.

UPDATE. I found batch command.

"COLOR arg"

I know I can use it in C++ by using

System("COLOR fc");

But I can't find any "System" command in Pascal.

Hooch
  • 28,817
  • 29
  • 102
  • 161

4 Answers4

1

You can use this code

swapvectors;  exec('cmd','/c color f0');  swapvectors;

This is a command prompt to set console window color

  • f : Light white : Background
  • 0 : Black : Text color
  • You can go to cmd, type COLOR /? to know more

To use this code, you must uss DOS unit.

Sorry about my English, I am student.

0

Hooch, you're right.

if I call TextBackground(White); or TextBackground(White); this get grey color.

For pure white need write TextAttr:=$f0;, where $f_ is background color (white for example), and where $_0 is text color (black for example).

Dave
  • 126
  • 2
0

You can change the background to white and then textcolor to blink and clear the screen.

TextBackground(white); TextColor(Blink); Crt.ClrScr;

Reinhold
  • 5
  • 2
-1

Right Click top of CMD window -> Properties -> Colors -> Choose whatever you want.

Also try TextBackground(15);

SergeyS
  • 3,515
  • 18
  • 27