diff options
author | Mark Kriegsman <kriegsman@users.noreply.github.com> | 2018-05-17 23:36:21 +0300 |
---|---|---|
committer | Mark Kriegsman <kriegsman@users.noreply.github.com> | 2018-05-17 23:36:21 +0300 |
commit | dbd2d8b8ca037f9d2d5e743785abac28b125c947 (patch) | |
tree | 23be148d11109eb6c5159e9cc2f91a21667ce310 | |
parent | ade8254a26ffff43ba184266194b44c991003600 (diff) |
Correct an off-by-one bug in hue calculation, part II. Hopefully fixes #602 the rest of the way.
-rw-r--r-- | colorutils.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/colorutils.cpp b/colorutils.cpp index 07d6be81..10d35924 100644 --- a/colorutils.cpp +++ b/colorutils.cpp @@ -1020,7 +1020,7 @@ CHSV ColorFromPalette( const struct CHSVPalette32& pal, uint8_t index, uint8_t b uint8_t deltaHue = (uint8_t)(hue2 - hue1); if( deltaHue & 0x80 ) { // go backwards - hue1 -= scale8( 255 - deltaHue, f2); + hue1 -= scale8( 256 - deltaHue, f2); } else { // go forwards hue1 += scale8( deltaHue, f2); |