TEXTCOLO
From ZDoom Wiki
The TEXTCOLO lump is used to define custom text colors for use in hudmessages. This is especially useful in conjunction with Graf Zahl's GZDoom port and its true-color rendering, or with wads that utilize a modified palette. Thanks to this lump, the use of cyan or magenta text, for example, is now a possibility.
Contents |
Creating New Colors
The format for creating new text colors is simple. Take a look at the template below.
Color
{
#RRGGBB #RRGGBB
Console:
#RRGGBB #RRGGBB x y
#RRGGBB #RRGGBB x y
}
"Color" is simply whatever name you choose, whether it be LimeGreen, DarkPurple, or NeonRainbowSmoothie. Take your pick. "#RRGGBB" specifies the color (in hex). For example, #FF0000 is bright red, #008888 would be a dark teal color, and #775522 is a rather ugly shade of brown. Notice how each #RRGGBB color definition comes in pairs of two. This is a color range. The first color in the range specifies the darkest shade that appears in the color, while the second color is the lightest. ZDoom will then use these to create a gradient between the colors. As a quick example, ZDoom's standard "Gold" translation looks like "#732B00 #FFFF73" in the new format. Keep in mind that it is possible to create odd translations as well. If you really feel the need to create an ugly green/purple gradient ("#008800 #FF00FF"), it's quite possible.
The "Console" fields are a little more complex. These ranges are the ones used when a message is displayed in the console. This is especially important when using the HUDMSG_LOG HudMessage type.
x and y are the beginning and ending brightness indexes. ZDoom internally converts the font to a grayscale image before applying the new color, so an x value of "0" would represent the absolute darkest shade "#000000" and a y value of "256" would represent the lightest shade "#FFFFFF". These are the shades of gray, or brightness of the color, once the image is converted to gray scale. "127" is equivalent to a gray scale brightness of "#7F7F7F".
Some more examples of custom definitions:
Teal
{
#004444 #00AAAA
Console:
#000000 #007F7F 0 127
#00FFFF #DEFFFF 128 256
}
ZenGreen
{
#004400 #00FF00
Console:
#000000 #007F00 0 127
#00FF00 #FEFFFE 128 256
}
Using New Colors
Thankfully, once your new colors are defined, using them is very simple. In your HudMessage or Print string, insert a \c[Color] code. For example,
print (s:"\c[Green]Some text");
would make the text green, starting at whatever spot you choose. It is also possible to change the color in the middle of the text by inserting another \c code.
print (s:"\c[Red]Dual \c[Blue]Colors!");
Default Colors
ZDoom comes equipped with quite a few default translation ranges. Simply use these colors in hudmessages the same as mentioned above.
Brick Tan Gray / Grey Green Brown Gold Red Blue White Yellow Black LightBlue Cream Olive DarkGreen DarkRed Purple DarkGray / DarkGrey Untranslated

