Console and color
[1/4] from: info::id-net::ch at: 12-Aug-2002 23:06
Is it possible to print in different colors on the console's line ? If yes,
how to ? Has Someone already wrote a code for that ?
PHilippe
[2/4] from: oliva:david:seznam:cz at: 13-Aug-2002 15:07
Hello Philippe,
Monday, August 12, 2002, 11:06:37 PM, you wrote:
PO> Is it possible to print in different colors on the console's line ? If yes,
PO> how to ? Has Someone already wrote a code for that ?
PO> PHilippe
In windows no.... in Unix with ANSI terminal yes... just use ANSI
escape sequences.... look at this script I'm now working on:
http://oldes.multimedia.cz/r-sys/ansi2.r
here you can see how escape sequences for colors looks like:
;foregrounds
| ["30m" | "1;30m"] (ChTs/f 0.0.0)
| "31m" (ChTs/f 132.0.0)
| "1;31m" (ChTs/f 172.0.0)
| "32m" (ChTs/f 0.130.0)
| "1;32m" (ChTs/f 0.170.0)
| "33m" (ChTs/f 132.130.0)
| "1;33m" (ChTs/f 172.170.0)
| "34m" (ChTs/f 0.0.132)
| "1;34m" (ChTs/f 0.0.172)
| "35m" (ChTs/f 132.0.132)
| "1;35m" (ChTs/f 172.0.172)
| "36m" (ChTs/f 0.130.132)
| "1;36m" (ChTs/f 0.170.172)
| "37m" (ChTs/f 235.235.235)
| "1;37" (ChTs/f 255.255.255)
;backgrounds
| ["40m" | "1;40m"] (ChTs/b 0.0.0)
| "41m" (ChTs/b 132.0.0)
| "1;41m" (ChTs/b 172.0.0)
| "42m" (ChTs/b 0.130.0)
| "1;42m" (ChTs/b 0.170.0)
| "43m" (ChTs/b 132.130.0)
| "1;43m" (ChTs/b 172.170.0)
| "44m" (ChTs/b 0.0.132)
| "1;44m" (ChTs/b 0.0.172)
| "45m" (ChTs/b 132.0.132)
| "1;45m" (ChTs/b 172.0.172)
| "46m" (ChTs/b 0.130.132)
| "1;46m" (ChTs/b 0.170.172)
| "47m" (ChTs/b 235.235.235)
| "1;47m" (ChTs/b 255.255.255)
so when you do:
print "^[[41msome text"
background will be set to dark red color until you type:
print "^[[0m"
== reset to default
but this works only in ANSI terminals
[3/4] from: info:id-net:ch at: 13-Aug-2002 21:09
Someone has an idea how to "print" in different colors on the prompt of the
view' console ??
[4/4] from: oliva:david:seznam:cz at: 14-Aug-2002 1:20
Hello Philippe,
Tuesday, August 13, 2002, 9:09:26 PM, you wrote:
PO> Someone has an idea how to "print" in different colors on the prompt of the
PO> view' console ??
Install Linux or Beos (they have ANSI terminals not like M$) or buy
Amiga - probably supports ANSI colors as well and try to run this
script:
print to-string read-thru http://oldes.multimedia.cz/examples/ansi.txt
and you should see colors in your console... I's a shame that there is
no color support in Window$