From c4f711a14b6364e483d381c4b9c1591c7377daa0 Mon Sep 17 00:00:00 2001 From: Makuna Date: Tue, 1 Mar 2016 16:24:26 -0800 Subject: [PATCH] Fix Hsb Convert --- src/RgbColor.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) 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;