Hello, I need to perform a task which will look similar to this:
std::string colorInfo = "255.255.255.255";
std::vector<std::string> RGBA = splitStringByCharacter(colorInfo, '.');
sf::Color color;
color.r ?= RGBA[0];
color.g ?= RGBA[1];
color.b ?= RGBA[2];
color.a ?= RGBA[3];
?=
This sign was written intentionally, because this is the thing I want to ask about. RGBA is a vector of
std::string, however any member variable of color is of
sf::Uint8 type. How should I proceed with that kind of conversion to make sure data won't be lost or corrupted?