[Bf-blender-cvs] [6e7da7616b6] blender2.8: Icons: avoid error with colors out of 0-255 range

Campbell Barton noreply at git.blender.org
Tue Aug 21 14:39:36 CEST 2018


Commit: 6e7da7616b6b02d2827f306ea4e55510a79b79de
Author: Campbell Barton
Date:   Tue Aug 21 22:44:08 2018 +1000
Branches: blender2.8
https://developer.blender.org/rB6e7da7616b6b02d2827f306ea4e55510a79b79de

Icons: avoid error with colors out of 0-255 range

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

M	release/datafiles/blender_icons_geom.py

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

diff --git a/release/datafiles/blender_icons_geom.py b/release/datafiles/blender_icons_geom.py
index f3af7f997c1..b9f7c05ac31 100644
--- a/release/datafiles/blender_icons_geom.py
+++ b/release/datafiles/blender_icons_geom.py
@@ -162,7 +162,7 @@ def mesh_data_lists_from_mesh(me, material_colors):
                 ),
                 # RGBA color.
                 tuple((
-                    [int(c * b * 255) for c, b in zip(cn.color, base_color)]
+                    [min(max(int(c * b * 255), 0), 255) for c, b in zip(cn.color, base_color)]
                     for cn in (c0, c1, c2)
                 )),
             ))



More information about the Bf-blender-cvs mailing list