Fix #146619: Random Color workbench mode too saturated with ACEScg working space

Pull Request: https://projects.blender.org/blender/blender/pulls/146664
This commit is contained in:
Brecht Van Lommel
2025-09-23 18:56:31 +02:00
committed by Brecht Van Lommel
parent e8deba14c3
commit 09d9239efd
2 changed files with 7 additions and 0 deletions

View File

@@ -27,6 +27,8 @@
#include "BLI_math_vector.hh"
#include "BLI_memblock.h"
#include "IMB_colormanagement.hh"
#include "gpencil_engine_private.hh"
#include "DEG_depsgraph.hh"
@@ -274,6 +276,7 @@ static void grease_pencil_layer_random_color_get(const Object *ob,
float hue = BLI_hash_int_01(ob_hash * gpl_hash);
const float hsv[3] = {hue, hsv_saturation, hsv_value};
hsv_to_rgb_v(hsv, r_color);
IMB_colormanagement_rec709_to_scene_linear(r_color, r_color);
}
tLayer *grease_pencil_layer_cache_get(tObject *tgp_ob, int layer_id, const bool skip_onion)

View File

@@ -7,6 +7,9 @@
#include "BLI_ghash.h"
#include "BLI_hash.h"
#include "BLI_math_color.h"
#include "IMB_colormanagement.hh"
/* get_image */
#include "BKE_node_legacy_types.hh"
#include "DNA_material_types.h"
@@ -25,6 +28,7 @@ Material::Material(::Object &ob, bool random)
}
float3 hsv = float3(BLI_hash_int_01(hash), 0.5f, 0.8f);
hsv_to_rgb_v(hsv, base_color);
IMB_colormanagement_rec709_to_scene_linear(base_color, base_color);
}
else {
base_color = ob.color;