Fixed Color::operator+ and operator*
Thanks to Overdrivr Former-commit-id: 696e2a35f4e0243577a56feeb16e2268f25290d3
This commit is contained in:
parent
1ebaf4749c
commit
901b917d37
|
|
@ -52,17 +52,17 @@ inline NzString NzColor::ToString() const
|
||||||
inline NzColor NzColor::operator+(const NzColor& color) const
|
inline NzColor NzColor::operator+(const NzColor& color) const
|
||||||
{
|
{
|
||||||
return NzColor(std::min(static_cast<nzUInt16>(r) + color.r, 255),
|
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>(g) + color.g, 255),
|
||||||
std::min(static_cast<nzUInt16>(r) + color.r, 255),
|
std::min(static_cast<nzUInt16>(b) + color.b, 255),
|
||||||
std::min(static_cast<nzUInt16>(r) + color.r, 255));
|
std::min(static_cast<nzUInt16>(a) + color.a, 255));
|
||||||
}
|
}
|
||||||
|
|
||||||
inline NzColor NzColor::operator*(const NzColor& color) const
|
inline NzColor NzColor::operator*(const NzColor& color) const
|
||||||
{
|
{
|
||||||
return NzColor(static_cast<nzUInt16>(r) * color.r/255,
|
return NzColor(static_cast<nzUInt16>(r) * color.r/255,
|
||||||
static_cast<nzUInt16>(r) * color.r/255,
|
static_cast<nzUInt16>(g) * color.g/255,
|
||||||
static_cast<nzUInt16>(r) * color.r/255,
|
static_cast<nzUInt16>(b) * color.b/255,
|
||||||
static_cast<nzUInt16>(r) * color.r/255);
|
static_cast<nzUInt16>(a) * color.a/255);
|
||||||
}
|
}
|
||||||
|
|
||||||
inline NzColor NzColor::operator+=(const NzColor& color)
|
inline NzColor NzColor::operator+=(const NzColor& color)
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue