diff --git a/library.properties b/library.properties index 4985a4e..fe1d0af 100644 --- a/library.properties +++ b/library.properties @@ -1,5 +1,5 @@ name=NeoPixelBus by Makuna -version=2.0.0 +version=2.0.1 author=Michael C. Miller (makuna@live.com) maintainer=Michael C. Miller (makuna@live.com) sentence=A library that makes controlling NeoPixels (WS2811, WS2812 & SK6812) easy. diff --git a/src/RgbColor.cpp b/src/RgbColor.cpp index da93240..6bed4f0 100644 --- a/src/RgbColor.cpp +++ b/src/RgbColor.cpp @@ -93,9 +93,13 @@ RgbColor::RgbColor(HsbColor color) else { if (h < 0.0f) + { h += 1.0f; - if (h > 1.0f) + } + else if (h >= 1.0f) + { h -= 1.0f; + } h *= 6.0f; int i = (int)h; float f = h - i;