display_led_effect_interpolate.h
1 #pragma once 2 3 #include "display_led_effect.h" 4 #include "display_led_effect_common.h" 5 6 namespace display::led::effect 7 { 8 class Interpolate : public Effect 9 { 10 public: 11 Interpolate(RgbColor start, RgbColor end, float duration) 12 : Effect(duration), startColor(start), endColor(end) 13 { 14 SetWrapMode(WrapMode::ClampForever); 15 } 16 virtual void Update(float timeDelta, RgbLedColorBufferDescriptor &colors) override; 17 void SetStartColor(RgbColor from) { startColor = from; } 18 void SetEndColor(RgbColor to) { endColor = to; } 19 private: 20 RgbColor startColor; 21 RgbColor endColor; 22 }; 23 } // namespace display::led::effect