From 4674fe1f10edc3e2109d755e5cb8ce50a4becc0a Mon Sep 17 00:00:00 2001 From: Shriramana Sharma Date: Mon, 9 Jul 2018 23:12:27 +0530 Subject: [PATCH] add saturation option --- README.md | 8 +++++++- src/Kaleidoscope-LEDEffect-Breathe.cpp | 2 +- src/Kaleidoscope-LEDEffect-Breathe.h | 1 + 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 853ab20d..92048268 100644 --- a/README.md +++ b/README.md @@ -35,7 +35,13 @@ The plugin provides the `LEDBreatheEffect` object, which has a single property: > The hue of the breathe effect. > -> Defaults to 170. +> Defaults to 170, a blue hue. + +### `.saturation` + +> The color saturation of the breathe effect. +> +> Defaults to 255, the maximum. ## Dependencies diff --git a/src/Kaleidoscope-LEDEffect-Breathe.cpp b/src/Kaleidoscope-LEDEffect-Breathe.cpp index d7c9484c..1d0b92ab 100644 --- a/src/Kaleidoscope-LEDEffect-Breathe.cpp +++ b/src/Kaleidoscope-LEDEffect-Breathe.cpp @@ -2,7 +2,7 @@ namespace kaleidoscope { void LEDBreatheEffect::update(void) { - cRGB color = breath_compute(hue); + cRGB color = breath_compute(hue, saturation); ::LEDControl.set_all_leds_to(color); } } diff --git a/src/Kaleidoscope-LEDEffect-Breathe.h b/src/Kaleidoscope-LEDEffect-Breathe.h index 715bd819..64674f2b 100644 --- a/src/Kaleidoscope-LEDEffect-Breathe.h +++ b/src/Kaleidoscope-LEDEffect-Breathe.h @@ -9,6 +9,7 @@ class LEDBreatheEffect : public LEDMode { LEDBreatheEffect(void) {} uint8_t hue = 170; + uint8_t saturation = 255; protected: void update(void) final;