diff --git a/VortexEngine/src/Patterns/Multi/HueShiftPattern.cpp b/VortexEngine/src/Patterns/Multi/HueShiftPattern.cpp index b2d47de565..1246690963 100644 --- a/VortexEngine/src/Patterns/Multi/HueShiftPattern.cpp +++ b/VortexEngine/src/Patterns/Multi/HueShiftPattern.cpp @@ -10,6 +10,7 @@ HueShiftPattern::HueShiftPattern(const PatternArgs &args) : m_blinkOnDuration(0), m_blinkOffDuration(0), m_blendDelay(0), + m_delayCounter(0), m_blinkTimer(), m_cur(0), m_next(0) @@ -68,10 +69,16 @@ void HueShiftPattern::play() // because it will never reach the target hue and // always over/under shoot // only increment every blendDelay times - if (!m_blendDelay || (Time::getCurtime() % m_blendDelay) == 0) { + int timetest = ((Time::getCurtime() - 1) % m_blendDelay); + ++m_delayCounter; + if (m_delayCounter >= m_blendDelay) { + m_delayCounter = 0; m_cur.hue += sign; } - HSVColor showColor = m_cur; + HSVColor showColor; + showColor.hue = m_cur.hue; + showColor.sat = 255; + showColor.val = 255; // set the target led with the current HSV color for (LedPos pos = LED_FIRST; pos < LED_COUNT; ++pos) { Leds::setIndex(pos, hsv_to_rgb_generic(showColor)); diff --git a/VortexEngine/src/Patterns/Multi/HueShiftPattern.h b/VortexEngine/src/Patterns/Multi/HueShiftPattern.h index 39addf748d..691b3cb2e9 100644 --- a/VortexEngine/src/Patterns/Multi/HueShiftPattern.h +++ b/VortexEngine/src/Patterns/Multi/HueShiftPattern.h @@ -22,6 +22,7 @@ class HueShiftPattern : public MultiLedPattern uint8_t m_blinkOnDuration; uint8_t m_blinkOffDuration; uint8_t m_blendDelay; + uint8_t m_delayCounter; Timer m_blinkTimer;