Skip to content

Commit

Permalink
Update colorwheel from GRB to RGB.
Browse files Browse the repository at this point in the history
  • Loading branch information
kattni committed May 8, 2020
1 parent 6a5ab57 commit 37e5ff7
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions shared-bindings/_pixelbuf/__init__.c
Original file line number Diff line number Diff line change
Expand Up @@ -69,10 +69,10 @@ const int32_t colorwheel(float pos) {
pos = pos - ((uint32_t)(pos / 256) * 256);
}
if (pos < 85)
return (uint8_t)(pos * 3) << 16 | (uint8_t)(255 - (pos * 3)) << 8;
return (uint8_t)(255 - (pos * 3)) << 16 | (uint8_t)(pos * 3);
else if (pos < 170) {
pos -= 85;
return (uint8_t)(255 - (pos * 3)) << 16 | (uint8_t)(pos * 3);
return (uint8_t)(pos * 3) << 16 | (uint8_t)(255 - (pos * 3)) << 8;
} else {
pos -= 170;
return (uint8_t)(pos * 3) << 8 | (uint8_t)(255 - pos * 3);
Expand Down

0 comments on commit 37e5ff7

Please sign in to comment.