JoshDreamland icon

ENIGMA html_string

JoshDreamland | PRO | 07/23/15 03:13:42 AM UTC | 0 ⭐ | 453 👁️ | Never ⏰ | []
C++ |

410 B

|

None

|

0 👍

/

0 👎

// 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);

Comments

  •  icon
    01/01/70 12:00:00 AM UTC
    Plain Text |

    0 B

    |

    👍

    /

    👎