forked from Makuna/NeoPixelBus
promote to int32_t (#623)
This commit is contained in:
@@ -135,9 +135,9 @@ void Rgb48Color::Lighten(uint16_t delta)
|
|||||||
|
|
||||||
Rgb48Color Rgb48Color::LinearBlend(const Rgb48Color& left, const Rgb48Color& right, float progress)
|
Rgb48Color Rgb48Color::LinearBlend(const Rgb48Color& left, const Rgb48Color& right, float progress)
|
||||||
{
|
{
|
||||||
return Rgb48Color( left.R + ((right.R - left.R) * progress),
|
return Rgb48Color( left.R + (((int32_t)right.R - left.R) * progress),
|
||||||
left.G + ((right.G - left.G) * progress),
|
left.G + (((int32_t)right.G - left.G) * progress),
|
||||||
left.B + ((right.B - left.B) * progress));
|
left.B + (((int32_t)right.B - left.B) * progress));
|
||||||
}
|
}
|
||||||
|
|
||||||
Rgb48Color Rgb48Color::BilinearBlend(const Rgb48Color& c00,
|
Rgb48Color Rgb48Color::BilinearBlend(const Rgb48Color& c00,
|
||||||
|
@@ -162,10 +162,10 @@ void Rgbw64Color::Lighten(uint16_t delta)
|
|||||||
|
|
||||||
Rgbw64Color Rgbw64Color::LinearBlend(const Rgbw64Color& left, const Rgbw64Color& right, float progress)
|
Rgbw64Color Rgbw64Color::LinearBlend(const Rgbw64Color& left, const Rgbw64Color& right, float progress)
|
||||||
{
|
{
|
||||||
return Rgbw64Color( left.R + ((right.R - left.R) * progress),
|
return Rgbw64Color( left.R + (((int32_t)right.R - left.R) * progress),
|
||||||
left.G + ((right.G - left.G) * progress),
|
left.G + (((int32_t)right.G - left.G) * progress),
|
||||||
left.B + ((right.B - left.B) * progress),
|
left.B + (((int32_t)right.B - left.B) * progress),
|
||||||
left.W + ((right.W - left.W) * progress) );
|
left.W + (((int32_t)right.W - left.W) * progress) );
|
||||||
}
|
}
|
||||||
|
|
||||||
Rgbw64Color Rgbw64Color::BilinearBlend(const Rgbw64Color& c00,
|
Rgbw64Color Rgbw64Color::BilinearBlend(const Rgbw64Color& c00,
|
||||||
|
Reference in New Issue
Block a user