Advertisement
JoshDreamland

ENIGMA html_string

Jul 22nd, 2015
279
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.41 KB | None | 0 0
  1. // Top of estring.cpp:
  2. #include <iomanip>
  3. #include <sstream>
  4.  
  5. // Wherever you like in estring.cpp:
  6. string html_color(int x) {
  7.   std::stringstream res;
  8.   res << "#"
  9.       << std::setbase(16) << std::setfill('0') << std::setw(6) << std::uppercase
  10.       << (((x & 0xFF0000) >> 16) | (x & 0x00FF00) | ((x & 0x0000FF) << 16));
  11.   return res.str();
  12. }
  13.  
  14. // Wherever you like in estring.h:
  15. string html_color(int x);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement