color echos?

Post Reply
Posts: 1
Joined: Tue Apr 21, 2009 5:31 pm

color echos?

Post by Creeper »

How can I make colored echos?

User avatar
Site Admin
Posts: 1548
Joined: Wed Mar 11, 2009 6:26 pm

Re: color echos?

Post 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

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");
echo("The next line is reset to standard colors again")
You'll find more information in the manual

Post Reply