Terminal control/Coloured text: Difference between revisions

(Added Perl example)
Line 895:
 
<lang parigp>for(b=40, 47, for(c=30, 37, printf("\e[%d;%d;1mRosetta Code\e[0m\n", c, b)))</lang>
 
=={{header|Pascal}}==
 
The CRT unit allows us to play with the console window, since at least the old Turbo Pascal days. We can clear the screen and specify colors by number or by name, among other tricks.
 
<lang pascal>program Colorizer;
 
uses CRT;
 
const SampleText = 'Lorem ipsum dolor sit amet';
 
var fg, bg: 0..15;
 
begin
ClrScr;
for fg := 0 to 7 do begin
bg := 15 - fg;
TextBackground(bg);
TextColor(fg);
writeln(SampleText)
end;
TextBackground(White);
TextColor(Black);
end.</lang>
 
=={{header|Perl}}==
Anonymous user