New font::span_color overload.

(cherry picked from commit c89b644a64)
This commit is contained in:
josteph 2019-09-18 17:00:35 +00:00
parent eb0a7a8248
commit 0e9e47e2fb
2 changed files with 10 additions and 0 deletions

View file

@ -27,6 +27,11 @@ std::string span_color(const color_t& color)
return formatter() << "<span color='" << color.to_hex_string() << "'>"; return formatter() << "<span color='" << color.to_hex_string() << "'>";
} }
std::string span_color(const color_t& color, const std::string& data)
{
return span_color(color) + data + "</span>";
}
std::string get_pango_color_from_id(const std::string& id) std::string get_pango_color_from_id(const std::string& id)
{ {
const auto color = game_config::team_rgb_colors.find(id); const auto color = game_config::team_rgb_colors.find(id);

View file

@ -37,6 +37,11 @@ namespace font {
*/ */
std::string span_color(const color_t& color); std::string span_color(const color_t& color);
/**
* Like span_color(const color_t&), but append the data string and a "</span>" tag.
*/
std::string span_color(const color_t& color, const std::string& data);
/** /**
* Returns a hex color string from a color range. * Returns a hex color string from a color range.
* *