implemented to_hex_color() method that returns
#RRGGBB color representation.
This commit is contained in:
parent
b73ca350fb
commit
ba2514398a
1 changed files with 73 additions and 66 deletions
|
@ -25,6 +25,7 @@
|
|||
#ifndef COLOR_HPP
|
||||
#define COLOR_HPP
|
||||
|
||||
#include <boost/format.hpp>
|
||||
#include "config.hpp"
|
||||
#include <sstream>
|
||||
|
||||
|
@ -105,6 +106,12 @@ namespace mapnik {
|
|||
ss << "rgb (" << red() << "," << green() << "," << blue() <<")";
|
||||
return ss.str();
|
||||
}
|
||||
inline std::string to_hex_string() const
|
||||
{
|
||||
std::stringstream ss;
|
||||
ss << boost::format("#%1$02x%2$02x%3$02x") % red() % green() % blue();
|
||||
return ss.str();
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue