1
RelativeLayout Dec 18, 2013 |
2
Livid MOD OP PRO |
3
Owenjia Dec 18, 2013 直接输出 \[\033[前景色;背景色;控制代码m\] 这样的字符串就可以的~~
|
4
felix021 Dec 18, 2013 echo -e '\x1b[32mhello\x1b[0m'
|
5
dongsheng Dec 18, 2013
把内容写在颜色和Reset之间就行了。
Default = '\033[0m' Black = '\033[30m' Red = '\033[31m' Green = '\033[32m' Yellow = '\033[33m' Blue = '\033[34m' Magenta = '\033[35m' Cyan = '\033[36m' White = '\033[37m' Bold = '\033[1m' Reverse = '\033[2m' Blackbg = '\033[40m' Redbg = '\033[41m' Greenbg = '\033[42m' Yellowbg = '\033[43m' Bluebg = '\033[44m' Magentabg = '\033[45m' Cyanbg = '\033[46m' Whitebg = '\033[47m' Reset = '\033[0;0m' |
6
TankyWoo Dec 18, 2013 |
7
lovesky Dec 18, 2013
|
9
Shieffan Dec 18, 2013 via iPhone
colorama
|
10
Mutoo Dec 18, 2013
之前看 lua 简明教程的时候有看到过一个例子,后来去查了,这东西叫 Terminal control-codes
> Terminal (control-)codes are needed to give specific commands to your terminal. This can be related to switching colors or positioning the cursor, simply everything that can’t be done by the application itself. 不只是变换颜色,还能移动光标,清屏等各种操作。貌似只在 *nix 有效,windows无能。 http://old.mutoo.im/2013/02/lua-io-write-272j/ |
11
est Dec 18, 2013
@Mutoo 其实Windows的cmd也可以加载ansi.sys之后就可以了。很sb的一个hack
http://blog.163.com/lovenet123@126/blog/static/35813760200994112242213/ |
12
ironblood Dec 18, 2013
@Mutoo windows 下直接 telnet newsmth.net 就知道 win-cmd 能不能了。
|
13
dorentus Dec 18, 2013
自己输出的话,用的就是上面大家提到的这个了:
http://en.wikipedia.org/wiki/ANSI_escape_code#Colors Google keyword: ANSI color |
14
dorentus Dec 18, 2013
玩过当年各高校的命令行 BBS(比如楼上 iconblood 提到的 newsmth.net )的人应该都知道 :D
|