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:
authorPhilipp Oeser <info@graphics-engineer.com>2020-04-22 19:53:47 +0300
committerPhilipp Oeser <info@graphics-engineer.com>2020-04-30 10:54:09 +0300
commit2b094be9493dd1022a5f07ed1a1cde69670474d8 (patch)
tree4ed0a9396d387bd09fa4bbaefc6cba06d503f308 /source/blender/editors/sculpt_paint/paint_image.c
parentcd833d887995d210b5998bd7d17c59cbb8fe0cba (diff)
Fix T75985: Texture paint brush gradients results in wrong color
A Colorband's CBData color **is not** considered `PROP_COLOR_GAMMA`. A Brushes color **is** considered `PROP_COLOR_GAMMA`. (PROP_COLOR_GAMMA is used for colors which would be color managed before display, could be renamed to something better once...) This leads to different rgb values in ColorBand.CBData of br->gradient and brush->rgb for seemingly identical colors. (this is because color pickers do differently in case block->is_color_gamma_picker/ ui_but_is_color_gamma) Now it looks like `paint_brush_color_get` is expected to return a color in sRGB (according to @jbakker this is for legacy reasons) so we need to run the colorband colors through linear -> sRGB. It might very well be the case that a much deeper cleanup in this area is needed, this is just a fix to get gradient brush colors consistent again... Maniphest Tasks: T75985 Differential Revision: https://developer.blender.org/D7501
Diffstat (limited to 'source/blender/editors/sculpt_paint/paint_image.c')
-rw-r--r--source/blender/editors/sculpt_paint/paint_image.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/source/blender/editors/sculpt_paint/paint_image.c b/source/blender/editors/sculpt_paint/paint_image.c
index d913bc2e242..e227db1c644 100644
--- a/source/blender/editors/sculpt_paint/paint_image.c
+++ b/source/blender/editors/sculpt_paint/paint_image.c
@@ -388,6 +388,10 @@ void paint_brush_color_get(struct Scene *scene,
break;
}
}
+ /* Gradient / Colorband colors are not considered PROP_COLOR_GAMMA.
+ * Brush colors are expected to be in sRGB though. */
+ IMB_colormanagement_scene_linear_to_srgb_v3(color_gr);
+
copy_v3_v3(color, color_gr);
}
else {