Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- SDL_Color decode_color(const std::string& color)
- {
- std::vector<std::string> fields = utils::split(color);
- // Make sure we have four fields
- while(fields.size() < 4) {
- fields.push_back("0");
- }
- return {
- lexical_cast<unsigned int>(fields[0]),
- lexical_cast<unsigned int>(fields[1]),
- lexical_cast<unsigned int>(fields[2]),
- lexical_cast<unsigned int>(fields[3])};
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement