Generate ranges of colors, and color palettes. More...
#include "color_range.hpp"#include "game_config.hpp"#include "map.hpp"#include "serialization/string_utils.hpp"#include "util.hpp"#include <iomanip>
Go to the source code of this file.
Functions | |
| std::map< Uint32, Uint32 > | recolor_range (const color_range &new_range, const std::vector< Uint32 > &old_rgb) |
| Converts a source palette using the specified color_range object. | |
| bool | string2rgb (const std::string &s, std::vector< Uint32 > &result) |
| std::vector< Uint32 > | palette (color_range cr) |
| Creates a reference color palette from a color range. | |
| 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. | |
Generate ranges of colors, and color palettes.
Used e.g. to color HP, XP.
Definition in file color_range.cpp.
| std::vector<Uint32> palette | ( | color_range | cr | ) |
Creates a reference color palette from a color range.
Definition at line 131 of file color_range.cpp.
References recolor_range().

| 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.
This holds the main interface for range-based team coloring. The output is used with the recolor_image() method to do the actual recoloring.
| new_rgb | Specifies parameters for the conversion. | |
| old_rgb | Source palette. |
Definition at line 31 of file color_range.cpp.
References color_range::max(), color_range::mid(), and color_range::min().
Referenced by BOOST_AUTO_TEST_CASE(), and palette().


| std::string rgb2highlight | ( | Uint32 | rgb | ) |
Converts a color value to WML text markup syntax for highlighting.
For example, 0x00CC00CC becomes "<204,0,204>".
Definition at line 159 of file color_range.cpp.
References h.
Referenced by team::get_side_highlight().

| std::string rgb2highlight_pango | ( | Uint32 | rgb | ) |
Converts a color value to WML text markup syntax for highlighting.
For example, 0x00CC00CC becomes "#CC00CC".
Definition at line 169 of file color_range.cpp.
References h.
Referenced by team::get_side_highlight_pango().

| bool string2rgb | ( | const std::string & | s, | |
| std::vector< Uint32 > & | result | |||
| ) |
Definition at line 92 of file color_range.cpp.
References lexical_cast(), and utils::split().
Referenced by team::team_info::read(), and terrain_label::read().


| Generated by doxygen 1.7.1 on Thu May 24 2012 01:03:42 for The Battle for Wesnoth | Gna! | Forum | Wiki | CIA | devdocs |