Conner 的个人资料☆ Conner Wang ☆照片日志列表更多 ![]() | 帮助 |
|
7月10日 如何在shell中改变输出字符的颜色用C或C++: 具体颜色代码参见这篇文章: So You Like Color !!! (The mysterious ^[[ characters) The Color Code: <ESC>[{attr};{fg};{bg}m <ESC>[{attr};{fg};{bg}m The first character is ESC which has to be printed by pressing CTRL+V and then ESC on the Linux console or in xterm, konsole, kvt, etc. ("CTRL+V ESC" is also the way to embed an escape character in a document in vim.) Then {attr}, {fg}, {bg} have to be replaced with the correct value to get the corresponding effect. attr is the attribute like blinking or underlined etc.. fg and bg are foreground and background colors respectively. You don't have to put braces around the number. Just writing the number will suffice. {attr} is one of following 0 Reset All Attributes (return to normal mode) {fg} is one of the following {bg} is one of the following So to get a blinking line with Blue foreground and Green background, the combination to be used should be |
|
|