From c08fd5012473b589b70df152cac8fce7e17ee851 Mon Sep 17 00:00:00 2001 From: Thijs Triemstra Date: Thu, 11 Apr 2024 15:23:47 +0200 Subject: [PATCH] add setColor --- src/Animations/Color.h | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/src/Animations/Color.h b/src/Animations/Color.h index 6471d5f..8d45baf 100644 --- a/src/Animations/Color.h +++ b/src/Animations/Color.h @@ -9,13 +9,17 @@ class Color : public Animation public: using Animation::Animation; - void reset() - { + CRGB _color; + + void setColor(CRGB color) { + _color = color; + FastLEDHub.getColorPicker(0)->value = _color; + } + void reset() { } - void loop() - { - CRGB color = FastLEDHub.getColorPicker(0)->value; - FastLEDHub.showColor(color); + void loop() { + _color = FastLEDHub.getColorPicker(0)->value; + FastLEDHub.showColor(_color); } };