diff options
author | Sebastian Parborg <zeddb> | 2018-12-17 21:13:30 +0300 |
---|---|---|
committer | Brecht Van Lommel <brechtvanlommel@gmail.com> | 2018-12-17 21:18:16 +0300 |
commit | 1eafa91f647143b565914b71480bb90cd941e0ed (patch) | |
tree | a01791be6a50c02d162e9b9a916c5ac5bf72fc97 /source/blender | |
parent | f6a77a759bbbe407d0c38dbd0002db685c569b86 (diff) |
Fix T59424: color wheel snaps to center, losing hue when value is zero.
Differential Revision: https://developer.blender.org/D4090
Diffstat (limited to 'source/blender')
-rw-r--r-- | source/blender/blenlib/intern/math_color.c | 5 |
1 files changed, 3 insertions, 2 deletions
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; } |