diff options
| author | Kattni Rembor <kattni@adafruit.com> | 2020-05-08 13:25:52 -0400 |
|---|---|---|
| committer | Kattni Rembor <kattni@adafruit.com> | 2020-05-08 13:25:52 -0400 |
| commit | 37e5ff7757f753516b5fca5aa345f6d112f8b2fa (patch) | |
| tree | e12a2ac8f78adb5e3fa9aa912ee2ba50cd562fab /shared-bindings/_pixelbuf | |
| parent | 6a5ab57c18b5a4ba1c80a951ec0ee655677f7d83 (diff) | |
Update colorwheel from GRB to RGB.
Diffstat (limited to 'shared-bindings/_pixelbuf')
| -rw-r--r-- | shared-bindings/_pixelbuf/__init__.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/shared-bindings/_pixelbuf/__init__.c b/shared-bindings/_pixelbuf/__init__.c index 424ed23e4..394ab3a9d 100644 --- a/shared-bindings/_pixelbuf/__init__.c +++ b/shared-bindings/_pixelbuf/__init__.c @@ -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); |
