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:
authorPablo Dobarro <pablodp606@gmail.com>2020-06-29 19:44:13 +0300
committerPablo Dobarro <pablodp606@gmail.com>2020-06-30 20:13:45 +0300
commitdb7d370657efa39a3bd69f057c8f405c17c41ac5 (patch)
treea42a57de4342db10799c0c087baa648888471d86 /source/blender/editors/sculpt_paint/sculpt.c
parent7dbfc864e6f851869fb8ec46fc8755c034028590 (diff)
Fix T78201: Paint color not matching the UI and color picker
The color picker and brush->rgb values are in srgb, but sculpt vertex colors works in linear, so they need to be converted. Reviewed By: sergey Maniphest Tasks: T78201 Differential Revision: https://developer.blender.org/D8111
Diffstat (limited to 'source/blender/editors/sculpt_paint/sculpt.c')
-rw-r--r--source/blender/editors/sculpt_paint/sculpt.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/source/blender/editors/sculpt_paint/sculpt.c b/source/blender/editors/sculpt_paint/sculpt.c
index 3098a0bfcb8..d414d6d8f0f 100644
--- a/source/blender/editors/sculpt_paint/sculpt.c
+++ b/source/blender/editors/sculpt_paint/sculpt.c
@@ -74,6 +74,8 @@
#include "DEG_depsgraph.h"
+#include "IMB_colormanagement.h"
+
#include "WM_api.h"
#include "WM_message.h"
#include "WM_toolsystem.h"
@@ -8134,7 +8136,10 @@ static int sculpt_sample_color_invoke(bContext *C,
return OPERATOR_CANCELLED;
}
- BKE_brush_color_set(scene, brush, active_vertex_color);
+ float color_srgb[3];
+ copy_v3_v3(color_srgb, active_vertex_color);
+ IMB_colormanagement_scene_linear_to_srgb_v3(color_srgb);
+ BKE_brush_color_set(scene, brush, color_srgb);
BKE_brush_alpha_set(scene, brush, active_vertex_color[3]);
WM_event_add_notifier(C, NC_BRUSH | NA_EDITED, brush);