diff options
author | Joseph Eagar <joeedh@gmail.com> | 2022-04-11 20:24:01 +0300 |
---|---|---|
committer | Joseph Eagar <joeedh@gmail.com> | 2022-04-11 20:24:01 +0300 |
commit | a99639792b1628493139eb9943ae4befbdc6b613 (patch) | |
tree | f3e3a9f70838baa2de53bad217866c2ac71db42a /source/blender/editors/sculpt_paint/sculpt_filter_color.c | |
parent | 7163db99c4d8b908fb2c7c7768754b91cac0eb5e (diff) |
Fix T97097: Color Filter saturates colors that have no saturation
Diffstat (limited to 'source/blender/editors/sculpt_paint/sculpt_filter_color.c')
-rw-r--r-- | source/blender/editors/sculpt_paint/sculpt_filter_color.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/source/blender/editors/sculpt_paint/sculpt_filter_color.c b/source/blender/editors/sculpt_paint/sculpt_filter_color.c index ebebd9efd80..a5bd87117fc 100644 --- a/source/blender/editors/sculpt_paint/sculpt_filter_color.c +++ b/source/blender/editors/sculpt_paint/sculpt_filter_color.c @@ -129,8 +129,14 @@ static void color_filter_task_cb(void *__restrict userdata, break; case COLOR_FILTER_SATURATION: rgb_to_hsv_v(orig_color, hsv_color); - hsv_color[1] = clamp_f(hsv_color[1] + fade, 0.0f, 1.0f); - hsv_to_rgb_v(hsv_color, final_color); + + if (hsv_color[1] != 0.0f) { + hsv_color[1] = clamp_f(hsv_color[1] + fade, 0.0f, 1.0f); + hsv_to_rgb_v(hsv_color, final_color); + } + else { + copy_v3_v3(final_color, orig_color); + } break; case COLOR_FILTER_VALUE: rgb_to_hsv_v(orig_color, hsv_color); |