Closed apopiak closed 9 years ago
In Color.cpp:
Color.cpp
std::string Color::asHex(bool alpha) const { std::stringstream stream; stream << "#";
If rgba() returns 0 (for black) the hex is invalid. Because of setw(2) and setfill('0') the stringstream contains #00 instead of the expected #00000000.
rgba()
0
setw(2)
setfill('0')
#00
#00000000
stream << std::hex << std::uppercase << std::setw(2) << std::setfill('0'); if (alpha) stream << rgba(); else stream << red() << green() << blue(); return stream.str(); }
In
Color.cpp
:If
rgba()
returns0
(for black) the hex is invalid. Because ofsetw(2)
andsetfill('0')
the stringstream contains#00
instead of the expected#00000000
.