Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // Top of estring.cpp:
- #include <iomanip>
- #include <sstream>
- // Wherever you like in estring.cpp:
- string html_color(int x) {
- std::stringstream res;
- res << "#"
- << std::setbase(16) << std::setfill('0') << std::setw(6) << std::uppercase
- << (((x & 0xFF0000) >> 16) | (x & 0x00FF00) | ((x & 0x0000FF) << 16));
- return res.str();
- }
- // Wherever you like in estring.h:
- string html_color(int x);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement