Fixed Color::operator+ and operator*

Thanks to Overdrivr


Former-commit-id: 696e2a35f4e0243577a56feeb16e2268f25290d3
This commit is contained in:
Lynix 2013-08-06 23:15:22 +02:00
parent 1ebaf4749c
commit 901b917d37
1 changed files with 6 additions and 6 deletions

View File

@ -52,17 +52,17 @@ inline NzString NzColor::ToString() const
inline NzColor NzColor::operator+(const NzColor& color) const
{
return NzColor(std::min(static_cast<nzUInt16>(r) + color.r, 255),
std::min(static_cast<nzUInt16>(r) + color.r, 255),
std::min(static_cast<nzUInt16>(r) + color.r, 255),
std::min(static_cast<nzUInt16>(r) + color.r, 255));
std::min(static_cast<nzUInt16>(g) + color.g, 255),
std::min(static_cast<nzUInt16>(b) + color.b, 255),
std::min(static_cast<nzUInt16>(a) + color.a, 255));
}
inline NzColor NzColor::operator*(const NzColor& color) const
{
return NzColor(static_cast<nzUInt16>(r) * color.r/255,
static_cast<nzUInt16>(r) * color.r/255,
static_cast<nzUInt16>(r) * color.r/255,
static_cast<nzUInt16>(r) * color.r/255);
static_cast<nzUInt16>(g) * color.g/255,
static_cast<nzUInt16>(b) * color.b/255,
static_cast<nzUInt16>(a) * color.a/255);
}
inline NzColor NzColor::operator+=(const NzColor& color)