diff --git a/src/Kaleidoscope/LED-Stalker.cpp b/src/Kaleidoscope/LED-Stalker.cpp index 10ec5486..1f3a7fa6 100644 --- a/src/Kaleidoscope/LED-Stalker.cpp +++ b/src/Kaleidoscope/LED-Stalker.cpp @@ -92,22 +92,18 @@ namespace KaleidoscopePlugins { namespace Stalker { + cRGB Haunt::highlightColor; + // Haunt - float Haunt::mb; - float Haunt::mg; - float Haunt::mr; - - Haunt::Haunt (const cRGB highlightColor) { - mb = highlightColor.b / 255.0; - mg = highlightColor.g / 255.0; - mr = highlightColor.r / 255.0; + Haunt::Haunt (const cRGB highlightColor_) { + highlightColor = highlightColor_; } cRGB Haunt::compute (uint8_t step) { - cRGB color = {(uint8_t)min(step * mb, 255), - (uint8_t)min(step * mg, 255), - (uint8_t)min(step * mr, 255)}; + cRGB color = CRGB((uint8_t)min(step * highlightColor.r / 255, 255), + (uint8_t)min(step * highlightColor.g / 255, 255), + (uint8_t)min(step * highlightColor.b / 255, 255)); return color; } diff --git a/src/Kaleidoscope/LED-Stalker.h b/src/Kaleidoscope/LED-Stalker.h index fdbeace8..b75e28ce 100644 --- a/src/Kaleidoscope/LED-Stalker.h +++ b/src/Kaleidoscope/LED-Stalker.h @@ -56,9 +56,8 @@ namespace KaleidoscopePlugins { Haunt (void *) : Haunt () {}; virtual cRGB compute (uint8_t step) final; - private: - static float mr, mg, mb; + static cRGB highlightColor; }; class BlazingTrail : public StalkerEffect::ColorComputer {