I have a class with the following constructors:
Color(const float red = 0.0f, const float green = 0.0f, const float blue = 0.0f, const float alpha = 1.0f);
Color(const unsigned char red, const unsigned char green, const unsigned char blue, const unsigned char alpha);
Color(const unsigned long int color);
If I call it like this:
Color c{ 0.0f, 1.0f, 0.0f, 1.0f };
everything is ok. But if I call it:
Color c{ 78, 180, 84, 255 };
or
Color c{ 0xffffffff };
I receive
error C2668: 'Color::Color' : ambiguous call to overloaded function
Why? How to make it choose correctly?