I want that the user is able to enter the RGB colors one after one, I tried to keep the code simple as possible. The code below works, causes no errors, but I dont understand why its not in the correct order R > G > B, the first entered value is in this case the blue color, which is not wanted.
cout << "Enter successively red-, green, blue-part: " << endl;
c.setColor(readColor(cin), readColor(cin), readColor(cin));
setColor is defined:
void RGB_Color::setColor(int red, int green, int blue) {
this->red = red;
this->green = green;
this->blue = blue;
readColor function:
int readColor(istream &stream)
{
int i;
stream >> i;
return i;
}