Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'source/blender/blenlib/intern/math_color.c')
-rw-r--r--source/blender/blenlib/intern/math_color.c7
1 files changed, 2 insertions, 5 deletions
diff --git a/source/blender/blenlib/intern/math_color.c b/source/blender/blenlib/intern/math_color.c
index 6637d74dbb1..396f2c52058 100644
--- a/source/blender/blenlib/intern/math_color.c
+++ b/source/blender/blenlib/intern/math_color.c
@@ -33,17 +33,14 @@ void hsv_to_rgb(float h, float s, float v, float *r, float *g, float *b)
int i;
float f, p, q, t;
- h *= 360.0f;
-
if(s==0.0f) {
*r = v;
*g = v;
*b = v;
}
else {
- if(h== 360.0f) h = 0.0f;
-
- h /= 60.0f;
+ h= (h - floor(h))*6.0f;
+
i = (int)floor(h);
f = h - i;
p = v*(1.0f-s);