Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/FastLED/FastLED.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMark Kriegsman <kriegsman@users.noreply.github.com>2018-05-17 05:56:00 +0300
committerMark Kriegsman <kriegsman@users.noreply.github.com>2018-05-17 05:56:00 +0300
commitade8254a26ffff43ba184266194b44c991003600 (patch)
tree9090387fdc0de139813c0b75a2369660b826f267
parentf718faf1cde3479aae1fb3f173996e6f55183406 (diff)
Correct an off-by-one bug in hue calculation. Hopefully fixes #602.
-rw-r--r--colorutils.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/colorutils.cpp b/colorutils.cpp
index 74b8ce46..07d6be81 100644
--- a/colorutils.cpp
+++ b/colorutils.cpp
@@ -930,7 +930,7 @@ CHSV ColorFromPalette( const struct CHSVPalette16& 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);