implemented to_hex_color() method that returns

#RRGGBB color representation.
This commit is contained in:
Artem Pavlenko 2006-05-24 15:13:51 +00:00
parent b73ca350fb
commit ba2514398a

View file

@ -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();
}
};
}