Fix T97097: Color Filter saturates colors that have no saturation

This commit is contained in:
Joseph Eagar 2022-04-11 10:24:01 -07:00
parent 7163db99c4
commit a99639792b
Notes: blender-bot 2023-02-14 07:18:54 +01:00
Referenced by issue #97097, Sculpt Painting: Color Filter saturates colors that have no saturation
1 changed files with 8 additions and 2 deletions

View File

@ -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);