Skip to content

Commit 3409243

Browse files
authored
Merge pull request #6016 from todbot/rainbowio-255p5-fix
fix #6015: rainbowio error for input > 255.0 < 256.0
2 parents 160b1aa + 98ff995 commit 3409243

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

shared-module/rainbowio/__init__.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,5 +42,6 @@ int32_t colorwheel(mp_float_t pos) {
4242
shift2 = 0;
4343
}
4444
int p = (int)(pos * 3);
45+
p = (p < 256) ? p : 255;
4546
return (p << shift1) | ((255 - p) << shift2);
4647
}

0 commit comments

Comments
 (0)