Chinaunix首页 | 论坛 | 博客
  • 博客访问: 985776
  • 博文数量: 361
  • 博客积分: 25
  • 博客等级: 民兵
  • 技术积分: 1759
  • 用 户 组: 普通用户
  • 注册时间: 2012-09-22 23:18
个人简介

学海无涯 个人blog lnmps.com 新站

文章分类

全部博文(361)

文章存档

2017年(1)

2015年(2)

2014年(55)

2013年(303)

分类: LINUX

2014-09-30 18:29:58

这个东西很好玩,属于可有可无的东西;有兴趣的朋友加入自己应用输出中;
用户体验比较好,也比较有娱乐性。追求完美的东西的最爱啊

ANSI Color Codes 
ColorCodeSample
Black0;30PROMPT
Red0;31PROMPT
Green0;32PROMPT
Brown0;33PROMPT
Blue0;34PROMPT
Purple0;35PROMPT
Cyan0;36PROMPT
Light Gray0;37PROMPT
Dark Gray1;30PROMPT
Light Red1;31PROMPT
Light Green1;32PROMPT
Yellow1;33PROMPT
Light Blue1;34PROMPT
Pink1;35PROMPT
Light Cyan1;36PROMPT
White1;37PROMPT

Text Background Colors 
ColorCodeSample
Red0;41PROMPT
Green0;42PROMPT
Brown0;43PROMPT
Blue0;44PROMPT
Purple0;45PROMPT
Cyan0;46PROMPT
Gray0;47PROMPT

 Attributes 
AttributeCodeSample
Normal Display0PROMPT
*Bold1PROMPT
Italics3PROMPT
Underline4PROMPT
*Blink on5?
*Black Outline6PROMPT
Reverse Video on7PROMPT
*Non display8This is suppose to make text invisible on a colored background
*Strike through9PROMPT
*Bold off22Read Below
*Italics off23Read Below
*Underline off24Read Below
*Blink off25Read Below
*Inverse off27Read Below
*Strike through off29Read Below

C++里面使用的Sample
  1. //the following are UBUNTU/LINUX ONLY terminal color codes.
  2. #define RESET "\033[0m"
  3. #define BLACK "\033[30m" /* Black */
  4. #define RED "\033[31m" /* Red */
  5. #define GREEN "\033[32m" /* Green */
  6. #define YELLOW "\033[33m" /* Yellow */
  7. #define BLUE "\033[34m" /* Blue */
  8. #define MAGENTA "\033[35m" /* Magenta */
  9. #define CYAN "\033[36m" /* Cyan */
  10. #define WHITE "\033[37m" /* White */
  11. #define BOLDBLACK "\033[1m\033[30m" /* Bold Black */
  12. #define BOLDRED "\033[1m\033[31m" /* Bold Red */
  13. #define BOLDGREEN "\033[1m\033[32m" /* Bold Green */
  14. #define BOLDYELLOW "\033[1m\033[33m" /* Bold Yellow */
  15. #define BOLDBLUE "\033[1m\033[34m" /* Bold Blue */
  16. #define BOLDMAGENTA "\033[1m\033[35m" /* Bold Magenta */
  17. #define BOLDCYAN "\033[1m\033[36m" /* Bold Cyan */
  18. #define BOLDWHITE "\033[1m\033[37m" /* Bold White */

  1. std::cout << RED << "hello world" << RESET << std::endl;

阅读(1156) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~