A color range definition is made of four reference RGB colors, used for calculating conversions from a source/key palette. More...
#include <color_range.hpp>
Public Member Functions | |
color_range (Uint32 mid, Uint32 max=0x00FFFFFF, Uint32 min=0x00000000, Uint32 rep=0x00808080) | |
Constructor, which expects four reference RGB colors. More... | |
color_range (const std::vector< Uint32 > &v) | |
Constructor, which expects four reference RGB colors. More... | |
color_range () | |
Default constructor. More... | |
Uint32 | mid () const |
Average color shade. More... | |
Uint32 | max () const |
Maximum color shade. More... | |
Uint32 | min () const |
Minimum color shade. More... | |
Uint32 | rep () const |
High-contrast shade, intended for the minimap markers. More... | |
bool | operator< (const color_range &b) const |
bool | operator== (const color_range &b) const |
int | index () const |
std::string | debug () const |
Return a string describing the color range for debug output. More... | |
Private Attributes | |
Uint32 | mid_ |
Uint32 | max_ |
Uint32 | min_ |
Uint32 | rep_ |
A color range definition is made of four reference RGB colors, used for calculating conversions from a source/key palette.
1) The average shade of a unit's team-color portions (default: gray #808080) 2) The maximum highlight shade of a unit's team-color portions (default: white) 3) The minimum shadow shade of a unit's team-color portions (default: black) 4) A plain high-contrast color, used for the markers on the mini-map (default: same as the provided average shade, or gray #808080)
The first three reference colors are used for converting a source palette with the external recolor_range() method.
Definition at line 54 of file color_range.hpp.
|
inline |
Constructor, which expects four reference RGB colors.
mid | Average color shade. |
max | Maximum (highlight) color shade |
min | Minimum color shade |
rep | High-contrast reference color |
Definition at line 64 of file color_range.hpp.
|
inline |
Constructor, which expects four reference RGB colors.
v | STL vector with the four reference colors in order. |
Definition at line 70 of file color_range.hpp.
|
inline |
Default constructor.
Definition at line 79 of file color_range.hpp.
std::string color_range::debug | ( | ) | const |
int color_range::index | ( | ) | const |
Definition at line 178 of file color_range.cpp.
References game_config::color_info(), i, and gamemap::MAX_PLAYERS.
|
inline |
Maximum color shade.
Definition at line 84 of file color_range.hpp.
References max_.
Referenced by operator<(), operator==(), and recolor_range().
|
inline |
Average color shade.
Definition at line 82 of file color_range.hpp.
References mid_.
Referenced by operator<(), operator==(), and recolor_range().
|
inline |
Minimum color shade.
Definition at line 86 of file color_range.hpp.
References min_.
Referenced by operator<(), operator==(), and recolor_range().
|
inline |
|
inline |
|
inline |
High-contrast shade, intended for the minimap markers.
Definition at line 88 of file color_range.hpp.
References rep_.
Referenced by display::draw_minimap_units(), image::getMinimap(), operator<(), and operator==().
|
private |
Definition at line 109 of file color_range.hpp.
Referenced by debug(), max(), operator<(), and operator==().
|
private |
Definition at line 109 of file color_range.hpp.
Referenced by debug(), mid(), operator<(), and operator==().
|
private |
Definition at line 109 of file color_range.hpp.
Referenced by debug(), min(), operator<(), and operator==().
|
private |
Definition at line 109 of file color_range.hpp.
Referenced by debug(), operator<(), operator==(), and rep().