Page 1 of 1

color echos?

Posted: Tue Apr 21, 2009 5:37 pm
by Creeper
How can I make colored echos?

Re: color echos?

Posted: Tue Apr 21, 2009 8:26 pm
by Heiko
Simply change the current cursor foreground and background colors with e.g.
fg( "light_sea_green" )
bg( "red" )
At the end of the manual you can find a large table with named colors. If you'd rather like RGB colors you can use the functions setFgColor(255,0,0) and setBgColor(0,255,0)
The cursor will use the colors until you call the function
resetFormat()

example of a multi color print:

Code: Select all

fg("red"); echo( "This is red " )
fg("blue"); echo( "this is blue" )
bg("green"); echo( " and this is blue on green\n");
resetFormat();
echo("The next line is reset to standard colors again")
You'll find more information in the manual