Merge pull request #77 from Makuna/HsbColorFix

Hsbcolorfix
This commit is contained in:
Michael Miller
2016-03-01 16:27:39 -08:00
2 changed files with 6 additions and 2 deletions

View File

@@ -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.

View File

@@ -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;