Permalink
Browse files

Correct an off-by-one bug in hue calculation, part II. Hopefully fixes

…#602 the rest of the way.
  • Loading branch information...
kriegsman committed May 17, 2018
1 parent ade8254 commit dbd2d8b8ca037f9d2d5e743785abac28b125c947
Showing with 1 addition and 1 deletion.
  1. +1 −1 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);

0 comments on commit dbd2d8b

Please sign in to comment.