Colors
DDA is colorful game. You can use several foreground and background colors in various places:
- map data (terrain and furniture);
- item data;
- text data;
- etc.
Note: Map data objects can only have one color-related node defined (either color or bgcolor).
Color string format
Whenever color is defined in JSON it should be defined in following format: Prefix_Foreground_Background.
Prefix can take one of following values:
c_- default color prefix (can be omitted);i_- optional prefix which indicates that foreground color should be inverted (special rules will be applied to foreground and background colors);h_- optional prefix which indicates that foreground color should be highlighted (special rules will be applied to foreground and background colors).
Foreground - defines mandatory color of foreground/ink/font.
Background - defines optional color of background/paper.
Note: If color was not found by its name, then c_unset is used for Foreground and i_white for Background.
Examples of color strings
c_white-whitecolor (with default prefixc_);black-blackcolor (default prefixc_is omitted);i_red- invertedredcolor;dark_gray_white-dark_grayforeground color withwhitebackground color;light_gray_light_red-light_grayforeground color withlight_redbackground color;dkgray_red-dark_grayforeground color withredbackground color (deprecated prefixdkinstead ofdark_);ltblue_red-light_blueforeground color withredbackground color (deprecated prefixltinstead oflight_).
Color code
Color code is short string which defines color and can be used, for example, in maps notes.
Possible colors
Note: Default RGB values are taken from file \data\raw\colors.json.
Note: RGB values can be redefined in file \config\base_colors.json.
Color rules
There are two types of special color transformation which can affect both foreground and background color:
- inversion;
- highlight.
Note: Color rules can be redefined (for example, \data\raw\color_templates\no_bright_background.json).