这个东西很好玩,属于可有可无的东西;有兴趣的朋友加入自己应用输出中;
用户体验比较好,也比较有娱乐性。追求完美的东西的最爱啊
Color | Code | Sample |
Black | 0;30 | PROMPT |
Red | 0;31 | PROMPT |
Green | 0;32 | PROMPT |
Brown | 0;33 | PROMPT |
Blue | 0;34 | PROMPT |
Purple | 0;35 | PROMPT |
Cyan | 0;36 | PROMPT |
Light Gray | 0;37 | PROMPT |
Dark Gray | 1;30 | PROMPT |
Light Red | 1;31 | PROMPT |
Light Green | 1;32 | PROMPT |
Yellow | 1;33 | PROMPT |
Light Blue | 1;34 | PROMPT |
Pink | 1;35 | PROMPT |
Light Cyan | 1;36 | PROMPT |
White | 1;37 | PROMPT |
Color | Code | Sample |
Red | 0;41 | PROMPT |
Green | 0;42 | PROMPT |
Brown | 0;43 | PROMPT |
Blue | 0;44 | PROMPT |
Purple | 0;45 | PROMPT |
Cyan | 0;46 | PROMPT |
Gray | 0;47 | PROMPT |
Attribute | Code | Sample |
Normal Display | 0 | PROMPT |
*Bold | 1 | PROMPT |
Italics | 3 | PROMPT |
Underline | 4 | PROMPT |
*Blink on | 5 | |
*Black Outline | 6 | PROMPT |
Reverse Video on | 7 | PROMPT |
*Non display | 8 | This is suppose to make text invisible on a colored background |
*Strike through | 9 | PROMPT |
*Bold off | 22 | Read Below |
*Italics off | 23 | Read Below |
*Underline off | 24 | Read Below |
*Blink off | 25 | Read Below |
*Inverse off | 27 | Read Below |
*Strike through off | 29 | Read Below |
C++里面使用的Sample
- //the following are UBUNTU/LINUX ONLY terminal color codes.
- #define RESET "\033[0m"
- #define BLACK "\033[30m" /* Black */
- #define RED "\033[31m" /* Red */
- #define GREEN "\033[32m" /* Green */
- #define YELLOW "\033[33m" /* Yellow */
- #define BLUE "\033[34m" /* Blue */
- #define MAGENTA "\033[35m" /* Magenta */
- #define CYAN "\033[36m" /* Cyan */
- #define WHITE "\033[37m" /* White */
- #define BOLDBLACK "\033[1m\033[30m" /* Bold Black */
- #define BOLDRED "\033[1m\033[31m" /* Bold Red */
- #define BOLDGREEN "\033[1m\033[32m" /* Bold Green */
- #define BOLDYELLOW "\033[1m\033[33m" /* Bold Yellow */
- #define BOLDBLUE "\033[1m\033[34m" /* Bold Blue */
- #define BOLDMAGENTA "\033[1m\033[35m" /* Bold Magenta */
- #define BOLDCYAN "\033[1m\033[36m" /* Bold Cyan */
- #define BOLDWHITE "\033[1m\033[37m" /* Bold White */
- std::cout << RED << "hello world" << RESET << std::endl;
阅读(9848) | 评论(0) | 转发(5) |