Skip to content

Commit 03ce534

Browse files
committed
brighten up show_force edge colors
1 parent 3223dec commit 03ce534

File tree

1 file changed

+4
-7
lines changed

1 file changed

+4
-7
lines changed

src/compas_rv/scene/diagramobject.py

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -75,14 +75,11 @@ def compute_edge_colors(self, tol=1e-3) -> None:
7575
if fmax - fmin < tol:
7676
return
7777
colors = []
78-
# colormap = ColorMap.from_two_colors(Color.green(), Color.blue())
79-
colormap = ColorMap.from_three_colors(Color.blue(), Color.green(), Color.red())
78+
8079
for force, magnitude in zip(forces, magnitudes):
81-
if force > 0:
82-
color = colormap(magnitude, minval=fmin, maxval=fmax)
83-
colors.append(color)
84-
else:
85-
colors.append(Color.red())
80+
if fmin != fmax:
81+
colors.append(Color.from_i((magnitude - fmin) / (fmax - fmin)))
82+
8683
return colors
8784

8885
# =============================================================================

0 commit comments

Comments
 (0)