Merge pull request #2832 from HHHartmann/ws2812-buffer-mix

fix rounding in ws2812:buffer:mix

Looks good to me.
This commit is contained in:
Philip Gladstone 2019-07-14 16:05:13 -04:00 committed by GitHub
commit 891799279d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 0 deletions

View File

@ -425,6 +425,7 @@ static int ws2812_buffer_mix(lua_State* L) {
val += (int32_t)(source[src].values[i] * source[src].factor);
}
val += 128; // rounding istead of floor
val >>= 8;
if (val < 0) {