Commit bd0549ac authored by Gregor's avatar Gregor
Browse files

fix rounding in ws2812:buffer:mix

parent 0398c336
...@@ -425,6 +425,7 @@ static int ws2812_buffer_mix(lua_State* L) { ...@@ -425,6 +425,7 @@ static int ws2812_buffer_mix(lua_State* L) {
val += (int32_t)(source[src].values[i] * source[src].factor); val += (int32_t)(source[src].values[i] * source[src].factor);
} }
val += 128; // rounding istead of floor
val >>= 8; val >>= 8;
if (val < 0) { if (val < 0) {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment