31 lines
567 B
C
31 lines
567 B
C
|
#pragma once
|
||
|
|
||
|
#include <random>
|
||
|
|
||
|
#include "Animation.h"
|
||
|
|
||
|
class FadeToColorAnimation : public Animation
|
||
|
{
|
||
|
public:
|
||
|
FadeToColorAnimation(Fader *fader, const Fader::Color &color);
|
||
|
|
||
|
void loop(uint64_t frame) override;
|
||
|
|
||
|
void stop(void) override
|
||
|
{
|
||
|
m_fader->fade_color(Fader::Color{0, 0, 0, 0});
|
||
|
m_stopping = true;
|
||
|
}
|
||
|
|
||
|
void reset(void) override
|
||
|
{
|
||
|
m_stopping = false;
|
||
|
m_running = true;
|
||
|
}
|
||
|
|
||
|
private:
|
||
|
Fader::Color m_color;
|
||
|
|
||
|
bool m_stopping;
|
||
|
};
|