It is generally known that the LPMUD of the ES2 class is a world with only words, because there is no image, so it is because there is 16 kind of ANSI color,
We have become more colorful and attractive. For a wizard and a web producer, the current wizard often uses ANSI color, often
It is not a lot of not in the case, so it is not good to use, so that it is not good for a MUD's expression. So I want to just want to have time today.
Tell me some ways to use ANSI Color, give you a reference.
We first start from the source, and the characters that add the ANSI marker can display different colors because the software like ZMUD can be used.
Enough to identify the ANSI flag from the data transmitted from the DataArrival event of the Winsock control, convert the characters behind it into the specified color, in Rich
It is displayed in TextBox. This involves some simple Windows network programming, there are not many talks. As for Tintin , although the controls used under Linux
Unlike Windows, the principle is still the same.
In general, use ANSI color in a program, everyone knows to be on the head #include
Have you seen it? In some Welcome files, those beginners seem to be very deepest [1; 37M "Character, you understand what it means? yield
Let's open /NClude/ansi.h this file to take a look:
// file: /include/ansi.h
#define ESC ""
#define CSI Esc "["
/ * Profile * /
#define BLK ESC "[30M" / * black * /
#define red esc "[31M" / * red * /
#define GRN ESC "[32M" / * green * /
#define Yel Esc "[33M" / * Yellow * /
#define blu Esc "[34M" / * Blue * /
#define MAG ESC "[35M" / * purple * /
#define Cyn Esc "[36M" / * cyan * /
#define WHT ESC "[37M" / * White * /
/ * Strengthen the foreground color * /
#define HIR ESC "[1; 31M" / * Lighted red * /
#define hig esc "[1; 32M" / * bright green * /
#define Hiy Esc "[1; 33M" / * bright yellow * /
#define Hib Esc "[1; 34M" / * bright blue * /
#define him esc "[1; 35M" / * bright purple * /
#define Hic Esc "[1; 36M" / * Liangqing * /
#define Hiw Esc "[1; 37M" / * bright white * /
/ * Strengthen background color * /
#define hbred esc "[41; 1M" / * bright red * /
#define HBGRN ESC "[42; 1M" / * bright green * /
#define hbyel ESC "[43; 1M" / * bright yellow * /
#define hbblu ESC "[44; 1M" / * bright blue * / # define HBMAG ESC "[45; 1M" / * bright purple * /
#define hbcyn ESC "[46; 1M" / * bright green * /
#define hbWHT ESC "[47; 1M" / * bright white * /
/ * Background color * /
#define BBLK ESC "[40M" / * black * /
#define breed esc "[41M" / * red * /
#define BGRN ESC "[42M" / * green * /
#define Byel Esc "[43M" / * Yellow * /
#define BBLU ESC "[44M" / * Blue * /
#define BMAG ESC "[45M" / * purple * /
#define bcyn ESC "[46M" / * cyan * /
// #define bwht esc "[47m" / * White * /
#define nor esc "[2; 37; 0m" / * Return to the original color * /
/ * Added ANSI color definition character. Gothic April 23, 1993 * /
/ * Note: These operators are designed for VT100 terminals. * /
/ * In MUD, they may not necessarily use it normally. * /
#define bold esc "[1M" / * Open bold * /
#define CLR ESC "[2J" / * clear screen * /
#define home esc "[h" / * Send cursor to the original * /
#define Ref CLR Home / * Cleansing and Clear Cursor * /
#define Bigtop Esc "# 3" / * DBL Height Characters, Top Half * /
#define bigbot Esc "# 4" / * DBL Height Characters, Bottem Half * /
#define savec esc "[s" / * save cursor position * /
#define rest esc "[u" / * restore cursor to saved position * /
// # Define Revindex Esc "M" / * Scroll Screen In Opposite Direction * /
#define Singw Esc "# 5" / * Normal, Single-Width Characters * /
#define DBL ESC "# 6" / * creates double-width characters * /
#define frTop Esc "[2; 25R" / * freezing first line * /
#define frBot Esc "[1; 24R" / * freeze bottom one line * /
#define unfr ESC "[R" / * The first line and the bottom line thaw * /
#define blink esc "[5m" / * constantly shining mode * /
#define u esc "[4m" / * Underline mode * /
#DEfine Rev Esc "[7M" / * Open the anti-white mode * /
#define hirev esc "[1,7m" / * bright color anti-white shows * / above is the ANSI.H file of my Chinese, some of which are too difficult, so I have to leave the original. Take care of it seriously
These, you should basically understand how the common ANSI color is used, so if you don't #Clude
Need to use the front plus [1; 33M this way, these are very simple, I will not get out. This article must talk about the focus, in fact, an ANSI
Coordination of Color in ZMUD.
Basically most of the MUD players are using ZMUD for client software, so your program is especially important in Zmud.
The problem is actually appearing in the use of ANSI color, ZMUD and standard ANSI definitions have disagreement, this difference is in ZMUD 4.62 Chinese version
The 4.62 English version of ZMUD should have no problems, but it is because there is no problem since the previous problem. Do you hear it here?
I don't understand more and less? Well, we are still from the source. The following "original" is to refer to ZMUD 4.62 English and previous.
It should be clear that the definition of the above is clear [1; XXM is the definition of HIX, "1;" or "hi" what is said
The meaning of bold, it is clear in the original annotation, and the original Yel, that is, [33M, which is probably this brightness, and if it becomes HIY or
Say [1; 33M, it should be like this, this is the standard usage, and ZMUD supports the support of Chinese fonts or is not very perfect. Generally, it is
Using the Song, if there is a bold, it will also be atrified on the screen. It was originally this line of words, slipping to the following lines, very hunting.
So the program written by ZMUD4.62 English version of the tool is generally not using hiy, because this color is also bright, the display did not ask
Question, everything is fine.
But after the 4.62 Chinese version, the pattern was destroyed. All ZMUDs after this version are basically [1; that is, Hi default]
To highlight, and what is the original Yel, it becomes very dim, and the YEL after this version is displayed, and Hiy is like this.
Because there is no bold, there is no problem with it. And the procedures developed in the original environment can be miserable, like my simulation,
The color of the entire MUD is very dim, nature is very unassative.
The problem is very easy to solve, as long as the setting of ZMUD can be adjusted, but the problem is that the color ZMUD settings are particularly difficult to adjust.
(Almost every version I have tried), causing normal settings to be set up in an abnormal setting, most of the players will not be adjusted. therefore
Your MUD If you want to use ANSI color, you should consider this compatibility problem.
So, because most of the MUD players are used by ZMUD 4.62 Chinese version, I suggest that "HIX" is used in uniformity.
Point, the player looks brightly bright, and there is no problem with the bold display. Low bright color is less, of course, if you are all
Using low brightness or high brightness, if you want to convert, you can also achieve it, it is relatively simple, you don't have to say it.