[Bf-blender-cvs] [896d3f1ce5a] blender-v3.0-release: UI: Do not shade alpha when blending colors

Yevgeny Makarov noreply at git.blender.org
Fri Nov 12 17:52:22 CET 2021


Commit: 896d3f1ce5ab20965855f85c097d66a26fa16793
Author: Yevgeny Makarov
Date:   Fri Nov 12 08:51:31 2021 -0800
Branches: blender-v3.0-release
https://developer.blender.org/rB896d3f1ce5ab20965855f85c097d66a26fa16793

UI: Do not shade alpha when blending colors

UI_GetThemeColorBlendShade4fv incorrectly changing alpha by the amount
of the shading offset.

See D9944 for more details.

Differential Revision: https://developer.blender.org/D9944

Reviewed by Hans Goudey

===================================================================

M	source/blender/editors/interface/resources.c

===================================================================

diff --git a/source/blender/editors/interface/resources.c b/source/blender/editors/interface/resources.c
index aece2e58f1e..d960f5e6b1d 100644
--- a/source/blender/editors/interface/resources.c
+++ b/source/blender/editors/interface/resources.c
@@ -1340,7 +1340,8 @@ void UI_GetThemeColorBlendShade4fv(int colorid1, int colorid2, float fac, int of
   CLAMP(g, 0, 255);
   b = offset + floorf((1.0f - fac) * cp1[2] + fac * cp2[2]);
   CLAMP(b, 0, 255);
-  a = offset + floorf((1.0f - fac) * cp1[3] + fac * cp2[3]);
+
+  a = floorf((1.0f - fac) * cp1[3] + fac * cp2[3]); /* No shading offset. */
   CLAMP(a, 0, 255);
 
   col[0] = ((float)r) / 255.0f;



More information about the Bf-blender-cvs mailing list