Colorization in SmaugWizard
Starting with SmaugWizard version 2.01, the capability to colorize various outputs has been added. The following types of output can be colorized:
1. Room Names and Descriptions. Color codes can be inserted into the text of room names and room descriptions, using the redit name and redit desc commands, or the options in rmenu page a.
2. Object Descriptions. Color codes can be inserted into the text of the object short and long descriptions, using the oset short and oset long commands, or the options in omenu page a.
3. Mob Descriptions. Color codes can be inserted into the text of the mobile short and long descriptions, using the mset short and mset long commands, or the options in mmenu page a.
4. Mpecho commands can also use color codes to provide colorized mobprog outputs.
To add colors to the various strings, edit them and add the following codes to set colors:
To set the foreground color, use the ampersand character (&), followed by a color code letter:
| &x - Black | &r - Red (blood) |
| &g - Green | &O - Orange (brown) |
| &b - Dark Blue | &p - Purple |
| &c - Cyan | &w - Gray (default color) |
| &z - Dark Gray | &R - Light Red |
| &G - Light Green | &Y - Yellow |
| &B - Blue | &P - Pink |
| &C - Light Blue | &W - White |
To set the background color, use the up-arrow character (^), followed by a color code letter. The codes in parenthesis are the same colors, but cause the foreground color to flash.
| ^x (z) - Black | ^r (R) - Red |
| ^g (G) - Green | ^O (Y) - Orange |
| ^b (B) - Blue | ^p (P) - Purple |
| ^c (C) - Cyan | ^w (W) - Gray |
Note: If setting both foreground and background colors. The foreground must precede the background color.
In addition to the color codes shown above there are two special control codes that can be used to save the current color, and later restore it. The code &[ causes the current foreground and background colors to be pushed onto a stack, and the code &] pops the last color set from the stack and sets it as the current color. This can be useful when you want to change the color of part of a line or paragraph, and later return to the original color, but you cannot be sure what the starting color will be. For example consider the line "A cute calico kitten arrives from the west.". Suppose you want to change the color of the word 'calico' to yellow. You edit the kitten's short description and change it to:
"A cute &[&Ycalico&] kitten"
This will cause the word 'calico' to be printed in yellow, and the rest of the line will be printed in the same color that the line started with. If the starting color was green, the line would appear as:
A cute calico kitten arrives from the west.
If the short description is changed to: "A cute &[&Ycalico &Rkitten&]", the line will print as:
A cute calico kitten arrives from the west.
In addition to the various mud descriptions these color codes can be used by players in says, tells, etc., and in their prompts. Note that the last color setting in the prompt will be used as the default color for responses to the text that the player types. If a different default color for responses is wanted, a code for that color can be put at the end of the prompt. Also, the color save and restore codes do not work in prompts.