22 #include <unordered_map>
114 std::string
debug()
const;
Representing the "team color" information, this C++ class contains a subset of WML's [color_range] ta...
color_t max() const
Maximum color shade.
color_t font_color() const
High-contrast to dark backgrounds, intended for the text in the chat log, etc.
bool operator==(const color_range &b) const
color_t rep() const
High-contrast against typical terrain colors, intended for the minimap markers.
color_range(color_t mid, color_t max, color_t min, color_t rep, color_t font)
Constructor, which expects four reference RGB colors.
color_range()
Default constructor.
color_t mid() const
Average color shade.
color_t min() const
Minimum color shade.
std::string debug() const
Return a string describing the color range for debug output.
color_range(const std::vector< color_t > &v, const std::optional< color_t > &font)
Constructor, matching the WML tag's split of the rgb attribute in one argument, and the color for UI ...
color_mapping generate_color_mapping(const color_range &new_rgb, const std::vector< color_t > &old_rgb)
Converts a source palette using the specified color_range object.
std::vector< color_t > generate_reference_palette(const color_range &cr)
Creates a reference color palette from a color range.
std::unordered_map< color_t, color_t > color_mapping
std::size_t size(std::string_view str)
Length in characters of a UTF-8 string.
The basic class for representing 8-bit RGB or RGBA colour values.