[Bf-blender-cvs] [1eafa91f647] blender2.8: Fix T59424: color wheel snaps to center, losing hue when value is zero.
Sebastian Parborg
noreply at git.blender.org
Mon Dec 17 19:18:22 CET 2018
Commit: 1eafa91f647143b565914b71480bb90cd941e0ed
Author: Sebastian Parborg
Date: Mon Dec 17 19:13:30 2018 +0100
Branches: blender2.8
https://developer.blender.org/rB1eafa91f647143b565914b71480bb90cd941e0ed
Fix T59424: color wheel snaps to center, losing hue when value is zero.
Differential Revision: https://developer.blender.org/D4090
===================================================================
M source/blender/blenlib/intern/math_color.c
===================================================================
diff --git a/source/blender/blenlib/intern/math_color.c b/source/blender/blenlib/intern/math_color.c
index 09a5762e4e0..91d733e9691 100644
--- a/source/blender/blenlib/intern/math_color.c
+++ b/source/blender/blenlib/intern/math_color.c
@@ -328,11 +328,12 @@ void rgb_to_hsv_compat(float r, float g, float b, float *lh, float *ls, float *l
rgb_to_hsv(r, g, b, lh, ls, lv);
- if (*lv <= 0.0f) {
+ if (*lv <= 1e-8) {
+ /* Very low v values will affect the hs values, correct them in post. */
*lh = orig_h;
*ls = orig_s;
}
- else if (*ls <= 0.0f) {
+ else if (*ls <= 1e-8) {
*lh = orig_h;
}
More information about the Bf-blender-cvs
mailing list