Modding:Color (0.9.9.7)
From DoomRL Wiki
In console mode all game tiles are associated with a particular color. Choosing a good color scheme is an important part of modding, but the choice is limited--only 16 colors exist in the standard VGA compatible console which, when combined into foreground and background, results in only 256 possible combinations. There are some special engine colors as well to further complicate matters.
In graphics mode all game tiles are associated with a particular sprite. The sprites obviously support more than 16 colors. They can also be further manipulated by engine effects, color overlays (both additive and subtractive), and outlines.
Contents |
Console Colors
Color Definitions
Colors | |||
Color | ID | Valkyrie ID | Looks Like |
---|---|---|---|
BLACK | 0 | @D | |
BLUE | 1 | @b | |
GREEN | 2 | @g | |
CYAN | 3 | @c | |
RED | 4 | @r | |
MAGENTA | 5 | @v | |
BROWN | 6 | @n or @N | |
LIGHTGRAY | 7 | @l | |
DARKGRAY | 8 | @d | |
LIGHTBLUE | 9 | @B | |
LIGHTGREEN | 10 | @G | |
LIGHTCYAN | 11 | @C | |
LIGHTRED | 12 | @R | |
LIGHTMAGENTA | 13 | @V | |
YELLOW | 14 | @y or @Y | |
WHITE | 15 | @L |
Special Colors
Colors | ||||||||
Color | ID | Looks Like | Comments | |||||
---|---|---|---|---|---|---|---|---|
MULTIBLUE | 17 | Missile only | ||||||
MULTIYELLOW | 18 | Missile only | ||||||
MULTIPORTAL | 20 | Map object only | ||||||
COLOR_WATER | 21 | Map object only | ||||||
COLOR_ACID | 22 | Map object only | ||||||
COLOR_LAVA | 23 | Map object only |
Background Colors
DoomRL uses 4 bit color. In 4 bit color consoles the lower four bits correspond to the foreground color while the upper four bits correspond to the background color (usually). When you assign a color using the color constants above the upper bits will equal zero, which is the default background color--black. You can change this by explicitly assigning the upper 4 bits a value using code similar to the following:
color = LIGHTGRAY + (RED * 16)
The above statement will display light gray text over a red background. Officially this is unsupported. Unofficially it is used often enough that support for it will most likely continue. There is a caveat though--some combinations are used by the special colors above and thus cannot be used for regular items.
Notes and Advice
- The color.lua script can be used by players to customize tiles.
- Many objects have a color_id property that can be used to prevent unscrupulous players from distinguishing between items such as levers by color.
- Console colors are not always consistent. Brown in particular can vary a lot and more closely mimics orange in some environments.
- Dark Blue is hard to see on a black background and should be used sparingly, especially with beings who can be frustrating when hard to see.
- Background colors should be used sparingly, if at all. The clear divides break immersion.
- Be aware of common roguelike coloring customs, especially those used by NetHack and (obviously) DoomRL.
Color Sets
A color set in DoomRL is an array in the form of { red, green, blue, alpha }. Each value is a decimal between 0.0 and 1.0, though at present alpha is not used.
Coscolor
A coscolor is an additive modifier found on cells, beings, items, and missiles. To have any effect a sprite must have a grayscale color map associated with it. Currently only a small number of sprites, such as mod packs, do.
Overlay
An overlay is a subtractive modifier found on beings and items. It will remove colors from sprites--the overlay { 1.0, 0.0, 0.0, 1.0 } for instance would turn a sprite completely red. This option is mostly intended for creating placeholder sprites quickly and is rather limited. Status effects react to overlays in unusual ways and since adding color or changing hues is impossible it is difficult to get a good end result.
Glow
A glow is an additive modifier found on beings and items. Unlike the other graphical modifiers this directly adds a color to a sprite based on its outline (minus its shadow). The effect is a smooth and pleasant glow effect which can be used to great effect without worrying about side effects.