17 #ifndef COLOR_RANGE_H_INCLUDED
18 #define COLOR_RANGE_H_INCLUDED
31 #include <SDL_types.h>
71 :
mid_(v.
size() ? v[0] : 0x00808080),
72 max_(v.
size() > 1 ? v[1] : 0x00FFFFFF),
73 min_(v.
size() > 2 ? v[2] : 0x00000000),
std::string debug() const
Return a string describing the color range for debug output.
color_range(const std::vector< Uint32 > &v)
Constructor, which expects four reference RGB colors.
Uint32 mid() const
Average color shade.
Uint32 rep() const
High-contrast shade, intended for the minimap markers.
GLdouble GLdouble GLdouble b
std::vector< Uint32 > palette(color_range cr)
Creates a reference color palette from a color range.
bool operator==(const color_range &b) const
color_range(Uint32 mid, Uint32 max=0x00FFFFFF, Uint32 min=0x00000000, Uint32 rep=0x00808080)
Constructor, which expects four reference RGB colors.
color_range()
Default constructor.
std::string rgb2highlight(Uint32 rgb)
Converts a color value to WML text markup syntax for highlighting.
std::string rgb2highlight_pango(Uint32 rgb)
Converts a color value to WML text markup syntax for highlighting.
bool operator<(const color_range &b) const
A color range definition is made of four reference RGB colors, used for calculating conversions from ...
bool string2rgb(const std::string &s, std::vector< Uint32 > &result)
std::map< Uint32, Uint32 > recolor_range(const color_range &new_rgb, const std::vector< Uint32 > &old_rgb)
Converts a source palette using the specified color_range object.
Uint32 min() const
Minimum color shade.
GLsizei const GLcharARB ** string
Uint32 max() const
Maximum color shade.