21 #include <unordered_map>
111 std::string
debug()
const;
A color range definition is made of four reference RGB colors, used for calculating conversions from ...
color_t max() const
Maximum color shade.
color_range(color_t mid, color_t max={255, 255, 255}, color_t min={0, 0, 0}, color_t rep={128, 128, 128})
Constructor, which expects four reference RGB colors.
bool operator==(const color_range &b) const
color_t rep() const
High-contrast shade, intended for the minimap markers.
color_range()
Default constructor.
color_t mid() const
Average color shade.
bool operator<(const color_range &b) const
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)
Constructor, which expects four reference RGB colors.
std::unordered_map< color_t, color_t > color_range_map
std::vector< color_t > palette(const color_range &cr)
Creates a reference color palette from a color range.
color_range_map recolor_range(const color_range &new_rgb, const std::vector< color_t > &old_rgb)
Converts a source palette using the specified color_range object.
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.
constexpr uint32_t to_rgba_bytes() const
Returns the stored color as a uint32_t, in RGBA format.